⌘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 81 for struct (0.004 sec.)
Struct Functions 13086
The functions on this page work on STRUCT values . Functions that access entries by position, such as struct[idx] , struct_extract_at , struct_contains , struct_position and struct_values , also accept TUPLE values , i.e., structs with unna ... med entries. struct_concat accepts either only STRUCT s or only TUPLE s. Functions that work with entry names, i.e., struct_insert , struct_ke ... ys , struct_update and remap_struct , require a STRUCT . Name Description struct.entry Dot notation that serves as an alias for struct ... _extract from named STRUCT s. struct[entry] Bracket notation that serves as an alias for struct_extract from named STRUCT s. struct[idx] Bracket nota ...
https://man.mtool.work/duckdb/2.0/sql/functions/struct.html
Struct Data Type 12143
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. ... The names of the struct entries are part of the schema . Each row in a STRUCT column must have the same layout. The names of the struct entries ar ... e case-insensitive. STRUCT s are typically used to nest multiple columns into a single column, and the nested column can be of any type, including ot ... her STRUCT s and LIST s. STRUCT s are similar to PostgreSQL's ROW type. The key difference is that DuckDB STRUCT s require the same k ...
https://man.mtool.work/duckdb/2.0/sql/data_types/struct.html
Types 10490
DuckDB is a strongly typed database system. As such, every column has a single type specified. This type is constant over the entire column. That is to say, a column that is labeled as an INTEGER column will only contain INTEGER values. Duc ... For example, it is possible to define an array of integers ( INTEGER[] ). It is also possible to define types as arbitrary structs ( ROW(i INTEGER, j VARCHAR) ). For that reason, native DuckDB type objects are not mere enums, but a class that can poten ... pe ). For most primitive types, e.g., integers or varchars, the enum is sufficient. For more complex types, such as lists, structs or decimals, the logical type must be used. typedef enum DUCKDB_TYPE { DUCKDB_TYPE_INVALID = 0, DUCKDB_TYPE_BOOLEAN = 1, ... 0, DUCKDB_TYPE_TIMESTAMP_MS = 21, DUCKDB_TYPE_TIMESTAMP_NS = 22, DUCKDB_TYPE_ENUM = 23, DUCKDB_TYPE_LIST = 24, DUCKDB_TYPE_STRUCT = 25, DUCKDB_TYPE_MAP = 26, DUCKDB_TYPE_ARRAY = 33, DUCKDB_TYPE_UUID = 27, DUCKDB_TYPE_UNION = 28, DUCKDB_TYPE_BIT = 29, D ...
https://man.mtool.work/duckdb/2.0/clients/c/types.html
Conversion between DuckDB and Python 9971
This page documents the rules for converting DuckDB results to Python and Python objects to DuckDB . Result Conversion: DuckDB Results to Python A result is read from a relation or, when using the DB-API / con.execute() , from the connectio ... ed as datetime.date.max and -infinity as datetime.date.min . bytes bytes converts to BLOB by default. When it's used to construct a Value object of type BIT , it maps to BIT instead, and its bytes are read as the characters 0 and 1 , as in duckdb.Value ... GER : print(con.execute("SELECT ?", [[12345, "test"]]).fetchall()) [(['12345', 'test'],)] A NaN stays NaN inside a list, a struct, a map or a duckdb.Value of a nested type. A list that mixes datetime values with and without tzinfo becomes a TIMESTAMPTZ ... query parameter and in values() , which read the values without tzinfo as UTC. dict The dict object can convert to either STRUCT(...) or MAP(..., ...) , depending on its keys and on where it is used: A dict whose keys are all strings becomes a STRUCT ...
https://man.mtool.work/duckdb/2.0/clients/python/conversion.html
Unnesting 9384
Unnesting is an operation that decomposes values of a composite types into its components. Values of the LIST and STRUCT type may be unnested using the unnest() function . Unnesting turns a LIST -typed value into a table column: each list-e ... lement creates a row, and each element become a column value. Unnesting a STRUCT -typed value creates a column for each member. The member key becomes the column name, and the member value becomes a colu ... mn value. Values of a STRUCT -type may also be unnested using dot-star ( ⟨struct⟩.* ) shorthand syntax , but the unnest() function offers some addition ... al functionality. For a TUPLE (unnamed struct), the unnesting operation is the same as for a named STRUCT , but in this case the column name is generated based on the ( ...
https://man.mtool.work/duckdb/2.0/sql/query_syntax/unnest.html
Complete API 9111
This page contains the reference for DuckDB's C API. The reference contains several deprecation notices. These concern methods whose long-term availability is not guaranteed as they may be removed in the future. That said, DuckDB's develope ... string_t string ); const char * duckdb_string_t_data ( duckdb_string_t * string ); Date Time Timestamp Helpers duckdb_date_struct duckdb_from_date ( duckdb_date date ); duckdb_date duckdb_to_date ( duckdb_date_struct date ); bool duckdb_is_finite_date ... ( duckdb_date date ); duckdb_time_struct duckdb_from_time ( duckdb_time time ); duckdb_time_tz duckdb_create_time_tz ( int64_t micros , int32_t offset ); duckdb_ti ... me_tz_struct duckdb_from_time_tz ( duckdb_time_tz micros ); duckdb_time duckdb_to_time ( duckdb_time_struct time ); duckdb_timestamp_st ...
https://man.mtool.work/duckdb/2.0/clients/c/api.html
Vectors 9111
Vectors represent a horizontal slice of a column. They hold a number of values of a specific type, similar to an array. Vectors are the core data representation used in DuckDB. Vectors are typically stored within data chunks . The vector an ... e the validity mask does not need to be checked. Strings String values are stored as a duckdb_string_t . This is a special struct that stores the string inline (if it is short, i.e., <= 12 bytes ) or a pointer to the string data if it is longer than 12 ... bytes. typedef struct { union { struct { uint32_t length; char prefix[4]; char *ptr; } pointer; struct { uint32_t length; char inlined[12]; } in ... o the given dictionary entry. Note that the enum dictionary is the same for the entire column – and so only needs to be constructed once. Structs Structs are nested types that contain any number of child types. Think of them like a struct in C. The way ...
https://man.mtool.work/duckdb/2.0/clients/c/vector.html
Run Queries 9070
Overview Java applications send queries and read result sets through the familiar Statement , PreparedStatement , and ResultSet interfaces. This page covers sending queries and reading DuckDB's nested and composite types. For opening the Co ... on for better options. Reading Nested and Composite Types DuckDB supports nested and composite column types such as LIST , STRUCT , MAP , UNION , and ENUM . The JDBC driver maps each of these to an idiomatic Java object. Read the values from a ResultSe ... lowing types: DuckDB type Java type returned by getObject LIST , ARRAY org.duckdb.DuckDBArray (implements java.sql.Array ) STRUCT org.duckdb.DuckDBStruct (implements java.sql.Struct ) MAP java.util.LinkedHashMap UNION the resolved member value ENUM Str ... while (rs.next()) { DuckDBArray list = (DuckDBArray) rs.getObject(1); Object[] values = (Object[]) list.getArray(); DuckDBStruct struct = (DuckDBStruct) rs.getObject(2); Map<String, Object> fields = struct.getMap(); } } The DuckDB result set also expo ...
https://man.mtool.work/duckdb/2.0/clients/java/querying.html
Types API 8523
The DuckDBPyType class, duckdb.sqltypes.DuckDBPyType , represents one of the data types . Use DuckDBPyType to describe SQL types when declaring function parameters, return types or casts. Python types such as int are accepted too: int descr ... R numpy.uint64 UBIGINT numpy.uint8 UTINYINT Type Names A string is read as a SQL type name, such as "INTEGER" , "INT[]" , "STRUCT(a INT)" or "MAP(INT, VARCHAR)" : import duckdb from duckdb.sqltypes import DuckDBPyType print(DuckDBPyType("MAP(INT, VARCH ... ckDBPyType(dict[str, int])) MAP(VARCHAR, BIGINT) {'a': field_one, 'b': field_two, ..., 'n': field_n} dict objects map to a STRUCT composed of the keys and values of the dict. import duckdb.sqltypes print(duckdb.sqltypes.DuckDBPyType({'a': str, 'b': int ... })) STRUCT(a VARCHAR, b BIGINT) Union[type_1, ... type_n] typing.Union objects, and unions written as type_1 | type_2 , map to a UNIO ...
https://man.mtool.work/duckdb/2.0/clients/python/types.html
Star Expression 8387
Syntax The * expression can be used in a SELECT statement to select all columns that are projected in the FROM clause. SELECT * FROM tbl; TABLE.* and STRUCT.* The * expression can be prepended by a table name to select only columns from tha ... SELECT tbl.* FROM tbl JOIN other_tbl USING (id); Similarly, the * expression can also 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, or if a query m ... ust handle any potential struct keys. See the STRUCT data type and STRUCT functions pages for more details on working with structs. For example: SELECT st ... ts in a syntax error: sql SELECT greatest(UNPACK(COLUMNS(*) + 1)) AS result FROM (SELECT 1 AS a, 2 AS b, 3 AS c); result 4 STRUCT.* The * expression can also be used to retrieve all keys from a struct as separate columns. This is particularly useful wh ...
https://man.mtool.work/duckdb/2.0/sql/expressions/star.html
PREV 1 2 3 4 5 6 7 8 9 NEXT
DuckDB 2.0 Documentation / man.mtool.work