⌘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 25 for enum (0.003 sec.)
Enum Functions 13749
This section describes functions and operators for examining and manipulating ENUM values . The examples assume an enum type created as: CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy', 'anxious'); These functions can take NULL or a specific ... value of the type as argument(s). Most enum functions return a value that depends only on the type of the argument, and not on its value. The functions enum_code() an ... d enum_range_boundary() are exceptions; they return a value that depends on the argument value, as well as its type. Name Descrip ... tion enum_code(enum_value) Returns the (0-based) numeric value backing the given enum value. enum_first(enum) Returns the first valu ...
https://man.mtool.work/duckdb/2.0/sql/functions/enum.html
Enum Data Type 13118
Name Description ENUM Dictionary representing all possible string values of a column The enum type represents a dictionary data structure with all possible unique values of a column. For example, a column storing the days of the week can be ... an enum holding all possible days. Enums are particularly interesting for string columns with low cardinality (i.e., fewer distinc ... t values). This is because the column only stores a numerical reference to the string in the enum dictionary, resulting in immense savings in disk storage and faster query performance. Creating Enums You can create an en ... um using hardcoded values: CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy'); -- This statement will fail since enums cannot hold NULL values: -- CREATE TYPE mood AS ENUM ('sad ...
https://man.mtool.work/duckdb/2.0/sql/data_types/enum.html
Types 10079
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 ... 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 potentially be nested. Types in the C API are modeled using an enum ( duckdb_type ) and a complex c ... lass ( duckdb_logical_type ). 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 DUC ... TYPE_DECIMAL = 19, DUCKDB_TYPE_TIMESTAMP_S = 20, 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, ...
https://man.mtool.work/duckdb/2.0/clients/c/types.html
Pivot Internals 8867
PIVOT Pivoting is implemented as a combination of SQL query re-writing and a dedicated PhysicalPivot operator for higher performance. Each PIVOT is implemented as set of aggregations into lists and then the dedicated PhysicalPivot operator ... y detect the columns that should be created as a result of a PIVOT statement, it must be translated into multiple queries. ENUM types are used to find the distinct values that should become columns. Each ENUM is then injected into one of the PIVOT st ... atement's IN clauses. After the IN clauses have been populated with ENUM s, the query is re-written again into a set of aggregations into lists. For example: PIVOT cities ON year USING sum(popula ... tion); is initially translated into: CREATE TEMPORARY TYPE __pivot_enum_0_0 AS ENUM ( SELECT DISTINCT year::VARCHAR FROM cities ORDER BY year ); PIVOT cities ON year IN __pivot_enum_0_0 USING su ...
https://man.mtool.work/duckdb/2.0/internals/pivot.html
Complete API 8767
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 ... duckdb_value value ); duckdb_value duckdb_get_list_child ( duckdb_value value , idx_t index ); duckdb_value duckdb_create_enum_value ( duckdb_logical_type type , uint64_t value ); uint64_t duckdb_get_enum_value ( duckdb_value value ); duckdb_value d ... duckdb_logical_type * member_types , const char ** member_names , idx_t member_count ); duckdb_logical_type duckdb_create_enum_type ( const char ** member_names , idx_t member_count ); duckdb_logical_type duckdb_create_decimal_type ( uint8_t width , ... le ( duckdb_logical_type type ); duckdb_type duckdb_decimal_internal_type ( duckdb_logical_type type ); duckdb_type duckdb_enum_internal_type ( duckdb_logical_type type ); uint32_t duckdb_enum_dictionary_size ( duckdb_logical_type type ); char * duck ...
https://man.mtool.work/duckdb/2.0/clients/c/api.html
Types API 8568
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 ... NumPy dtype object does not convert: DuckDBPyType(numpy.dtype("int32")) raises a NotImplementedException . Type DuckDB type numpy.bool_ BOOLEAN numpy.float32 FLOAT numpy.float64 DOUBLE numpy.int16 SMALLINT numpy.int32 INTEGER numpy.int64 BIGINT nump ... out a connection, the name is looked up on the default connection. con = duckdb.connect() con.execute("CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy')") print(con.type("mood")) ENUM('sad', 'ok', 'happy') Nested Types list[child_type] list type object ... meters: members: Union[list[DuckDBPyType], dict[str, DuckDBPyType]] string_type Parameters: collation: str , by default "" enum_type enum_type is not implemented and raises a NotImplementedException . Create an ENUM type with SQL and get it with con. ...
https://man.mtool.work/duckdb/2.0/clients/python/types.html
CREATE TYPE Statement 8568
The CREATE TYPE statement defines a new type in the catalog. Examples Create a simple ENUM type: CREATE TYPE mood AS ENUM ('happy', 'sad', 'curious'); Create a simple STRUCT type: CREATE TYPE many_things AS STRUCT(k INTEGER, l VARCHAR); Cre ... ng VARCHAR); Create a type alias: CREATE TYPE x_index AS INTEGER; Replace an existing type: CREATE OR REPLACE TYPE mood AS ENUM ('cheerful', 'gloomy'); Syntax The CREATE TYPE clause defines a new data type available to this DuckDB instance. Use the O ...
https://man.mtool.work/duckdb/2.0/sql/statements/create_type.html
Values 8435
The value class represents a single value of any type. API Reference Overview void duckdb_destroy_value ( duckdb_value * value ); duckdb_value duckdb_create_varchar ( const char * text ); duckdb_value duckdb_create_varchar_length ( const ch ... duckdb_value value ); duckdb_value duckdb_get_list_child ( duckdb_value value , idx_t index ); duckdb_value duckdb_create_enum_value ( duckdb_logical_type type , uint64_t value ); uint64_t duckdb_get_enum_value ( duckdb_value value ); duckdb_value d ... ue * values , idx_t value_count ); Parameters type : The type of the list values : The values for the list value_count : The number of values in the list Return Value The list value, or nullptr, if the child type is DUCKDB_TYPE_ANY or DUCKDB_TYPE_INV ... * values , idx_t value_count ); Parameters type : The type of the array values : The values for the array value_count : The number of values in the array Return Value The array value, or nullptr, if the child type is DUCKDB_TYPE_ANY or DUCKDB_TYPE_I ...
https://man.mtool.work/duckdb/2.0/clients/c/value.html
Union Functions 7953
Name Description union.tag Dot notation serves as an alias for union_extract . union_extract(union, 'tag') Extract the value with the named tags from the union. NULL if the tag is not currently selected. union_value(tag := any) Create a sin ... tag of the value will be the bound variable name. union_tag(union) Retrieve the currently selected tag of the union as an Enum . union.tag | Description | Dot notation serves as an alias for union_extract . | | Example | (union_value(k := 'hello')). ... ello (of type UNION(k VARCHAR) ) | union_tag(union) | Description | Retrieve the currently selected tag of the union as an Enum . | | Example | union_tag(union_value(k := 'foo')) | | Result | 'k' | ...
https://man.mtool.work/duckdb/2.0/sql/functions/union.html
Vectors 7887
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 ... alue of 10500 . In order to obtain the correct decimal value, the value should be divided by the appropriate power-of-ten. Enums Enums are stored as unsigned integer values internally. The exact native type depends on the size of the enum dictionary, ... hown in the following table: Dictionary size NativeType <= 255 uint8_t <= 65535 uint16_t <= 4294967295 uint32_t The duckdb_enum_internal_type can be used to obtain the internal type of the enum. In order to obtain the actual string value of the enum, ... the duckdb_enum_dictionary_value function must be used to obtain the enum value that corresponds to the given dictionary entry. Note that ...
https://man.mtool.work/duckdb/2.0/clients/c/vector.html
PREV 1 2 3 NEXT
DuckDB 2.0 Documentation / man.mtool.work