Results of 1 - 10 of about 18 for switch (0.001 sec.)
- CASE Expression 14738
- The CASE expression performs a switch based on a condition. The basic form is identical to the ternary condition used in many programming languages ( CASE WHEN cond THEN a ELSE b END is equivalent to cond ? a : b ). With a single condition
...l expression after the CASE but before the WHEN . When this is done, the CASE expression is effectively transformed into a switch statement. CREATE OR REPLACE TABLE integers AS SELECT unnest([1, 2, 3]) AS i; SELECT i, CASE i WHEN 1 THEN 10 WHEN 2 THEN...This is equivalent to: SELECT i, CASE WHEN i = 1 THEN 10 WHEN i = 2 THEN 20 WHEN i = 3 THEN 30 END AS test FROM integers; SWITCH Expression The SWITCH expression is syntactic sugar for the CASE expression. It takes an expression, a MAP of values to re...sults, and an optional default value. CREATE OR REPLACE TABLE integers AS SELECT unnest([1, 2, 3]) AS i; SELECT i, SWITCH(i, MAP {1: 'one', 2: 'two', 3: 'three'}) AS test FROM integers; i test 1 one 2 two 3 three A default value can be provided... - https://man.mtool.work/duckdb/2.0/sql/expressions/case.html
- Map Functions 10981
- 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
...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. switch(key, map) Returns the value for a given key in the map , or NULL if the key is not present. An optional third argument, sw...n error is thrown. | | Example | map([100, 5], ['a', 'b'])[100] | | Result | a | | Aliases | map_extract_value(map, key) | switch(key, map) | Description | Returns the value for a given key in the map , or NULL if the key is not present. This is equiva...lent to map_extract_value(map, key) . An optional third argument, switch(key, map, default) , returns default instead of NULL when the key is not present. | | Example | switch('key1', MAP {'key1'... - https://man.mtool.work/duckdb/2.0/sql/functions/map.html
- Legacy Parser Extension 8819
- New The legacy_parser extension was introduced in DuckDB 2.0. DuckDB 2.0.0 replaced the PostgreSQL-derived parser with a new PEG-based parser . The legacy_parser extension allows reverting to the old parser. The PEG parser is designed to be
...ension, run: INSTALL AND LOAD legacy_parser; Usage To activate the legacy parser, run: SET enable_legacy_parser = true; To switch back to the PEG parser, run: SET enable_legacy_parser = false;... - https://man.mtool.work/duckdb/2.0/core_extensions/legacy_parser.html
- Logical Operators 8819
- The following logical operators are available: AND , OR and NOT . SQL uses a three-valued logic system with true , false and NULL . Note that logical operators involving NULL do not always evaluate to NULL . For example, NULL AND false will
...ULL Unary Operator: NOT a NOT a true false false true NULL NULL The operators AND and OR are commutative, that is, you can switch the left and right operand without affecting the result.... - https://man.mtool.work/duckdb/2.0/sql/expressions/logical_operators.html
- Release Cycle 8682
- This document outlines the DuckDB and core extension release cycle framework. It is intended for developers working on DuckDB extensions to better understand the underlying processes. Overview DuckDB follows Semantic Versioning ( v<MAJOR>.<
...anch Latest version: Extension main branch Extension type: Three branch Latest version: Extension vx.<y+1>-codename branch Switching between Single Branch, Two Branch and Three Branch Switching between the different branch types for extensions is a fai...rly straightforward process and should be done as follows: Switch: Single branch -> Two branch When: during any phase Reasons: When desire arises to merge features not eligible for vx.y.<z...s: Create branch vx.y-codename from a commit on main between HEAD of main and the commit in the DuckDB vx.y.z config file. Switch: Two branch -> Three branch When: during Pre-release or Feature-freeze phase Reasons: Whenever a feature needs to be merge... - https://man.mtool.work/duckdb/2.0/dev/release_cycle.html
- Installing Extensions 8561
- To install core DuckDB extensions, use the INSTALL command. For example: INSTALL httpfs; This installs the extension from the default repository ( core ). Extension Repositories By default, DuckDB extensions are installed from a single repo
...te this installation with the spatial extension from the core_nightly repository: FORCE INSTALL spatial FROM core_nightly; Switching between Repositories To switch repositories for an extension, use the FORCE INSTALL command. For example, if you have i...nstalled httpfs from the core_nightly repository but would like to switch back to using core , run: FORCE INSTALL httpfs FROM core; Installing Extensions through Client APIs For many clients, usin... - https://man.mtool.work/duckdb/2.0/extensions/installing_extensions.html
- SQLite Import 8561
- To run a query directly on a SQLite file, the sqlite extension is required. Installation and Loading The extension can be installed using the INSTALL SQL command. This only needs to be run once. INSTALL sqlite; To load the sqlite extension
...test (TYPE sqlite); -- The table "tbl_name" can now be queried as if it is a regular table SELECT * FROM test.tbl_name; -- Switch the active database to "test" USE test; -- List all tables in the file SHOW TABLES; For more information see the SQLite ex... - https://man.mtool.work/duckdb/2.0/guides/database_integration/sqlite.html
- PostgreSQL Import 8424
- To run a query directly on a running PostgreSQL database, the postgres extension is required. Installation and Loading The extension can be installed using the INSTALL SQL command. This only needs to be run once. INSTALL postgres; To load t
...st (TYPE postgres); -- The table "tbl_name" can now be queried as if it is a regular table SELECT * FROM test.tbl_name; -- Switch the active database to "test" USE test; -- List all tables in the file SHOW TABLES; For more information see the PostgreSQ... - https://man.mtool.work/duckdb/2.0/guides/database_integration/postgres.html
- Logging 8287
- DuckDB implements a logging mechanism that provides users with detailed information about events such as query execution, performance metrics and system events. Warning Logs may contain sensitive information, including secrets and credentia
...le_logging() without a level also captures warnings. Setting level = 'warning' excludes lower-severity INFO messages. Note Switching the CLI to a log storage other than shell_log_storage means that warnings are no longer printed to the console. To rest...r. It also does not accept configuration options such as storage_config or storage_buffer_size . To query logs in the CLI, switch to a queryable storage such as memory or file : CALL enable_logging(storage = 'memory'); Note that the duckdb_logs view is...automatically updated to target the currently active log storage. This means that switching the log storage may influence what is returned by the duckdb_logs function. Logging to stdout CALL enable_logging(stora... - https://man.mtool.work/duckdb/2.0/operations_manual/logging/overview.html
- Hive Partitioning 8012
- 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
...'DATE', 'orders': 'BIGINT'} ); hive_types will be auto-detected for the following types: DATE , TIMESTAMP and BIGINT . To switch off the auto-detection, the flag hive_types_autocast = 0 can be set. Writing Partitioned Files See the Partitioned Writes... - https://man.mtool.work/duckdb/2.0/data/partitioning/hive_partitioning.html
DuckDB 2.0 Documentation / man.mtool.work