Refer to the multiple files section for more information. Multiple files can be read at once by providing a glob or a list of files. The system will automatically infer that you are reading a Parquet file. parquet, the function syntax is optional. SELECT * FROM parquet_scan('test.parquet') SELECT * FROM read_parquet('test.parquet') DuckDB provides support for both reading and writing Parquet files in an efficient manner, as well as support for pushing filters and projections into the Parquet file scans. Parquet files are compressed columnar files that are efficient to load and process. read a single Parquet file SELECT * FROM 'test.parquet' - figure out which columns/types are in a Parquet file DESCRIBE SELECT * FROM 'test.parquet' - create a table from a Parquet file CREATE TABLE test AS SELECT * FROM 'test.parquet' - if the file does not end in ".parquet", use the read_parquet function SELECT * FROM read_parquet ( 'test.parq' ) - use list parameter to read 3 Parquet files and treat them as a single table SELECT * FROM read_parquet () - read all files that match the glob pattern SELECT * FROM 'test/*.parquet' - read all files that match the glob pattern, and include a "filename" column that specifies which file each row came from SELECT * FROM read_parquet ( 'test/*.parquet', filename = true ) - use a list of globs to read all Parquet files from 2 specific folders SELECT * FROM read_parquet () - read over https SELECT * FROM read_parquet ( '' ) - query the metadata of a Parquet file SELECT * FROM parquet_metadata ( 'test.parquet' ) - query the schema of a Parquet file SELECT * FROM parquet_schema ( 'test.parquet' ) - write the results of a query to a Parquet file COPY ( SELECT * FROM tbl ) TO 'result-snappy.parquet' ( FORMAT 'parquet' ) - write the results from a query to a Parquet file with specific compression and row_group_size COPY ( FROM generate_series ( 100000 )) TO 'test.parquet' ( FORMAT 'parquet', COMPRESSION 'ZSTD', ROW_GROUP_SIZE 100000 ) - export the table contents of the entire database as parquet EXPORT DATABASE 'target_directory' ( FORMAT PARQUET ) Parquet Files
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |