Skip to content

Is there a way for qsv sqlp --infer-len 0 to compute the schema once then reuse for other queries? #2201

Answered by jqnatividad
rzmk asked this question in Q&A
Discussion options

You must be logged in to vote

You can now create and reuse polars schemas with qsv 0.137.0, using the sqlp --cache-schema option:

qsv/src/cmd/sqlp.rs

Lines 190 to 197 in 0c206c5

--cache-schema Create and cache Polars schema JSON files.
If specified and the schema file/s do not exist, it will save the
inferred schemas in JSON format. Each schema file will have the same
file stem as the corresponding input file, with the extension ".pschema.json"
(data.csv's Polars schema file will be data.pschema.json)
If the file/s exists, it will load the schema instead of inferring it
(ignoring --infer-len) and attempt to use it for each corresponding
Polars "table" with the sam…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jqnatividad
Comment options

Answer selected by jqnatividad
@jqnatividad
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants