⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
DuckDB 2.0 ドキュメント 全文検索
per page, with , order by , clip by
Results of 1 - 10 of about 57 for auto (0.002 sec.)
Loading JSON 13495
The DuckDB JSON reader can automatically infer which configuration flags to use by analyzing the JSON file. This will work correctly in most situations, and should be the first option attempted. In rare situations where the JSON reader cann ... er to correctly parse the JSON file. The read_json Function The read_json is the simplest method of loading JSON files: it automatically attempts to figure out the correct configuration of the JSON reader. It also automatically deduces types of colum ... djson_objects(filename) Alias for read_json_objects with the parameter format set to newline_delimited . read_json_objects_auto(filename) Alias for read_json_objects with the parameter format set to auto . Parameters These functions have the followin ... an error. Added in DuckDB 2.0. BOOL false compression The compression type for the file. By default this will be detected automatically from the file extension (e.g., t.json.gz will use gzip, t.json will use none). Options are none , gzip , zstd and ...
https://man.mtool.work/duckdb/2.0/data/json/loading_json.html
CSV Import 12232
Examples The following examples use the flights.csv file. Read a CSV file from disk, auto-infer options: SELECT * FROM 'flights.csv'; Use the read_csv function with custom options: SELECT * FROM read_csv('flights.csv', delim = '|', header = ... te': 'DATE', 'UniqueCarrier': 'VARCHAR', 'OriginCityName': 'VARCHAR', 'DestCityName': 'VARCHAR' }); Read a CSV from stdin, auto-infer options: cat flights.csv | duckdb -c "SELECT * FROM read_csv('/dev/stdin')" Read a CSV file into a table: CREATE TAB ... , and do not have a schema. The CSV reader needs to cope with all of these different situations. The DuckDB CSV reader can automatically infer which configuration flags to use by analyzing the CSV file using the CSV sniffer . This will work correctly ... out the correct configuration it is possible to manually configure the CSV reader to correctly parse the CSV file. See the auto detection page for more information. Auto-detection ( auto_detect ) is enabled by default. Setting an option explicitly do ...
https://man.mtool.work/duckdb/2.0/data/csv/overview.html
Reading Faulty CSV Files 10896
CSV files can come in all shapes and forms, with some presenting many errors that make the process of cleanly reading them inherently difficult. To help users read these files, DuckDB supports detailed error messages, the ability to skip fa ... d value out of range: "The 90s", expected format is (DD-MM-YYYY) Column date is being converted as type DATE This type was auto-detected from the CSV file. Possible solutions: * Override the type for this column manually by setting the type explicitl ... y, e.g., types={'birth_date': 'VARCHAR'} * Set the sample size to a larger value to enable the auto-detection to scan more values, e.g., sample_size=-1 * Use a COPY statement to automatically derive types from an existing ... table. file= people.csv delimiter = , (Auto-Detected) quote = " (Auto-Detected) escape = " (Auto-Detected) new_line = \r\n (Auto-Detected) header = true (Auto-Detecte ...
https://man.mtool.work/duckdb/2.0/data/csv/reading_faulty_csv_files.html
COPY Statement 9765
Examples Read a CSV file into the lineitem table, using auto-detected CSV options: COPY lineitem FROM 'lineitem.csv'; Read a CSV file into the lineitem table, using manually specified CSV options: COPY lineitem FROM 'lineitem.csv' (DELIMITE ... nto the lineitem table: COPY lineitem FROM 'lineitem.pq' (FORMAT parquet); Read a JSON file into the lineitem table, using auto-detected options: COPY lineitem FROM 'lineitem.json' (FORMAT json, AUTO_DETECT true); Read a CSV file into the lineitem ta ... y the contents of lineitem.tbl into the lineitem table, where the delimiter, quote character, and presence of a header are automatically detected: COPY lineitem FROM 'lineitem.tbl' (AUTO_DETECT true); Read the contents of a comma-separated file names ... elected. Vanilla DuckDB provides CSV , PARQUET and JSON but additional copy functions can be added by extensions . VARCHAR auto USE_TMP_FILE Whether or not to write to a temporary file first if the original file exists ( target.csv.tmp ). This preven ...
https://man.mtool.work/duckdb/2.0/sql/statements/copy.html
CSV Import Tips 9633
Below is a collection of tips to help when attempting to import complex CSV files. In the examples, we use the flights.csv file. Override the Header Flag if the Header Is Not Correctly Detected If a file contains only string columns the hea ... der auto-detection might fail. Provide the header option to override this behavior. SELECT * FROM read_csv('flights.csv', header = ... true); Provide Names if the File Does Not Contain a Header If the file does not contain a header, names will be auto-generated by default. You can provide your own names with the names option. SELECT * FROM read_csv('flights.csv', names = ... into a Table The COPY statement copies data directly into a table. The CSV reader uses the schema of the table instead of auto-detecting types from the file. This speeds up the auto-detection, and prevents mistakes from being made during auto-detect ...
https://man.mtool.work/duckdb/2.0/data/csv/tips.html
CSV Auto Detection 9501
When using read_csv , the system tries to automatically infer how to read the CSV file using the CSV sniffer . This step is necessary because CSV files are not self-describing and come in many different dialects. The auto-detection works ro ... etect the types of each of the columns. Detect whether or not the file has a header row. By default the system will try to auto-detect all options. However, options can be individually overridden by the user. This can be useful in case the system mak ... specify. For example, passing ignore_errors = true lets the sniffer skip malformed lines while it detects the dialect. The auto_detect parameter must be true (its default) for sniff_csv ; passing auto_detect = false results in an error. In addition, ... oke sniff_csv (none) sample_size = 1000 Prompt Prompt ready to be used to read the CSV (none) FROM read_csv('my_file.csv', auto_detect=false, delim=',', ...) Prompt The Prompt column contains a SQL command with the configurations detected by the snif ...
https://man.mtool.work/duckdb/2.0/data/csv/auto_detection.html
Prepared Statements 8958
DuckDB supports prepared statements where parameters are substituted when the query is executed. This can improve readability and is useful for preventing SQL injections . Syntax There are three syntaxes for denoting parameters in prepared ... statements: auto-incremented ( ? ), positional ( $1 ), and named ( $param ). Note that not all clients support all of these syntaxes, e.g., ... the JDBC client only supports auto-incremented parameters in prepared statements. Example Dataset In the following, we introduce the three different syntaxes ... e'll look for people whose name starts with a B and are at least 40 years old. This will return a single row <'Bob', 41> . Auto-Incremented Parameters: ? DuckDB supports using prepared statements with auto-incremented indexing, i.e., the position of ...
https://man.mtool.work/duckdb/2.0/sql/query_syntax/prepared_statements.html
JSON Overview 8429
DuckDB supports SQL functions that are useful for reading values from existing JSON and creating new JSON data. JSON is supported with the json extension which is shipped with most DuckDB distributions and is auto-loaded on first use. If yo ... ARRAY and LIST data types but 0-based indexing for the JSON data type . Examples Loading JSON Read a JSON file from disk, auto-infer options: SELECT * FROM 'todos.json'; Use the read_json function with custom options: SELECT * FROM read_json('todos. ... rray', columns = {userId: 'UBIGINT', id: 'UBIGINT', title: 'VARCHAR', completed: 'BOOLEAN'}); Read a JSON file from stdin, auto-infer options: cat data/json/todos.json | duckdb -c "SELECT * FROM read_json('/dev/stdin')" Read a JSON file into a table: ... CREATE TABLE todos (userId UBIGINT, id UBIGINT, title VARCHAR, completed BOOLEAN); COPY todos FROM 'todos.json' (AUTO_DETECT true); Alternatively, create a table without specifying the schema manually with a CREATE TABLE ... AS SELECT claus ...
https://man.mtool.work/duckdb/2.0/data/json/overview.html
Hive Partitioning 8429
Examples Read data from a Hive partitioned dataset: SELECT * FROM read_parquet('orders/*/*/*.parquet', hive_partitioning = true); Write a table to a Hive partitioned dataset: COPY orders TO 'orders' (FORMAT parquet, PARTITION_BY (year, mont ... oning flag, the values of the columns will be read from the directories. Filter Pushdown Filters on the partition keys are automatically pushed down into the files. This way the system skips reading files that are not necessary to answer a query. For ... g this query, only the following files will be read: orders └── year=2022 └── month=11 ├── file4.parquet └── file5.parquet Auto-detection By default the system tries to infer if the provided files are in a hive partitioned hierarchy. And if so, the h ... ive_partitioning flag is enabled automatically. The auto-detection will look at the names of the folders and search for a 'key' = 'value' pattern. This behavior ...
https://man.mtool.work/duckdb/2.0/data/partitioning/hive_partitioning.html
C++ API 8370
Installation To use the DuckDB C++ API, download the libduckdb archive for your platform. The latest stable version of the DuckDB C++ API is 2.0.0. Warning DuckDB's C++ API is internal. It is not guaranteed to be stable and can change witho ... GER, j INTEGER)"); // insert three rows into the table con.Query("INSERT INTO integers VALUES (3, 4), (5, 6), (7, NULL)"); auto result = con.Query("SELECT * FROM integers"); if (result->HasError()) { cerr << result->GetError() << endl; } else { cout ... Type() and GetErrorObject() are also available for any QueryResult instance which may aid in more explicit error handling. auto result = con.Query("INSERT INTO integers VALUES (1, 2)"); if (result->HasError()) { auto errorType = result->GetErrorType( ... ); switch (errorType) { case duckdb::ExceptionType::CONSTRAINT: { // Example handling auto errorObject = result->GetErrorObject(); errorObject.ConvertErrorToJSON(); std::cout << errorObject.Message() << std::endl; ...
https://man.mtool.work/duckdb/2.0/clients/cpp.html
PREV 1 2 3 4 5 6 NEXT
DuckDB 2.0 Documentation / man.mtool.work