Results of 1 - 10 of about 12 for iterate (0.002 sec.)
- Vectors 14079
- 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
...duckdb_result res; duckdb_query(con, "SELECT CASE WHEN i%2=0 THEN NULL ELSE i END res_col FROM range(10) t(i)", &res); // iterate until result is exhausted while (true) { duckdb_data_chunk result = duckdb_fetch_chunk(res); if (!result) { // result is e...or_data = (int64_t *) duckdb_vector_get_data(res_col); uint64_t *vector_validity = duckdb_vector_get_validity(res_col); // iterate over the rows for (idx_t row = 0; row < row_count; row++) { if (duckdb_validity_row_is_valid(vector_validity, row)) { prin...n, "SELECT CASE WHEN i%2=0 THEN CONCAT('short_', i) ELSE CONCAT('longstringprefix', i) END FROM range(10) t(i)", &res); // iterate until result is exhausted while (true) { duckdb_data_chunk result = duckdb_fetch_chunk(res); if (!result) { // result is e... - https://man.mtool.work/duckdb/2.0/clients/c/vector.html
- Handle Results 10241
- 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
...n success while (res.nextChunk()) { // get the current chunk from the result DuckDBDataChunkReader chunk = res.chunk(); // iterate over the chunk columns, all indices are 0-based for (long col = 0; col < chunk.columnCount(); col++) { // get a vector for...the specified column DuckDBReadableVector vector = chunk.vector(col); // iterate over the vector rows for (long row = 0; row < chunk.rowCount(); row++) { int val = vector.getInt(row); System.out.println(... - https://man.mtool.work/duckdb/2.0/clients/java/result_handling.html
- UPDATE EXTENSIONS 8967
- The UPDATE EXTENSIONS statement allows synchronizing the locally installed extension state with the repository that published a given extension. This statement is the recommended way to keep up to date with new features or bug fixes being r
...ting All Extensions To update all extensions installed for the DuckDB version of your client: UPDATE EXTENSIONS; This will iterate over the extensions and return their repositories and the update result: ┌────────────────┬──────────────┬────────────────... - https://man.mtool.work/duckdb/2.0/sql/statements/update_extensions.html
- Query 8649
- The duckdb_query method allows SQL queries to be run in DuckDB from C. This method takes two parameters, a (null-terminated) SQL query string and a duckdb_result result pointer. The result pointer may be NULL if the application is not inter
...n, "INSERT INTO integers VALUES (3, 4), (5, 6), (7, NULL);", NULL); duckdb_query(con, "SELECT * FROM integers;", &res); // iterate until result is exhausted while (true) { duckdb_data_chunk result = duckdb_fetch_chunk(res); if (!result) { // result is e...32_t *col2_data = (int32_t *) duckdb_vector_get_data(col2); uint64_t *col2_validity = duckdb_vector_get_validity(col2); // iterate over the rows for (idx_t row = 0; row < row_count; row++) { if (duckdb_validity_row_is_valid(col1_validity, row)) { printf... - https://man.mtool.work/duckdb/2.0/clients/c/query.html
- Handle Results 8649
- Overview DuckDB is columnar, and beyond reading a result set row by row through database/sql , the Go client can exchange whole results with Apache Arrow as a stream of record batches, and register an Arrow stream as a queryable view. Both
...B connection with duckdb.NewArrowFromConn() , then call QueryContext() to run a query and get back an array.RecordReader . Iterate it with Next() , reading one arrow.RecordBatch at a time, and release it when done: connector, err := duckdb.NewConnector(... - https://man.mtool.work/duckdb/2.0/clients/go/result_handling.html
- Loops 8649
- Loops can be used in sqllogictests when it is required to execute the same query many times but with slight modifications in constant values. For example, suppose we want to fire off 100 queries that check for the presence of the values 0..
...{i}; ---- 1 # end the loop (note that multiple statements can be part of a loop) endloop Similarly, foreach can be used to iterate over a set of values. foreach partcode millennium century decade year quarter month day hour minute second millisecond mic... - https://man.mtool.work/duckdb/2.0/dev/sqllogictest/loops.html
- Run Queries 8330
- 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
...sults to JSON, and exporting to Parquet. Query Execution Use query() when you want the entire result at once, or send() to iterate over Apache Arrow record batches as they are produced — useful for large results that you would rather stream than hold in... - https://man.mtool.work/duckdb/2.0/clients/wasm/query.html
- FROM and JOIN Clauses 8330
- The FROM clause specifies the source of the data on which the remainder of the query should operate. Logically, the FROM clause is where the query starts execution. The FROM clause can contain a single table, a combination of multiple table
...10 UNION ALL SELECT i + 100) t2(j); i j 0 10 1 11 0 100 1 101 It may be helpful to think about LATERAL as a loop where we iterate through the rows of the first subquery and use it as input to the second ( LATERAL ) subquery. In the examples above, we i... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/from.html
- C++ API 8012
- Installation To use the DuckDB C++ API, download the libduckdb archive for your platform. The latest stable version of the DuckDB C++ API is 2.0.0. Warning DuckDB's C++ API is internal. It is not guaranteed to be stable and can change witho
...unt(); col_idx++) { cout << result->GetNames()[col_idx]; cout << (col_idx + 1 < result->ColumnCount() ? "\t" : "\n"); } // Iterate over every row and column of the materialized result for (idx_t row_idx = 0; row_idx < result->RowCount(); row_idx++) { fo... - https://man.mtool.work/duckdb/2.0/clients/cpp.html
- Migrating Python Code to DuckDB 2.0 7694
- 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
...a fetchone() or fetchmany() loop for a SQL query, create its result with con.execute(query) instead of con.sql(query) . To iterate over an existing relation, use for row in rel.iter_rows(): ... ; this keeps the complete result in engine memory. For stre... - https://man.mtool.work/duckdb/2.0/clients/python/migration.html
DuckDB 2.0 Documentation / man.mtool.work