Results of 1 - 9 of about 9 for calculate (0.006 sec.)
- Calculating a Database Checksum 13463
- To calculate a database checksum, use a commutative operation such as bit_xor on all columns, all rows, and all tables. First, create a table macro that performs this for each table: CREATE OR REPLACE MACRO table_checksum(table_name) AS TAB
...OM table_checksum(''%s'');', table_name) FROM duckdb_tables() WHERE NOT internal; .mode duckbox Read the SQL file back and calculate the checksum for the database: .read checksum_all_tables.sql SELECT bit_xor(checksum) AS database_checksum FROM table_chec... - https://man.mtool.work/duckdb/2.0/guides/snippets/database_checksum.html
- Relational API 10461
- 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
...elation Computes the average of a given expression. Aliases : mean Parameters expression : str The column or expression to calculate the average of. * groups : str, default: '' Comma-separated list of columns to include in the GROUP BY ; cannot be combine...ession using a more accurate floating point summation (Kahan Sum). Parameters expression : str The column or expression to calculate the average of. * groups : str, default: '' Comma-separated list of columns to include in the GROUP BY ; cannot be combine...ession using a more accurate floating point summation (Kahan Sum). Parameters expression : str The column or expression to calculate the sum of. * groups : str, default: '' Comma-separated list of columns to include in the GROUP BY ; cannot be combined wi... - https://man.mtool.work/duckdb/2.0/clients/python/relational_api.html
- Export to Apache Arrow 8699
- All results of a query can be exported to an Apache Arrow Table using the to_arrow_table function. Alternatively, results can be returned as a RecordBatchReader using the to_arrow_reader function and results can be read one batch at a time.
...m the table and export the entire relation as Arrow rel = con.table("integers") relation_as_arrow = rel.to_arrow_table() # Calculate a result using that relation and export that result to Arrow res = rel.aggregate("sum(i)") arrow_table = res.to_arrow_tabl... - https://man.mtool.work/duckdb/2.0/guides/python/export_arrow.html
- Pivot Internals 8699
- 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
...the column names and a list of the column values. If dynamically unpivoting, the COLUMNS expression is evaluated first to calculate the column list. For example: UNPIVOT monthly_sales ON jan, feb, mar, apr, may, jun INTO NAME month VALUE sales; is transl... - https://man.mtool.work/duckdb/2.0/internals/pivot.html
- Integration with Ibis 8448
- Ibis is a Python dataframe library that supports 20+ backends, with DuckDB as the default. Ibis with DuckDB provides a Pythonic interface for SQL with great performance. Warning Ibis 12.0.0 and earlier do not support DuckDB 2.0. The example
...878 │ └───────────┴───────────┴──────────────────────┘ By adding that mean to the aggregate , we now have a concise way to calculate aggregates over each of the distinct groups in the group_by . And we can calculate as many aggregates as we need. penguins... - https://man.mtool.work/duckdb/2.0/guides/python/ibis.html
- PHP Client 8196
- The DuckDB PHP client is a tertiary client and is maintained by a third-party. Client API for PHP, focused on performance. The DuckDB PHP client uses the official C API internally through FFI , achieving good benchmark results. This library
...uckDB provides some amazing features. For example, you can query remote files directly. Let's use an aggregate function to calculate the average of a column for a Parquet remote file: DuckDB::sql( 'SELECT "Reporting Year", avg("Gas Produced, MCF") as "AVG... - https://man.mtool.work/duckdb/2.0/clients/tertiary_clients/php.html
- PIVOT Statement 7944
- The PIVOT statement allows distinct values within a column to be separated into their own columns. The values within those new columns are calculated using an aggregate function on the subset of rows that match each distinct value. DuckDB i
...US New York City 2020 8772 PIVOT ON and USING Use the PIVOT statement below to create a separate column for each year and calculate the total population in each. The ON clause specifies which column(s) to split into separate columns. It is equivalent to...multiple expressions are included in the USING clause. In this example, both the sum and max of the population column are calculated for each year and are split into separate columns. PIVOT cities ON year USING sum(population) AS total, max(population) A... - https://man.mtool.work/duckdb/2.0/sql/statements/pivot.html
- Window Functions 7441
- DuckDB supports window functions , which can use multiple rows to calculate a value for each row. Window functions are blocking operators , i.e., they require their entire input to be buffered, making them one of the most memory-intensive o
... - https://man.mtool.work/duckdb/2.0/sql/functions/window_functions.html
- WITH Clause 7441
- 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.
...quence WITH RECURSIVE can be used to make recursive calculations. For example, here is how WITH RECURSIVE could be used to calculate the first ten Fibonacci numbers: WITH RECURSIVE FibonacciNumbers ( RecursionDepth, FibonacciNumber, NextNumber ) AS ( -- B... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/with.html
PREV
1
NEXT
DuckDB 2.0 Documentation / man.mtool.work