⌘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 31 for define (0.002 sec.)
Multiple Python Threads 11938
This page demonstrates how to simultaneously insert into and read from a DuckDB database across multiple Python threads. This could be useful in scenarios where new data is flowing in and an analysis should be periodically re-run. Note that ... my_inserts ( thread_name VARCHAR, insert_time TIMESTAMP DEFAULT current_timestamp ) """) Reader and Writer Functions Next, define functions to be executed by the writer and reader threads. Each thread must use the .cursor() method to create a thread-lo ... er, current_localtimestamp() AS read_time FROM my_inserts """, (thread_name,)).fetchall() print(results) Create Threads We define how many writers and readers to use, and define a list to track all of the threads that will be created. Then, create firs ... off in a random order to simulate simultaneous writers and readers. Note that the threads have not yet been executed, only defined. write_thread_count = 50 read_thread_count = 5 threads = [] # Create multiple writer and reader threads (in the same proc ...
https://man.mtool.work/duckdb/2.0/guides/python/multiple_threads.html
Constraints 11680
In SQL, constraints can be specified for tables. Constraints enforce certain properties over data that is inserted into a table. Constraints can be specified along with the schema of the table as part of the CREATE TABLE statement . In cert ... raint Error: NOT NULL constraint failed: students.name Primary Key and Unique Constraint Primary key or unique constraints define a column, or set of columns, that are a unique identifier for a row in the table. The constraint enforces that the specifi ... nforce this property efficiently, an ART index is automatically created for every primary key or unique constraint that is defined in the table. Primary key constraints and unique constraints are identical except for two points: A table can only have o ... ne primary key constraint defined, but many unique constraints A primary key constraint also enforces the keys to not be NULL . CREATE TABLE students (id I ...
https://man.mtool.work/duckdb/2.0/sql/constraints.html
Schema 11130
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 ... n the first experiment, we use the correct (most restrictive) types, i.e., both the id and the ParentCommentId columns are defined as BIGINT . In the second experiment, we define all columns with the VARCHAR type. While the results of the queries are t ... kDB does not rely on these indexes for join and aggregation operators (see indexing for more details). Bestpractice Do not define constraints unless your goal is to ensure data integrity. Microbenchmark: The Effect of Primary Keys We illustrate the eff ... d aggregation operators. Bestpractice For best bulk load performance, avoid primary key constraints. If they are required, define them after the bulk loading step. ...
https://man.mtool.work/duckdb/2.0/guides/performance/schema.html
Java (JDBC) Client 10321
Installation To use the DuckDB Java (JDBC) client, visit the Java installation page . The latest stable version of the DuckDB Java (JDBC) client is 2.0.0. The DuckDB Java (JDBC) client lets Java applications query DuckDB through the standar ... d JDBC API, extended with DuckDB-specific features for bulk loading, Apache Arrow interchange, user-defined functions, and profiling, and can open a DuckLake catalog directly from the JDBC URL. The driver also supports ahead-of-t ... eStatement(); ResultSet rs = stmt.executeQuery("SELECT 42")) { rs.next(); System.out.println(rs.getInt(1)); // prints 42 } Define Connections covers the connection lifecycle in full: the URL forms the driver accepts, DuckDB and driver configuration opt ... ions, read-only mode, instance caching, threading, and shutdown. Further Reading Define Connections — the JDBC URL forms, configuration options, instance caching, threading, and connection shutdown. Connect to ...
https://man.mtool.work/duckdb/2.0/clients/java/overview.html
CREATE MACRO Statement 10321
The CREATE MACRO statement defines a named, callable SQL expression as a database schema object. Macros may declare parameters, which can be referenced by its expression. Once a macro is created, it may be called by referencing its name and ... is mandatory and can be any valid SQL identifier. Parameter names must be unique within the parameter list. An attempt to define multiple parameters with the same name results in a Duplicate parameter error. Optionally, a parameter may explicitly spec ... definition of a parameter that does not have a default value. In other words, parameters without default values have to be defined "in the front"; any parameters with default values appear "at the back". Multiple parameter declarations are separated fr ... om one another with a comma. Overloading Macros support overloading: A single CREATE MACRO statement can define multiple implementations (sometimes called 'overloads'), each having its own parameter list, AS keyword, and expression. N ...
https://man.mtool.work/duckdb/2.0/sql/statements/create_macro.html
Indexing 9512
DuckDB has two types of indexes: zonemaps and ART indexes. Zonemaps DuckDB automatically creates zonemaps (also known as min-max indexes) for the columns of all general-purpose data types . Operations like predicate pushdown into scan opera ... e primary keys, foreign keys, or unique constraints, if these are necessary for enforcing constraints on your data. Do not define explicit indexes unless you have highly selective queries and enough memory available. If you define an ART index, do so a ...
https://man.mtool.work/duckdb/2.0/guides/performance/indexing.html
Geometry Data Type 9512
Name Description GEOMETRY Geospatial entity The GEOMETRY data type is used to store and manipulate geometric objects, such as points, lines, and polygons. The GEOMETRY type was part of the spatial extension but became a built-in data type i ... intersections) are still part of spatial . Types of Geometries Conceptually, the GEOMETRY type follows the core data model defined in the Simple Features standard, which is widely used in geospatial databases and GIS software. A GEOMETRY value can ther ... efore represent 7 types of shapes: Geometry Type Description Point A single location in space, defined by its coordinates (e.g., longitude and latitude). LineString A sequence of points connected by straight lines, represent ... ing a path or route. Polygon A set of closed rings defined by a sequence of points, representing an area such as a country border or a building footprint. The first ring is the "sh ...
https://man.mtool.work/duckdb/2.0/sql/data_types/geometry.html
Handle Results 9237
Overview Beyond the standard JDBC ResultSet , the DuckDB driver can hand results to Apache Arrow , stream large results instead of materializing them, and expose raw columnar data chunks. This page covers each of these result-handling optio ... d by the JDBC ResultSet interface. Chunk contents are read through the same DuckDBDataChunkReader API that is used by user-defined functions . Call query() on a DuckDBPreparedStatement to obtain a DuckDBChunkedResult , then advance through the chunks w ... s remain 1-based, following the JDBC convention, while chunk columns and rows are 0-based, matching the C API and the user-defined function interfaces. The chunked result API currently supports basic data types only. Composite types such as LIST and ST ... ad. Further Reading Run Queries — sending the queries whose results this page reads, and the standard ResultSet accessors. Define Functions — the DuckDBDataChunkReader API shared with chunked results is also used to write user-defined functions. Define ...
https://man.mtool.work/duckdb/2.0/clients/java/result_handling.html
Release Cycle 9237
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>.< ... main DuckDB release cycle consists of 3 main phases: Mid-cycle , Pre-release and Feature freeze . These phases are clearly defined and communicated to ensure the whole team is synchronized and working together towards the next release. Phase 1: Mid-Cyc ... over to stable APIs, we expect unstable API extensions to be around for quite some time so there remains a need to clearly define their lifecycle. Therefore we will use the remainder of this section to describe it. Categorizing by Branching To start, w ... s follow the same branching scheme as DuckDB where a combination of main and vx.y-codename play the main role. We will now define the three types of unstable extensions by looking at their number of active branches . Single branch extensions have only ...
https://man.mtool.work/duckdb/2.0/dev/release_cycle.html
WITH Clause 8428
The WITH clause allows you to specify common table expressions (CTEs). Regular (non-recursive) common-table-expressions are essentially views that are limited in scope to a particular query. CTEs can reference each other and can be nested. ... de The following query returns all paths starting in node 1: WITH RECURSIVE paths(startNode, endNode, path) AS ( SELECT -- Define the path as the first edge of the traversal node1id AS startNode, node2id AS endNode, [node1id, node2id] AS path FROM edge ... that checks if any of the previous paths includes the node: WITH RECURSIVE paths(startNode, endNode, path) AS ( SELECT -- Define the path as the first edge of the traversal node1id AS startNode, node2id AS endNode, [node1id, node2id] AS path FROM edge ... s between nodes 1 (start node) and 8 (end node): WITH RECURSIVE paths(startNode, endNode, path, endReached) AS ( SELECT -- Define the path as the first edge of the traversal node1id AS startNode, node2id AS endNode, [node1id, node2id] AS path, (node2id ...
https://man.mtool.work/duckdb/2.0/sql/query_syntax/with.html
PREV 1 2 3 4 NEXT
DuckDB 2.0 Documentation / man.mtool.work