Results of 1 - 10 of about 65 for Keys (0.005 sec.)
- Map Type 13011
- MAP s are similar to STRUCT s in that they are an ordered list of key-value pairs. However, MAP s do not need to have the same keys present for each row, and thus are suitable for use cases where the schema is unknown beforehand or varies p
...er row. MAP s must have a single type for all keys, and a single type for all values. Keys and values can be any type, and the type of the keys does not need to match the ty...pe of the values (e.g., a MAP of VARCHAR to INT is valid). MAP s may not have duplicate keys. MAP s return NULL if a key is not found rather than throwing an error as structs do. In contrast, STRUCT s must have stri...ng keys, but each value may have a different type. See the data types overview for a comparison between nested data types. To cons... - https://man.mtool.work/duckdb/2.0/sql/data_types/map.html
- Map Functions 12052
- Name Description cardinality(map) Return the size of the map (or the number of entries in the map). element_at(map, key) Return the value for a given key as a list, or an empty list if the key is not contained in the map. The type of the ke
...y provided in the second parameter must match the type of the map's keys; else, an error is thrown. map_concat(maps...) Returns a map created from merging the input maps . On key collision the va...the key is not contained in the map. The type of the key provided in the second parameter must match the type of the map's keys; else, an error is thrown. map_extract_value(map, key) Returns the value for a given key or NULL if the key is not contain...ed in the map. The type of the key provided in the second parameter must match the type of the map's keys; else, an error is thrown. map_from_entries(STRUCT(k, v)[]) Returns a map created from the entries of the array. map_keys(... - https://man.mtool.work/duckdb/2.0/sql/functions/map.html
- Parquet Encryption 9747
- Starting with version 0.10.0, DuckDB supports reading and writing encrypted Parquet files. DuckDB broadly follows the Parquet Modular Encryption specification with some limitations . Reading and Writing Encrypted Files Using the PRAGMA add_
...parquet_key function, named encryption keys of 128, 192, or 256 bits can be added to a session. These keys are stored in-memory: PRAGMA add_parquet_key('key128', '012...er and all columns using the footer_key . The Parquet specification allows encryption of individual columns with different keys, e.g.: COPY tbl TO 'tbl.parquet' (ENCRYPTION_CONFIG { footer_key: 'key256', column_keys: {key256: ['col0', 'col1']} }); Ho...rted at the moment and will cause an error to be thrown (for now): Not implemented Error: Parquet encryption_config column_keys not yet implemented Performance Implications Note that encryption has some performance implications. Without encryption, r... - https://man.mtool.work/duckdb/2.0/data/parquet/encryption.html
- JSON Processing Functions 9590
- JSON Extraction Functions There are two extraction functions, which have their respective operators. The operators can only be used if the string is stored as the JSON logical type. These functions support the same two location notations as
...N type, but json_needle can also be a numeric value or a string, however the string must be wrapped in double quotes. json_keys(json[, path]) Returns the keys of json as a LIST of VARCHAR , if json is a JSON object. If path is specified, return the k...ample; 4 SELECT json_array_length(j, ['$.species']) FROM example; [4] SELECT json_type(j) FROM example; OBJECT SELECT json_keys(j) FROM example; [family, species] SELECT json_structure(j) FROM example; {"family":"VARCHAR","species":["VARCHAR"]} SELEC...ified) Return the minimal RFC 7396 merge patch such that json_merge_patch(json_orig, patch) equals json_modified . Deleted keys appear as null , changed and added keys appear with their new values, and unchanged keys are omitted. Nested objects are d... - https://man.mtool.work/duckdb/2.0/data/json/json_functions.html
- Struct Data Type 9347
- Conceptually, a STRUCT column contains an ordered list of columns called “entries”. The entries are referenced by name using strings. This document refers to those entry names as keys. Each row in the STRUCT column must have the same keys.
...T s and LIST s. STRUCT s are similar to PostgreSQL's ROW type. The key difference is that DuckDB STRUCT s require the same keys in each row of a STRUCT column. This allows DuckDB to provide significantly improved performance by fully utilizing its ve...h unnamed entries, use a tuple . Create a struct using the struct_pack function. Note the lack of single quotes around the keys and the use of the := operator: SELECT struct_pack(key1 := 'value1', key2 := 42) AS s; Create a struct using the array not...nest / STRUCT.* Rather than retrieving a single key from a struct, the unnest special function can be used to retrieve all keys from a struct as separate columns. This is particularly useful when a prior operation creates a struct of unknown shape, o... - https://man.mtool.work/duckdb/2.0/sql/data_types/struct.html
- Data Types 9189
- General-Purpose Data Types The table below shows all the built-in general-purpose data types. The alternatives listed in the aliases column can be used to refer to these types as well, however, note that the aliases are not part of the SQL
...3] INTEGER[] MAP A dictionary of multiple named values, each key having the same type and each value having the same type. Keys and values can be any type and can be different types from one another. Rows may have different keys. map([1, 2], ['a', 'b...named values, where each key is a string, but the value can be a different type for each key. Each row must have the same keys. {'i': 42, 'j': 'a'} STRUCT(i INTEGER, j VARCHAR) TUPLE A sequence of multiple unnamed values, accessed by position, where...ts own type information. Each row may hold a value of a different type. 42::VARIANT VARIANT Rules for Case Sensitivity The keys of MAP s are case-sensitive, while keys of UNION s and STRUCT s are case-insensitive. For examples, see the Rules for Case... - https://man.mtool.work/duckdb/2.0/sql/data_types/overview.html
- Schema 9032
- Types It is important to use the correct type for encoding columns (e.g., BIGINT , DATE , DATETIME ). While it is always possible to use string types ( VARCHAR , etc.) to encode more specific values, this is not recommended. Strings use mor
...atically.) First, build a dimension table that assigns an integer key to each distinct value. Sorting the values keeps the keys stable and improves compression: CREATE OR REPLACE TABLE dim_table AS SELECT field_name, (row_number() OVER (ORDER BY fiel..._name))::INTEGER AS field_pk FROM (SELECT DISTINCT field_name FROM fact_table); Then run the aggregation using the integer keys and join the strings back in only at the end, once the result set is small: WITH rollup AS ( SELECT field_pk, count(*) AS...Bestpractice Do not define constraints unless your goal is to ensure data integrity. Microbenchmark: The Effect of Primary Keys We illustrate the effect of using primary keys with the LDBC Comment table at scale factor 300 . This table has approx. 55... - https://man.mtool.work/duckdb/2.0/guides/performance/schema.html
- Extension Repositories 8946
- New Support for custom extension repositories was introduced in DuckDB 2.0. This feature is currently work-in-progress and the syntax may still change. By default, DuckDB installs extensions from its built-in repositories ( core , core_nigh
...d have them install and load just like the built-in ones. A repository is a name, a URL prefix, and one or more RSA public keys that are trusted to sign the extensions served from it. Enabling Custom Repositories Adding custom repositories is gated b...ON REPOSITORY my_repo WITH PREFIX 'https://extensions.example.org'; At CREATE time, DuckDB fetches the repository's public keys and pins them into the repository definition, printing each key's SHA-256 fingerprint so you can compare it against one pu...ttps://extensions.example.org' USING PUBLIC KEY '-----BEGIN PUBLIC KEY----- ...'; Extensions are signed using 2048-bit RSA keys. The key can be provided either in PEM format or as the base64-encoded body of the PEM format. Using a Repository Once a r... - https://man.mtool.work/duckdb/2.0/extensions/extension_repositories.html
- Variant Functions 8874
- This section describes functions that operate on the VARIANT type . New Most variant_* functions were introduced in DuckDB 2.0. The variant_extract , variant_normalize and variant_typeof functions were already available in DuckDB 1.5. Name
...VARIANT value, including nested structure. variant_type(v) Return the top-level type category of a VARIANT value. variant_keys(v) Return the keys of a VARIANT object as a list. variant_extract(v, field) Extract a nested value by object field name or...evel type category of a VARIANT value. | | Example | variant_type('{"a": 1}'::JSON::VARIANT) | | Result | OBJECT | variant_keys(v) | Description | Return the keys of a VARIANT object as a list. | | Example | variant_keys('{"a": 1, "b": 2}'::JSON::VAR...SERT INTO events VALUES ('{"user": {"id": 42, "tags": ["a", "b"]}}'::JSON::VARIANT); SELECT variant_type(payload), variant_keys(payload) FROM events; SELECT * FROM events WHERE variant_contains(payload, {'user': {'id': 42}}::VARIANT);... - https://man.mtool.work/duckdb/2.0/sql/functions/variant.html
- CREATE TABLE Statement 8874
- The CREATE TABLE statement creates a table in the catalog. Examples Create a table with two integer columns ( i and j ): CREATE TABLE t1 (i INTEGER, j INTEGER); Create a table with a primary key: CREATE TABLE t1 (id INTEGER PRIMARY KEY, j V
...r: CREATE TABLE t1 AS FROM t2 LIMIT 0; It is not possible to create tables using CTAS statements with constraints (primary keys, check constraints, etc.). Check Constraints A CHECK constraint is an expression that must be satisfied by the values of e...Foreign Key Constraints A FOREIGN KEY is a column (or set of columns) that references another table's primary key. Foreign keys check referential integrity, i.e., the referred primary key must exist in the other table upon insertion. CREATE TABLE t1..., 2); Constraint Error: Violates foreign key constraint because key "id: 2" does not exist in the referenced table Foreign keys can be defined on composite primary keys: CREATE TABLE t3 (id INTEGER, j VARCHAR, PRIMARY KEY (id, j)); CREATE TABLE t4 (... - https://man.mtool.work/duckdb/2.0/sql/statements/create_table.html
DuckDB 2.0 Documentation / man.mtool.work