Results of 1 - 9 of about 9 for materialize (0.004 sec.)
- Run Queries 13409
- Overview DuckDB-Wasm provides functions for querying data. Queries are run sequentially: First, create a connection by calling connect . Then, run queries by calling query to materialize the whole result, or send to fetch result chunks lazi
...would rather stream than hold in memory all at once: // Create a new connection const conn = await db.connect(); // Either materialize the query result await conn.query<{ v: arrow.Int }>(` SELECT * FROM generate_series(1, 100) t(v) `); // ..., or fetch the...once and run it repeatedly with different parameter values, binding each value in place of a ? placeholder. Both query() (materialized) and send() (streamed) are available on a prepared statement: // Create a new connection const conn = await db.connect();...re the query const stmt = await conn.prepare(`SELECT v + ? FROM generate_series(0, 10_000) t(v);`); // ... and run it with materialized results await stmt.query(234); // ... or as result chunks for await (const batch of await stmt.send(234)) { // ... } // C... - https://man.mtool.work/duckdb/2.0/clients/wasm/query.html
- Handle Results 9670
- Overview Beyond reading a result set row by row , the Rust client can hand a query result to Apache Arrow as a stream of record batches, register an Arrow batch as a queryable table, and return results as Polars data frames. Each of these c
...w . Reading a Result as Arrow Call query_arrow() on a prepared statement to get an iterator of RecordBatch . Collecting it materializes the whole result, while iterating it reads one batch at a time: use duckdb::{Connection, Result}; use duckdb::arrow::reco...in stmt.stream_arrow([])? { // process one RecordBatch at a time println!("{} rows", batch.num_rows()); } DuckDB may still materialize the result internally for some statements. The streaming iterator panics if fetching or Arrow conversion fails after execu... - https://man.mtool.work/duckdb/2.0/clients/rust/result_handling.html
- Lance Extension 9257
- The lance extension adds support for reading and writing Lance tables. Lance is a modern lakehouse format optimized for ML/AI workloads, with native cloud storage support. Installing and Loading You can install the lance extension from Duck
.../' ); SELECT * FROM 's3://⟨bucket/path/to/out.lance⟩' LIMIT 10; Write a Lance Dataset Use the COPY ... TO ... statement to materialize query results as a Lance dataset. -- Create/overwrite a Lance dataset from a query COPY ( SELECT 1::BIGINT AS id, 'a'::VAR... - https://man.mtool.work/duckdb/2.0/core_extensions/lance.html
- Connect 8843
- Overview Every DuckDB feature reachable from Java starts with a Connection . This page covers the JDBC URL forms the driver accepts, how DuckDB and driver options are passed and which of them win, how connections come to share (or not share
..., for ducklake: URLs, so that BI tools such as Metabase do not repeatedly close and re-create the instance or accidentally materialize large DuckLake datasets. jdbc_instance_cache Reuse the process-wide database instance for the same database. Enabled by de...tabase, which open and close connections frequently, do not restart the database instance on every request or accidentally materialize a large table: jdbc_pin_db is enabled, keeping the instance alive after the last connection closes. Release it with DuckDB... - https://man.mtool.work/duckdb/2.0/clients/java/connecting.html
- Migrating Python Code to DuckDB 2.0 8843
- This page lists what Python code written for DuckDB 1.x must change to run on DuckDB 2.0. Each item gives the 1.x form, the 2.0 form and the page that explains it. For changes outside the Python client, see Migrating to DuckDB v2.0 . Python
...eps the complete result in engine memory. For streamed batches, use rel.to_arrow_reader() . Replace rel.execute() with rel.materialize() when you want to compute and retain the rows. Plain strings in expressions. 1.x: in ColumnExpression("s") == "x" and in... - https://man.mtool.work/duckdb/2.0/clients/python/migration.html
- Samples 8843
- Samples are used to randomly select a subset of a dataset. Examples Select a sample of exactly 5 rows from tbl using reservoir sampling: SELECT * FROM tbl USING SAMPLE 5; Select a sample of approximately 10% of the table using system sampli
...ended for small sample sizes, and is not recommended for use with percentages. That is because reservoir sampling needs to materialize the entire sample and randomly replace tuples within the materialized sample. The larger the sample size, the higher the p...ce Avoid using reservoir sampling with large sample sizes if possible. Reservoir sampling requires the entire sample to be materialized in memory. bernoulli Bernoulli sampling can only be used when a sampling percentage is specified. It is rather straightfo... - https://man.mtool.work/duckdb/2.0/sql/samples.html
- Relational API 7585
- The Relational API builds a query one step at a time from Python. A relation, a DuckDBPyRelation , is a piece of SQL text: the methods of the Transformation and Functions sections return a new relation whose text extends the one they were c
...offset is reached as rel["offset"] , since rel.offset is the offset() method. To run a query once and keep its rows, call materialize() : import duckdb duckdb_conn = duckdb.connect() duckdb_conn.sql("CREATE TABLE items (id INTEGER)") counted = duckdb_conn....sql("SELECT count(*) AS n FROM items") held = counted.materialize() duckdb_conn.sql("INSERT INTO items VALUES (1), (2)") print(counted.fetchall(), held.fetchall()) [(2,)] [(0,)] Relation C... - https://man.mtool.work/duckdb/2.0/clients/python/relational_api.html
- WITH Clause 7585
- 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.
...ou can specify column names for CTEs: WITH cte(j) AS (SELECT 42 AS i) FROM cte; CTE Materialization DuckDB handles CTEs as materialized by default, meaning that the CTE is evaluated once and the result is stored in a temporary table. However, under certain...conditions, DuckDB can inline the CTE into the main query, which means that the CTE is not materialized and its definition is duplicated in each place it is referenced. Inlining is done using the following heuristics: * The C...TE is not referenced more than once. * The CTE does not contain a VOLATILE function. * The CTE is using AS NOT MATERIALIZED and does not use AS MATERIALIZED . * The CTE does not perform a grouped aggregation. Materialization can be explicitly ac... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/with.html
- Python Client API 6758
- Connection class duckdb. Appender Bases: object append_row ( self , * args ) → None Buffer one row, one value per column, each converted as an executemany parameter would be append_rows ( self , rows : object ) → None Buffer each row of an
...ne ) → DuckDBPyRelation Calls the passed function on the relation. Detailed examples can be found at Relational API page . materialize ( ) → DuckDBPyRelation Execute once and return a relation over the rows, held in client memory. Detailed examples can be f... - https://man.mtool.work/duckdb/2.0/clients/python/reference/
PREV
1
NEXT
DuckDB 2.0 Documentation / man.mtool.work