-

DuckDB is an embeddable SQL OLAP Database Management System

-
+
-duckdb.threadsafety bool +duckdb.threadsafety bool

Indicates that this package is threadsafe

@@ -20,7 +19,7 @@ title: Python Client API
-duckdb.apilevel int +duckdb.apilevel int

Indicates which Python DBAPI version this package implements

@@ -29,7 +28,7 @@ title: Python Client API
-duckdb.paramstyle str +duckdb.paramstyle str

Indicates which parameter style duckdb supports

@@ -38,94 +37,191 @@ title: Python Client API
-duckdb.default_connection duckdb.DuckDBPyConnection +duckdb.default_connection duckdb.DuckDBPyConnection

The connection that is used by default if you don’t explicitly pass one to the root methods in this module

+
+
+class duckdb.BinaryValue(object: Any) +
+
+

Bases: Value

+
+
+
-exception duckdb.BinderException +exception duckdb.BinderException +
+
+

Bases: ProgrammingError

+
+
+ +
+
+class duckdb.BitValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.BlobValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.BooleanValue(object: Any)
-

Bases: ProgrammingError

+

Bases: Value

+
+
+duckdb.CaseExpression(condition: duckdb.duckdb.Expression, value: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+
+
-exception duckdb.CastException +exception duckdb.CastException
-

Bases: DataError

+

Bases: DataError

-exception duckdb.CatalogException +exception duckdb.CatalogException +
+
+

Bases: ProgrammingError

+
+
+ +
+
+duckdb.ColumnExpression(name: str) duckdb.duckdb.Expression
-

Bases: ProgrammingError

+

Create a column reference from the provided column name

-exception duckdb.ConnectionException +exception duckdb.ConnectionException +
+
+

Bases: OperationalError

+
+
+ +
+
+duckdb.ConstantExpression(value: object) duckdb.duckdb.Expression
-

Bases: OperationalError

+

Create a constant expression from the provided value

-exception duckdb.ConstraintException +exception duckdb.ConstraintException
-

Bases: IntegrityError

+

Bases: IntegrityError

-exception duckdb.ConversionException +exception duckdb.ConversionException
-

Bases: DataError

+

Bases: DataError

-exception duckdb.DataError +exception duckdb.DataError +
+
+

Bases: Error

+
+
+ +
+
+class duckdb.DateValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.DecimalValue(object: Any, width: int, scale: int) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.DoubleValue(object: Any)
-

Bases: Error

+

Bases: Value

-class duckdb.DuckDBPyConnection +class duckdb.DuckDBPyConnection

Bases: pybind11_object

-append(self: duckdb.DuckDBPyConnection, table_name: str, df: pandas.DataFrame) duckdb.DuckDBPyConnection +append(self: duckdb.duckdb.DuckDBPyConnection, table_name: str, df: pandas.DataFrame, *, by_name: bool = False) duckdb.duckdb.DuckDBPyConnection +
+
+

Append the passed DataFrame to the named table

+
+
+ +
+
+array_type(self: duckdb.duckdb.DuckDBPyConnection, type: duckdb.duckdb.typing.DuckDBPyType) duckdb.duckdb.typing.DuckDBPyType
-

Append the passed Data.Frame to the named table

+

Create an array type object of ‘type’

-arrow(self: duckdb.DuckDBPyConnection, chunk_size: int = 1000000) pyarrow.lib.Table +arrow(self: duckdb.duckdb.DuckDBPyConnection, rows_per_batch: int = 1000000) pyarrow.lib.Table

Fetch a result as Arrow table following execute()

@@ -134,7 +230,7 @@ title: Python Client API
-begin(self: duckdb.DuckDBPyConnection) duckdb.DuckDBPyConnection +begin(self: duckdb.duckdb.DuckDBPyConnection) duckdb.duckdb.DuckDBPyConnection

Start a new transaction

@@ -143,7 +239,7 @@ title: Python Client API
-close(self: duckdb.DuckDBPyConnection) None +close(self: duckdb.duckdb.DuckDBPyConnection) None

Close the connection

@@ -152,25 +248,43 @@ title: Python Client API
-commit(self: duckdb.DuckDBPyConnection) duckdb.DuckDBPyConnection +commit(self: duckdb.duckdb.DuckDBPyConnection) duckdb.duckdb.DuckDBPyConnection

Commit changes performed within a transaction

+
+
+create_function(self: duckdb.duckdb.DuckDBPyConnection, name: str, function: function, return_type: object = None, parameters: duckdb.duckdb.typing.DuckDBPyType = None, *, type: duckdb.duckdb.functional.PythonUDFType = <PythonUDFType.NATIVE: 0>, null_handling: duckdb.duckdb.functional.FunctionNullHandling = 0, exception_handling: duckdb.duckdb.PythonExceptionHandling = 0, side_effects: bool = False) duckdb.duckdb.DuckDBPyConnection +
+
+

Create a DuckDB function out of the passing in python function so it can be used in queries

+
+
+
-cursor(self: duckdb.DuckDBPyConnection) duckdb.DuckDBPyConnection +cursor(self: duckdb.duckdb.DuckDBPyConnection) duckdb.duckdb.DuckDBPyConnection

Create a duplicate of the current connection

+
+
+decimal_type(self: duckdb.duckdb.DuckDBPyConnection, width: int, scale: int) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create a decimal type with ‘width’ and ‘scale’

+
+
+
-property description +property description

Get result set attributes, mainly column names

@@ -179,33 +293,43 @@ title: Python Client API
-df(*args, **kwargs) +df(self: duckdb.duckdb.DuckDBPyConnection, *, date_as_object: bool = False) pandas.DataFrame
-

Overloaded function.

-
    -
  1. df(self: duckdb.DuckDBPyConnection) -> pandas.DataFrame

  2. -
-

Fetch a result as Data.Frame following execute()

-
    -
  1. df(self: duckdb.DuckDBPyConnection, df: pandas.DataFrame) -> duckdb.DuckDBPyRelation

  2. -
-

Create a relation object from the Data.Frame in df. This is an alias of from_df

+

Fetch a result as DataFrame following execute()

+
+
+ +
+
+dtype(self: duckdb.duckdb.DuckDBPyConnection, type_str: str) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create a type object by parsing the ‘type_str’ string

-duplicate(self: duckdb.DuckDBPyConnection) duckdb.DuckDBPyConnection +duplicate(self: duckdb.duckdb.DuckDBPyConnection) duckdb.duckdb.DuckDBPyConnection

Create a duplicate of the current connection

+
+
+enum_type(self: duckdb.duckdb.DuckDBPyConnection, name: str, type: duckdb.duckdb.typing.DuckDBPyType, values: list) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create an enum type of underlying ‘type’, consisting of the list of ‘values’

+
+
+
-execute(self: duckdb.DuckDBPyConnection, query: str, parameters: object = None, multiple_parameter_sets: bool = False) duckdb.DuckDBPyConnection +execute(self: duckdb.duckdb.DuckDBPyConnection, query: str, parameters: object = None, multiple_parameter_sets: bool = False) duckdb.duckdb.DuckDBPyConnection

Execute the given SQL query, optionally using prepared statements with parameters set

@@ -214,7 +338,7 @@ title: Python Client API
-executemany(self: duckdb.DuckDBPyConnection, query: str, parameters: object = None) duckdb.DuckDBPyConnection +executemany(self: duckdb.duckdb.DuckDBPyConnection, query: str, parameters: object = None) duckdb.duckdb.DuckDBPyConnection

Execute the given prepared statement multiple times using the list of parameter sets in parameters

@@ -223,7 +347,7 @@ title: Python Client API
-fetch_arrow_table(self: duckdb.DuckDBPyConnection, chunk_size: int = 1000000) pyarrow.lib.Table +fetch_arrow_table(self: duckdb.duckdb.DuckDBPyConnection, rows_per_batch: int = 1000000) pyarrow.lib.Table

Fetch a result as Arrow table following execute()

@@ -232,16 +356,16 @@ title: Python Client API
-fetch_df(self: duckdb.DuckDBPyConnection) pandas.DataFrame +fetch_df(self: duckdb.duckdb.DuckDBPyConnection, *, date_as_object: bool = False) pandas.DataFrame
-

Fetch a result as Data.Frame following execute()

+

Fetch a result as DataFrame following execute()

-fetch_df_chunk(self: duckdb.DuckDBPyConnection, vectors_per_chunk: int = 1) pandas.DataFrame +fetch_df_chunk(self: duckdb.duckdb.DuckDBPyConnection, vectors_per_chunk: int = 1, *, date_as_object: bool = False) pandas.DataFrame

Fetch a chunk of the result as Data.Frame following execute()

@@ -250,7 +374,7 @@ title: Python Client API
-fetch_record_batch(self: duckdb.DuckDBPyConnection, chunk_size: int = 1000000) pyarrow.lib.RecordBatchReader +fetch_record_batch(self: duckdb.duckdb.DuckDBPyConnection, rows_per_batch: int = 1000000) pyarrow.lib.RecordBatchReader

Fetch an Arrow RecordBatchReader following execute()

@@ -259,7 +383,7 @@ title: Python Client API
-fetchall(self: duckdb.DuckDBPyConnection) list +fetchall(self: duckdb.duckdb.DuckDBPyConnection) list

Fetch all rows from a result following execute

@@ -268,16 +392,16 @@ title: Python Client API
-fetchdf(self: duckdb.DuckDBPyConnection) pandas.DataFrame +fetchdf(self: duckdb.duckdb.DuckDBPyConnection, *, date_as_object: bool = False) pandas.DataFrame
-

Fetch a result as Data.Frame following execute()

+

Fetch a result as DataFrame following execute()

-fetchmany(self: duckdb.DuckDBPyConnection, size: int = 1) list +fetchmany(self: duckdb.duckdb.DuckDBPyConnection, size: int = 1) list

Fetch the next set of rows from a result following execute

@@ -286,7 +410,7 @@ title: Python Client API
-fetchnumpy(self: duckdb.DuckDBPyConnection) dict +fetchnumpy(self: duckdb.duckdb.DuckDBPyConnection) dict

Fetch a result as list of NumPy arrays following execute

@@ -295,16 +419,25 @@ title: Python Client API
-fetchone(self: duckdb.DuckDBPyConnection) object +fetchone(self: duckdb.duckdb.DuckDBPyConnection) Optional[tuple]

Fetch a single row from a result following execute

+
+
+filesystem_is_registered(self: duckdb.duckdb.DuckDBPyConnection, name: str) bool +
+
+

Check if a filesystem with the provided name is currently registered

+
+
+
-from_arrow(self: duckdb.DuckDBPyConnection, arrow_object: object) duckdb.DuckDBPyRelation +from_arrow(self: duckdb.duckdb.DuckDBPyConnection, arrow_object: object) duckdb.duckdb.DuckDBPyRelation

Create a relation object from an Arrow object

@@ -313,16 +446,16 @@ title: Python Client API
-from_csv_auto(self: duckdb.DuckDBPyConnection, file_name: str) duckdb.DuckDBPyRelation +from_csv_auto(self: duckdb.duckdb.DuckDBPyConnection, name: object, *, header: object = None, compression: object = None, sep: object = None, delimiter: object = None, dtype: object = None, na_values: object = None, skiprows: object = None, quotechar: object = None, escapechar: object = None, encoding: object = None, parallel: object = None, date_format: object = None, timestamp_format: object = None, sample_size: object = None, all_varchar: object = None, normalize_names: object = None, filename: object = None, null_padding: object = None, names: object = None) duckdb.duckdb.DuckDBPyRelation
-

Create a relation object from the CSV file in file_name

+

Create a relation object from the CSV file in ‘name’

-from_df(self: duckdb.DuckDBPyConnection, df: pandas.DataFrame = None) duckdb.DuckDBPyRelation +from_df(self: duckdb.duckdb.DuckDBPyConnection, df: pandas.DataFrame = None) duckdb.duckdb.DuckDBPyRelation

Create a relation object from the Data.Frame in df

@@ -331,34 +464,51 @@ title: Python Client API
-from_parquet(self: duckdb.DuckDBPyConnection, file_name: str, binary_as_string: bool = False) duckdb.DuckDBPyRelation +from_parquet(*args, **kwargs)
-

Create a relation object from the Parquet file in file_name

+

Overloaded function.

+
    +
  1. from_parquet(self: duckdb.duckdb.DuckDBPyConnection, file_glob: str, binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Create a relation object from the Parquet files in file_glob

+
    +
  1. from_parquet(self: duckdb.duckdb.DuckDBPyConnection, file_globs: List[str], binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Create a relation object from the Parquet files in file_globs

-from_query(self: duckdb.DuckDBPyConnection, query: str, alias: str = 'query_relation') duckdb.DuckDBPyRelation +from_query(self: duckdb.duckdb.DuckDBPyConnection, query: str, *, alias: str = '', params: object = None) duckdb.duckdb.DuckDBPyRelation
-

Create a relation object from the given SQL query

+

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

-from_substrait(self: duckdb.DuckDBPyConnection, proto: bytes) duckdb.DuckDBPyRelation +from_substrait(self: duckdb.duckdb.DuckDBPyConnection, proto: bytes) duckdb.duckdb.DuckDBPyRelation

Create a query object from protobuf plan

+
+
+from_substrait_json(self: duckdb.duckdb.DuckDBPyConnection, json: str) duckdb.duckdb.DuckDBPyRelation +
+
+

Create a query object from a JSON protobuf plan

+
+
+
-get_substrait(self: duckdb.DuckDBPyConnection, query: str) duckdb.DuckDBPyRelation +get_substrait(self: duckdb.duckdb.DuckDBPyConnection, query: str, *, enable_optimizer: bool = True) duckdb.duckdb.DuckDBPyRelation

Serialize a query to protobuf

@@ -367,7 +517,7 @@ title: Python Client API
-get_substrait_json(self: duckdb.DuckDBPyConnection, query: str) duckdb.DuckDBPyRelation +get_substrait_json(self: duckdb.duckdb.DuckDBPyConnection, query: str, *, enable_optimizer: bool = True) duckdb.duckdb.DuckDBPyRelation

Serialize a query to protobuf on the JSON format

@@ -376,7 +526,7 @@ title: Python Client API
-get_table_names(self: duckdb.DuckDBPyConnection, query: str) Set[str] +get_table_names(self: duckdb.duckdb.DuckDBPyConnection, query: str) Set[str]

Extract the required table names from a query

@@ -385,7 +535,7 @@ title: Python Client API
-install_extension(self: duckdb.DuckDBPyConnection, extension: str, *, force_install: bool = False) None +install_extension(self: duckdb.duckdb.DuckDBPyConnection, extension: str, *, force_install: bool = False) None

Install an extension by name

@@ -393,1165 +543,2640 @@ title: Python Client API
-
-load_extension(self: duckdb.DuckDBPyConnection, extension: str) None +
+interrupt(self: duckdb.duckdb.DuckDBPyConnection) None
-

Load an installed extension

+

Interrupt pending operations

-
-query(self: duckdb.DuckDBPyConnection, query: str, alias: str = 'query_relation') duckdb.DuckDBPyRelation +
+list_filesystems(self: duckdb.duckdb.DuckDBPyConnection) list
-

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

+

List registered filesystems, including builtin ones

-
-register(self: duckdb.DuckDBPyConnection, view_name: str, python_object: object) duckdb.DuckDBPyConnection +
+list_type(self: duckdb.duckdb.DuckDBPyConnection, type: duckdb.duckdb.typing.DuckDBPyType) duckdb.duckdb.typing.DuckDBPyType
-

Register the passed Python Object value for querying with a view

+

Create an array type object of ‘type’

-
-rollback(self: duckdb.DuckDBPyConnection) duckdb.DuckDBPyConnection +
+load_extension(self: duckdb.duckdb.DuckDBPyConnection, extension: str) None
-

Roll back changes performed within a transaction

+

Load an installed extension

-
-table(self: duckdb.DuckDBPyConnection, table_name: str) duckdb.DuckDBPyRelation +
+map_type(self: duckdb.duckdb.DuckDBPyConnection, key: duckdb.duckdb.typing.DuckDBPyType, value: duckdb.duckdb.typing.DuckDBPyType) duckdb.duckdb.typing.DuckDBPyType
-

Create a relation object for the name’d table

+

Create a map type object from ‘key_type’ and ‘value_type’

-
-table_function(self: duckdb.DuckDBPyConnection, name: str, parameters: object = None) duckdb.DuckDBPyRelation +
+pl(self: duckdb.duckdb.DuckDBPyConnection, rows_per_batch: int = 1000000) duckdb::PolarsDataFrame
-

Create a relation object from the name’d table function with given parameters

+

Fetch a result as Polars DataFrame following execute()

-
-unregister(self: duckdb.DuckDBPyConnection, view_name: str) duckdb.DuckDBPyConnection +
+query(self: duckdb.duckdb.DuckDBPyConnection, query: str, *, alias: str = '', params: object = None) duckdb.duckdb.DuckDBPyRelation
-

Unregister the view name

+

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

-
-values(self: duckdb.DuckDBPyConnection, values: object) duckdb.DuckDBPyRelation +
+read_csv(self: duckdb.duckdb.DuckDBPyConnection, name: object, *, header: object = None, compression: object = None, sep: object = None, delimiter: object = None, dtype: object = None, na_values: object = None, skiprows: object = None, quotechar: object = None, escapechar: object = None, encoding: object = None, parallel: object = None, date_format: object = None, timestamp_format: object = None, sample_size: object = None, all_varchar: object = None, normalize_names: object = None, filename: object = None, null_padding: object = None, names: object = None) duckdb.duckdb.DuckDBPyRelation
-

Create a relation object from the passed values

+

Create a relation object from the CSV file in ‘name’

-
-view(self: duckdb.DuckDBPyConnection, view_name: str) duckdb.DuckDBPyRelation +
+read_json(self: duckdb.duckdb.DuckDBPyConnection, name: str, *, columns: Optional[object] = None, sample_size: Optional[object] = None, maximum_depth: Optional[object] = None, records: Optional[str] = None, format: Optional[str] = None) duckdb.duckdb.DuckDBPyRelation
-

Create a relation object for the name’d view

+

Create a relation object from the JSON file in ‘name’

+
+
+read_parquet(*args, **kwargs) +
+
+

Overloaded function.

+
    +
  1. read_parquet(self: duckdb.duckdb.DuckDBPyConnection, file_glob: str, binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Create a relation object from the Parquet files in file_glob

+
    +
  1. read_parquet(self: duckdb.duckdb.DuckDBPyConnection, file_globs: List[str], binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Create a relation object from the Parquet files in file_globs

-
-
-class duckdb.DuckDBPyRelation -
-
-

Bases: pybind11_object

-
-abs(self: duckdb.DuckDBPyRelation, aggregation_columns: str) duckdb.DuckDBPyRelation +
+register(self: duckdb.duckdb.DuckDBPyConnection, view_name: str, python_object: object) duckdb.duckdb.DuckDBPyConnection
-

Returns the absolute value for the specified columns.

+

Register the passed Python Object value for querying with a view

-
-aggregate(self: duckdb.DuckDBPyRelation, aggr_expr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+register_filesystem(self: duckdb.duckdb.DuckDBPyConnection, filesystem: fsspec.AbstractFileSystem) None
-

Compute the aggregate aggr_expr by the optional groups group_expr on the relation

+

Register a fsspec compliant filesystem

-
-
-property alias +
+
+remove_function(self: duckdb.duckdb.DuckDBPyConnection, name: str) duckdb.duckdb.DuckDBPyConnection
-

Get the name of the current alias

+

Remove a previously created function

-
-apply(self: duckdb.DuckDBPyRelation, function_name: str, function_aggr: str, group_expr: str = '', function_parameter: str = '', projected_columns: str = '') duckdb.DuckDBPyRelation +
+rollback(self: duckdb.duckdb.DuckDBPyConnection) duckdb.duckdb.DuckDBPyConnection
-

Compute the function of a single column or a list of columns by the optional groups on the relation

+

Roll back changes performed within a transaction

-
-arrow(self: duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.Table +
+row_type(self: duckdb.duckdb.DuckDBPyConnection, fields: object) duckdb.duckdb.typing.DuckDBPyType
-

Execute and fetch all rows as an Arrow Table

+

Create a struct type object from ‘fields’

-
-property columns +
+property rowcount
-

Get the names of the columns of this relation.

+

Get result set row count

-
-count(self: duckdb.DuckDBPyRelation, count_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+sql(self: duckdb.duckdb.DuckDBPyConnection, query: str, *, alias: str = '', params: object = None) duckdb.duckdb.DuckDBPyRelation
-

Compute the aggregate count of a single column or a list of columns by the optional groups on the relation

+

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

-
-create(self: duckdb.DuckDBPyRelation, table_name: str) None +
+sqltype(self: duckdb.duckdb.DuckDBPyConnection, type_str: str) duckdb.duckdb.typing.DuckDBPyType
-

Creates a new table named table_name with the contents of the relation object

+

Create a type object by parsing the ‘type_str’ string

-
-create_view(self: duckdb.DuckDBPyRelation, view_name: str, replace: bool = True) duckdb.DuckDBPyRelation +
+string_type(self: duckdb.duckdb.DuckDBPyConnection, collation: str = '') duckdb.duckdb.typing.DuckDBPyType
-

Creates a view named view_name that refers to the relation object

+

Create a string type with an optional collation

-
-cummax(self: duckdb.DuckDBPyRelation, aggregation_columns: str) duckdb.DuckDBPyRelation +
+struct_type(self: duckdb.duckdb.DuckDBPyConnection, fields: object) duckdb.duckdb.typing.DuckDBPyType
-

Returns the cumulative maximum of the aggregate column.

+

Create a struct type object from ‘fields’

-
-cummin(self: duckdb.DuckDBPyRelation, aggregation_columns: str) duckdb.DuckDBPyRelation +
+table(self: duckdb.duckdb.DuckDBPyConnection, table_name: str) duckdb.duckdb.DuckDBPyRelation
-

Returns the cumulative minimum of the aggregate column.

+

Create a relation object for the name’d table

-
-cumprod(self: duckdb.DuckDBPyRelation, aggregation_columns: str) duckdb.DuckDBPyRelation +
+table_function(self: duckdb.duckdb.DuckDBPyConnection, name: str, parameters: object = None) duckdb.duckdb.DuckDBPyRelation
-

Returns the cumulative product of the aggregate column.

+

Create a relation object from the name’d table function with given parameters

-
-cumsum(self: duckdb.DuckDBPyRelation, aggregation_columns: str) duckdb.DuckDBPyRelation +
+tf(self: duckdb.duckdb.DuckDBPyConnection) dict
-

Returns the cumulative sum of the aggregate column.

+

Fetch a result as dict of TensorFlow Tensors following execute()

-
-describe(self: duckdb.DuckDBPyRelation) duckdb.DuckDBPyRelation +
+torch(self: duckdb.duckdb.DuckDBPyConnection) dict
-

Gives basic statistics (e.g., min,max) and if null exists for each column of the relation.

+

Fetch a result as dict of PyTorch Tensors following execute()

-
-df(self: duckdb.DuckDBPyRelation) pandas.DataFrame +
+type(self: duckdb.duckdb.DuckDBPyConnection, type_str: str) duckdb.duckdb.typing.DuckDBPyType
-

Execute and fetch all rows as a pandas DataFrame

+

Create a type object by parsing the ‘type_str’ string

-
-distinct(self: duckdb.DuckDBPyRelation) duckdb.DuckDBPyRelation +
+union_type(self: duckdb.duckdb.DuckDBPyConnection, members: object) duckdb.duckdb.typing.DuckDBPyType
-

Retrieve distinct rows from this relation object

+

Create a union type object from ‘members’

-
-
-property dtypes +
+
+unregister(self: duckdb.duckdb.DuckDBPyConnection, view_name: str) duckdb.duckdb.DuckDBPyConnection
-

Get the columns types of the result.

+

Unregister the view name

-
-except_(self: duckdb.DuckDBPyRelation, other_rel: duckdb.DuckDBPyRelation) duckdb.DuckDBPyRelation +
+unregister_filesystem(self: duckdb.duckdb.DuckDBPyConnection, name: str) None
-

Create the set except of this relation object with another relation object in other_rel

+

Unregister a filesystem

-
-execute(self: duckdb.DuckDBPyRelation) duckdb::DuckDBPyResult +
+values(self: duckdb.duckdb.DuckDBPyConnection, values: object) duckdb.duckdb.DuckDBPyRelation
-

Transform the relation into a result set

+

Create a relation object from the passed values

-
-explain(self: duckdb.DuckDBPyRelation) str +
+view(self: duckdb.duckdb.DuckDBPyConnection, view_name: str) duckdb.duckdb.DuckDBPyRelation
-
+
+

Create a relation object for the name’d view

+
-
-
-fetchall(self: duckdb.DuckDBPyRelation) object -
-
-

Execute and fetch all rows as a list of tuples

+
+
+class duckdb.DuckDBPyRelation +
+
+

Bases: pybind11_object

-
-fetchmany(self: duckdb.DuckDBPyRelation, size: int = 1) object +
+aggregate(self: duckdb.duckdb.DuckDBPyRelation, aggr_expr: str, group_expr: str = '') duckdb.duckdb.DuckDBPyRelation
-

Execute and fetch the next set of rows as a list of tuples

+

Compute the aggregate aggr_expr by the optional groups group_expr on the relation

-
-
-fetchnumpy(self: duckdb.DuckDBPyRelation) dict +
+
+property alias
-

Execute and fetch all rows as a Python dict mapping each column to one numpy arrays

+

Get the name of the current alias

-
-fetchone(self: duckdb.DuckDBPyRelation) object +
+any_value(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Execute and fetch a single row as a tuple

+

Returns the first non-null value from a given column

-
-filter(self: duckdb.DuckDBPyRelation, filter_expr: str) duckdb.DuckDBPyRelation +
+apply(self: duckdb.duckdb.DuckDBPyRelation, function_name: str, function_aggr: str, group_expr: str = '', function_parameter: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Filter the relation object by the filter in filter_expr

+

Compute the function of a single column or a list of columns by the optional groups on the relation

-
-insert(self: duckdb.DuckDBPyRelation, values: object) None +
+arg_max(self: duckdb.duckdb.DuckDBPyRelation, arg_column: str, value_column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Inserts the given values into the relation

+

Finds the row with the maximum value for a value column and returns the value of that row for an argument column

-
-insert_into(self: duckdb.DuckDBPyRelation, table_name: str) None +
+arg_min(self: duckdb.duckdb.DuckDBPyRelation, arg_column: str, value_column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Inserts the relation object into an existing table named table_name

+

Finds the row with the minimum value for a value column and returns the value of that row for an argument column

-
-intersect(self: duckdb.DuckDBPyRelation, other_rel: duckdb.DuckDBPyRelation) duckdb.DuckDBPyRelation +
+arrow(self: duckdb.duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.Table
-

Create the set intersection of this relation object with another relation object in other_rel

+

Execute and fetch all rows as an Arrow Table

-
-join(self: duckdb.DuckDBPyRelation, other_rel: duckdb.DuckDBPyRelation, condition: str, how: str = 'inner') duckdb.DuckDBPyRelation +
+avg(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Join the relation object with another relation object in other_rel using the join condition expression in join_condition. Types supported are ‘inner’ and ‘left’

+

Computes the average on a given column

-
-kurt(self: duckdb.DuckDBPyRelation, aggregation_columns: str, group_columns: str = '') duckdb.DuckDBPyRelation +
+bit_and(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Returns the excess kurtosis of the aggregate column.

+

Computes the bitwise AND of all bits present in a given column

-
-limit(self: duckdb.DuckDBPyRelation, n: int, offset: int = 0) duckdb.DuckDBPyRelation +
+bit_or(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Only retrieve the first n rows from this relation object, starting at offset

+

Computes the bitwise OR of all bits present in a given column

-
-mad(self: duckdb.DuckDBPyRelation, aggregation_columns: str, group_columns: str = '') duckdb.DuckDBPyRelation +
+bit_xor(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Returns the median absolute deviation for the aggregate columns. NULL values are ignored. Temporal types return a positive INTERVAL.

+

Computes the bitwise XOR of all bits present in a given column

-
-map(self: duckdb.DuckDBPyRelation, map_function: function) duckdb.DuckDBPyRelation +
+bitstring_agg(self: duckdb.duckdb.DuckDBPyRelation, column: str, min: Optional[object] = None, max: Optional[object] = None, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Calls the passed function on the relation

+

Computes a bitstring with bits set for each distinct value in a given column

-
-max(self: duckdb.DuckDBPyRelation, max_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+bool_and(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Compute the aggregate max of a single column or a list of columns by the optional groups on the relation

+

Computes the logical AND of all values present in a given column

-
-mean(self: duckdb.DuckDBPyRelation, mean_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+bool_or(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Compute the aggregate mean of a single column or a list of columns by the optional groups on the relation

+

Computes the logical OR of all values present in a given column

-
-median(self: duckdb.DuckDBPyRelation, median_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+close(self: duckdb.duckdb.DuckDBPyRelation) None
-

Compute the aggregate median of a single column or a list of columns by the optional groups on the relation

+

Closes the result

-
-
-min(self: duckdb.DuckDBPyRelation, min_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+
+property columns
-

Compute the aggregate min of a single column or a list of columns by the optional groups on the relation

+

Return a list containing the names of the columns of the relation.

-
-mode(self: duckdb.DuckDBPyRelation, aggregation_columns: str, group_columns: str = '') duckdb.DuckDBPyRelation +
+count(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Returns the most frequent value for the aggregate columns. NULL values are ignored.

+

Computes the number of elements present in a given column

-
-order(self: duckdb.DuckDBPyRelation, order_expr: str) duckdb.DuckDBPyRelation +
+create(self: duckdb.duckdb.DuckDBPyRelation, table_name: str) None
-

Reorder the relation object by order_expr

+

Creates a new table named table_name with the contents of the relation object

-
-prod(self: duckdb.DuckDBPyRelation, aggregation_columns: str, group_columns: str = '') duckdb.DuckDBPyRelation +
+create_view(self: duckdb.duckdb.DuckDBPyRelation, view_name: str, replace: bool = True) duckdb.duckdb.DuckDBPyRelation
-

Calculates the product of the aggregate column.

+

Creates a view named view_name that refers to the relation object

-
-project(self: duckdb.DuckDBPyRelation, project_expr: str) duckdb.DuckDBPyRelation +
+cume_dist(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Project the relation object by the projection in project_expr

+

Computes the cumulative distribution within the partition

-
-quantile(self: duckdb.DuckDBPyRelation, q: str, quantile_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+dense_rank(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Compute the quantile of a single column or a list of columns by the optional groups on the relation

+

Computes the dense rank within the partition

-
-query(self: duckdb.DuckDBPyRelation, virtual_table_name: str, sql_query: str) duckdb.DuckDBPyRelation +
+describe(self: duckdb.duckdb.DuckDBPyRelation) duckdb.duckdb.DuckDBPyRelation
-

Run the given SQL query in sql_query on the view named virtual_table_name that refers to the relation object

+

Gives basic statistics (e.g., min,max) and if null exists for each column of the relation.

-
-
-record_batch(self: duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.RecordBatchReader +
+
+property description
-

Execute and return an Arrow Record Batch Reader that yields all rows

+

Return the description of the result

-
-sem(self: duckdb.DuckDBPyRelation, aggregation_columns: str, group_columns: str = '') duckdb.DuckDBPyRelation +
+df(self: duckdb.duckdb.DuckDBPyRelation, *, date_as_object: bool = False) pandas.DataFrame
-

Returns the standard error of the mean of the aggregate column.

+

Execute and fetch all rows as a pandas DataFrame

-
-set_alias(self: duckdb.DuckDBPyRelation, alias: str) duckdb.DuckDBPyRelation +
+distinct(self: duckdb.duckdb.DuckDBPyRelation) duckdb.duckdb.DuckDBPyRelation
-

Rename the relation object to new alias

+

Retrieve distinct rows from this relation object

-
-property shape +
+property dtypes
-

Tuple of # of rows, # of columns in relation.

+

Return a list containing the types of the columns of the relation.

-
-skew(self: duckdb.DuckDBPyRelation, aggregation_columns: str, group_columns: str = '') duckdb.DuckDBPyRelation +
+except_(self: duckdb.duckdb.DuckDBPyRelation, other_rel: duckdb.duckdb.DuckDBPyRelation) duckdb.duckdb.DuckDBPyRelation
-

Returns the skewness of the aggregate column.

+

Create the set except of this relation object with another relation object in other_rel

-
-std(self: duckdb.DuckDBPyRelation, std_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+execute(self: duckdb.duckdb.DuckDBPyRelation) duckdb.duckdb.DuckDBPyRelation
-

Compute the standard deviation of a single column or a list of columns by the optional groups on the relation

+

Transform the relation into a result set

-
-sum(self: duckdb.DuckDBPyRelation, sum_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+explain(self: duckdb.duckdb.DuckDBPyRelation, type: duckdb.duckdb.ExplainType = 'standard') str
-
-

Compute the aggregate sum of a single column or a list of columns by the optional groups on the relation

-
+
-
-to_arrow_table(self: duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.Table +
+favg(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Execute and fetch all rows as an Arrow Table

+

Computes the average of all values present in a given column using a more accurate floating point summation (Kahan Sum)

-
-to_df(self: duckdb.DuckDBPyRelation) pandas.DataFrame +
+fetch_arrow_reader(self: duckdb.duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.RecordBatchReader
-

Execute and fetch all rows as a pandas DataFrame

+

Execute and return an Arrow Record Batch Reader that yields all rows

-
-
-property type +
+
+fetch_arrow_table(self: duckdb.duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.Table
-

Get the type of the relation.

+

Execute and fetch all rows as an Arrow Table

-
-
-property types +
+
+fetchall(self: duckdb.duckdb.DuckDBPyRelation) list
-

Get the columns types of the result.

+

Execute and fetch all rows as a list of tuples

-
-union(self: duckdb.DuckDBPyRelation, union_rel: duckdb.DuckDBPyRelation) duckdb.DuckDBPyRelation +
+fetchdf(self: duckdb.duckdb.DuckDBPyRelation, *, date_as_object: bool = False) pandas.DataFrame
-

Create the set union of this relation object with another relation object in other_rel

+

Execute and fetch all rows as a pandas DataFrame

-
-unique(self: duckdb.DuckDBPyRelation, unique_aggr: str) duckdb.DuckDBPyRelation +
+fetchmany(self: duckdb.duckdb.DuckDBPyRelation, size: int = 1) list
-

Number of distinct values in a column.

+

Execute and fetch the next set of rows as a list of tuples

-
-value_counts(self: duckdb.DuckDBPyRelation, value_counts_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+fetchnumpy(self: duckdb.duckdb.DuckDBPyRelation) dict
-

Count number of rows with each unique value of variable

+

Execute and fetch all rows as a Python dict mapping each column to one numpy arrays

-
-var(self: duckdb.DuckDBPyRelation, var_aggr: str, group_expr: str = '') duckdb.DuckDBPyRelation +
+fetchone(self: duckdb.duckdb.DuckDBPyRelation) Optional[tuple]
-

Compute the variance of a single column or a list of columns by the optional groups on the relation

+

Execute and fetch a single row as a tuple

-
-write_csv(self: duckdb.DuckDBPyRelation, file_name: str) None +
+filter(self: duckdb.duckdb.DuckDBPyRelation, filter_expr: object) duckdb.duckdb.DuckDBPyRelation
-

Write the relation object to a CSV file in file_name

+

Filter the relation object by the filter in filter_expr

+
+
+first(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Returns the first value of a given column

-
-
-class duckdb.DuckDBPyResult -
-
-

Bases: pybind11_object

-
-arrow(self: duckdb.DuckDBPyResult, chunk_size: int = 1000000) pyarrow.lib.Table +
+first_value(self: duckdb.duckdb.DuckDBPyRelation, column: str, window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Fetch all rows as an Arrow Table

+

Computes the first value within the group or partition

-
-close(self: duckdb.DuckDBPyResult) None +
+fsum(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-
+
+

Computes the sum of all values present in a given column using a more accurate floating point summation (Kahan Sum)

+
-
-description(self: duckdb.DuckDBPyResult) list +
+geomean(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-
+
+

Computes the geometric mean over all values present in a given column

+
-
-df(self: duckdb.DuckDBPyResult) pandas.DataFrame +
+histogram(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Fetch all rows as a pandas DataFrame

+

Computes the histogram over all values present in a given column

-
-fetch_arrow_reader(self: duckdb.DuckDBPyResult, approx_batch_size: int) pyarrow.lib.RecordBatchReader +
+insert(self: duckdb.duckdb.DuckDBPyRelation, values: object) None
-

Fetch all rows as an Arrow Record Batch Reader

+

Inserts the given values into the relation

-
-fetch_arrow_table(self: duckdb.DuckDBPyResult, chunk_size: int = 1000000) pyarrow.lib.Table +
+insert_into(self: duckdb.duckdb.DuckDBPyRelation, table_name: str) None
-

Fetch all rows as an Arrow Table

+

Inserts the relation object into an existing table named table_name

-
-fetch_df(self: duckdb.DuckDBPyResult) pandas.DataFrame +
+intersect(self: duckdb.duckdb.DuckDBPyRelation, other_rel: duckdb.duckdb.DuckDBPyRelation) duckdb.duckdb.DuckDBPyRelation
-

Fetch all rows as a pandas DataFrame

+

Create the set intersection of this relation object with another relation object in other_rel

-
-fetch_df_chunk(self: duckdb.DuckDBPyResult, num_of_vectors: int = 1) pandas.DataFrame +
+join(self: duckdb.duckdb.DuckDBPyRelation, other_rel: duckdb.duckdb.DuckDBPyRelation, condition: object, how: str = 'inner') duckdb.duckdb.DuckDBPyRelation
-

Fetch a chunk of rows as a pandas DataFrame

+

Join the relation object with another relation object in other_rel using the join condition expression in join_condition. Types supported are ‘inner’ and ‘left’

-
-fetchall(self: duckdb.DuckDBPyResult) list +
+lag(self: duckdb.duckdb.DuckDBPyRelation, column: str, window_spec: str, offset: int = 1, default_value: str = 'NULL', ignore_nulls: bool = False, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Fetch all rows as a list of tuples

+

Computes the lag within the partition

-
-fetchdf(self: duckdb.DuckDBPyResult) pandas.DataFrame +
+last(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Fetch all rows as a pandas DataFrame

+

Returns the last value of a given column

-
-fetchmany(self: duckdb.DuckDBPyResult, size: int = 1) list +
+last_value(self: duckdb.duckdb.DuckDBPyRelation, column: str, window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Fetch the next set of rows as a list of tuples

+

Computes the last value within the group or partition

-
-fetchnumpy(self: duckdb.DuckDBPyResult) dict +
+lead(self: duckdb.duckdb.DuckDBPyRelation, column: str, window_spec: str, offset: int = 1, default_value: str = 'NULL', ignore_nulls: bool = False, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Fetch all rows as a Python dict mapping each column to one numpy arrays

+

Computes the lead within the partition

-
-fetchone(self: duckdb.DuckDBPyResult) object +
+limit(self: duckdb.duckdb.DuckDBPyRelation, n: int, offset: int = 0) duckdb.duckdb.DuckDBPyRelation
-

Fetch a single row as a tuple

+

Only retrieve the first n rows from this relation object, starting at offset

+
+
+list(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Returns a list containing all values present in a given column

-
-
-exception duckdb.Error +
+
+map(self: duckdb.duckdb.DuckDBPyRelation, map_function: function, *, schema: Optional[object] = None) duckdb.duckdb.DuckDBPyRelation
-

Bases: Exception

+

Calls the passed function on the relation

-
-
-exception duckdb.FatalException +
+
+max(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: Error

+

Returns the maximum value present in a given column

-
-
-exception duckdb.IOException +
+
+mean(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: OperationalError

+

Computes the average on a given column

-
-
-exception duckdb.IntegrityError +
+
+median(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: Error

+

Computes the median over all values present in a given column

-
-
-exception duckdb.InternalError +
+
+min(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: Error

+

Returns the minimum value present in a given column

-
-
-exception duckdb.InternalException +
+
+mode(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: InternalError

+

Computes the mode over all values present in a given column

-
-
-exception duckdb.InterruptException +
+
+n_tile(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, num_buckets: int, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: Error

+

Divides the partition as equally as possible into num_buckets

-
-
-exception duckdb.InvalidInputException +
+
+nth_value(self: duckdb.duckdb.DuckDBPyRelation, column: str, window_spec: str, offset: int, ignore_nulls: bool = False, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: ProgrammingError

+

Computes the nth value within the partition

-
-
-exception duckdb.InvalidTypeException +
+
+order(self: duckdb.duckdb.DuckDBPyRelation, order_expr: str) duckdb.duckdb.DuckDBPyRelation
-

Bases: ProgrammingError

+

Reorder the relation object by order_expr

-
-
-exception duckdb.NotImplementedException +
+
+percent_rank(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: NotSupportedError

+

Computes the relative rank within the partition

-
-
-exception duckdb.NotSupportedError +
+
+pl(self: duckdb.duckdb.DuckDBPyRelation, batch_size: int = 1000000) duckdb::PolarsDataFrame
-

Bases: Error

+

Execute and fetch all rows as a Polars DataFrame

-
-
-exception duckdb.OperationalError +
+
+product(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: Error

+

Returns the product of all values present in a given column

-
-
-exception duckdb.OutOfMemoryException +
+
+project(self: duckdb.duckdb.DuckDBPyRelation, *args, **kwargs) duckdb.duckdb.DuckDBPyRelation
-

Bases: OperationalError

+

Project the relation object by the projection in project_expr

-
-
-exception duckdb.OutOfRangeException +
+
+quantile(self: duckdb.duckdb.DuckDBPyRelation, column: str, q: object = 0.5, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: DataError

+

Computes the exact quantile value for a given column

-
-
-exception duckdb.ParserException +
+
+quantile_cont(self: duckdb.duckdb.DuckDBPyRelation, column: str, q: object = 0.5, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: ProgrammingError

+

Computes the interpolated quantile value for a given column

-
-
-exception duckdb.PermissionException +
+
+quantile_disc(self: duckdb.duckdb.DuckDBPyRelation, column: str, q: object = 0.5, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: Error

+

Computes the exact quantile value for a given column

-
-
-exception duckdb.ProgrammingError +
+
+query(self: duckdb.duckdb.DuckDBPyRelation, virtual_table_name: str, sql_query: str) duckdb.duckdb.DuckDBPyRelation
-

Bases: Error

+

Run the given SQL query in sql_query on the view named virtual_table_name that refers to the relation object

-
-
-exception duckdb.SequenceException +
+
+rank(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: Error

+

Computes the rank within the partition

-
-
-exception duckdb.SerializationException +
+
+rank_dense(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: OperationalError

+

Computes the dense rank within the partition

-
-
-exception duckdb.StandardException +
+
+record_batch(self: duckdb.duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.RecordBatchReader
-

Bases: Error

+

Execute and return an Arrow Record Batch Reader that yields all rows

-
-
-exception duckdb.SyntaxException +
+
+row_number(self: duckdb.duckdb.DuckDBPyRelation, window_spec: str, projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Bases: ProgrammingError

+

Computes the row number within the partition

-
-
-exception duckdb.TransactionException +
+
+select(self: duckdb.duckdb.DuckDBPyRelation, *args, **kwargs) duckdb.duckdb.DuckDBPyRelation
-

Bases: OperationalError

+

Project the relation object by the projection in project_expr

-
-
-exception duckdb.TypeMismatchException +
+
+select_dtypes(self: duckdb.duckdb.DuckDBPyRelation, types: object) duckdb.duckdb.DuckDBPyRelation
-

Bases: DataError

+

Select columns from the relation, by filtering based on type(s)

-
-
-exception duckdb.ValueOutOfRangeException +
+
+select_types(self: duckdb.duckdb.DuckDBPyRelation, types: object) duckdb.duckdb.DuckDBPyRelation
-

Bases: DataError

+

Select columns from the relation, by filtering based on type(s)

-
-
-exception duckdb.Warning +
+
+set_alias(self: duckdb.duckdb.DuckDBPyRelation, alias: str) duckdb.duckdb.DuckDBPyRelation
-

Bases: Exception

+

Rename the relation object to new alias

-
-
-duckdb.aggregate(df: pandas.DataFrame, aggr_expr: str, group_expr: str = '', connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+property shape
-

Compute the aggregate aggr_expr by the optional groups group_expr on Data.frame df

+

Tuple of # of rows, # of columns in relation.

-
-
-duckdb.alias(df: pandas.DataFrame, alias: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+show(self: duckdb.duckdb.DuckDBPyRelation, *, max_width: Optional[int] = None, max_rows: Optional[int] = None, max_col_width: Optional[int] = None, null_value: Optional[str] = None, render_mode: object = None) None
-

Create a relation from Data.Frame df with the passed alias

+

Display a summary of the data

-
-
-duckdb.arrow(arrow_object: object, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+sort(self: duckdb.duckdb.DuckDBPyRelation, *args) duckdb.duckdb.DuckDBPyRelation
-

Create a relation object from an Arrow object

+

Reorder the relation object by the provided expressions

-
-
-duckdb.connect(database: str = ':memory:', read_only: bool = False, config: object = None) duckdb.DuckDBPyConnection +
+
+sql_query(self: duckdb.duckdb.DuckDBPyRelation) str
-

Create a DuckDB database instance. Can take a database file name to read/write persistent data and a read_only flag if no changes are desired

+

Get the SQL query that is equivalent to the relation

-
-
-duckdb.df(df: pandas.DataFrame, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+std(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Create a relation object from the Data.Frame df

+

Computes the sample standard deviation for a given column

-
-
-duckdb.distinct(df: pandas.DataFrame, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+stddev(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Compute the distinct rows from Data.Frame df

+

Computes the sample standard deviation for a given column

-
-
-duckdb.filter(df: pandas.DataFrame, filter_expr: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+stddev_pop(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Filter the Data.Frame df by the filter in filter_expr

+

Computes the population standard deviation for a given column

-
-
-duckdb.from_arrow(arrow_object: object, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+stddev_samp(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Create a relation object from an Arrow object

+

Computes the sample standard deviation for a given column

-
-
-duckdb.from_csv_auto(file_name: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+string_agg(self: duckdb.duckdb.DuckDBPyRelation, column: str, sep: str = ',', groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Creates a relation object from the CSV file in file_name

+

Concatenates the values present in a given column with a separator

-
-
-duckdb.from_df(df: pandas.DataFrame, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+sum(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation
-

Create a relation object from the Data.Frame df

+

Computes the sum of all values present in a given column

-
-
-duckdb.from_parquet(*args, **kwargs) +
+
+tf(self: duckdb.duckdb.DuckDBPyRelation) dict
-

Overloaded function.

-
    -
  1. from_parquet(file_name: str, binary_as_string: bool, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. -
-

Creates a relation object from the Parquet file in file_name

-
    -
  1. from_parquet(file_name: str, connection: duckdb.DuckDBPyConnection = None) -> duckdb.DuckDBPyRelation

  2. -
-

Creates a relation object from the Parquet file in file_name

+

Fetch a result as dict of TensorFlow Tensors

-
-
-duckdb.from_query(query: str, alias: str = 'query_relation', connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+to_arrow_table(self: duckdb.duckdb.DuckDBPyRelation, batch_size: int = 1000000) pyarrow.lib.Table
-

Create a relation object from the given SQL query

+

Execute and fetch all rows as an Arrow Table

-
-
-duckdb.from_substrait(proto: bytes, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+to_csv(self: duckdb.duckdb.DuckDBPyRelation, file_name: str, *, sep: object = None, na_rep: object = None, header: object = None, quotechar: object = None, escapechar: object = None, date_format: object = None, timestamp_format: object = None, quoting: object = None, encoding: object = None, compression: object = None) None
-

Creates a query object from the substrait plan

+

Write the relation object to a CSV file in ‘file_name’

-
-
-duckdb.get_substrait(query: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+to_df(self: duckdb.duckdb.DuckDBPyRelation, *, date_as_object: bool = False) pandas.DataFrame
-

Serialize a query object to protobuf

+

Execute and fetch all rows as a pandas DataFrame

-
-
-duckdb.get_substrait_json(query: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+to_parquet(self: duckdb.duckdb.DuckDBPyRelation, file_name: str, *, compression: object = None) None
-

Serialize a query object to protobuf

+

Write the relation object to a Parquet file in ‘file_name’

-
-
-duckdb.limit(df: pandas.DataFrame, n: int, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+to_table(self: duckdb.duckdb.DuckDBPyRelation, table_name: str) None
-

Retrieve the first n rows from the Data.Frame df

+

Creates a new table named table_name with the contents of the relation object

-
-
-duckdb.order(df: pandas.DataFrame, order_expr: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+to_view(self: duckdb.duckdb.DuckDBPyRelation, view_name: str, replace: bool = True) duckdb.duckdb.DuckDBPyRelation
-

Reorder the Data.Frame df by order_expr

+

Creates a view named view_name that refers to the relation object

-
-
-duckdb.project(df: pandas.DataFrame, project_expr: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+torch(self: duckdb.duckdb.DuckDBPyRelation) dict
-

Project the Data.Frame df by the projection in project_expr

+

Fetch a result as dict of PyTorch Tensors

-
-
-duckdb.query(query: str, alias: str = 'query_relation', connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +
+
+property type
-

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

+

Get the type of the relation.

-
+
+
+property types +
+
+

Return a list containing the types of the columns of the relation.

+
+
+ +
+
+union(self: duckdb.duckdb.DuckDBPyRelation, union_rel: duckdb.duckdb.DuckDBPyRelation) duckdb.duckdb.DuckDBPyRelation +
+
+

Create the set union of this relation object with another relation object in other_rel

+
+
+ +
+
+unique(self: duckdb.duckdb.DuckDBPyRelation, unique_aggr: str) duckdb.duckdb.DuckDBPyRelation +
+
+

Number of distinct values in a column.

+
+
+ +
+
+var(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the sample variance for a given column

+
+
+ +
+
+var_pop(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the population variance for a given column

+
+
+ +
+
+var_samp(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the sample variance for a given column

+
+
+ +
+
+variance(self: duckdb.duckdb.DuckDBPyRelation, column: str, groups: str = '', window_spec: str = '', projected_columns: str = '') duckdb.duckdb.DuckDBPyRelation +
+
+

Computes the sample variance for a given column

+
+
+ +
+
+write_csv(self: duckdb.duckdb.DuckDBPyRelation, file_name: str, *, sep: object = None, na_rep: object = None, header: object = None, quotechar: object = None, escapechar: object = None, date_format: object = None, timestamp_format: object = None, quoting: object = None, encoding: object = None, compression: object = None) None +
+
+

Write the relation object to a CSV file in ‘file_name’

+
+
+ +
+
+write_parquet(self: duckdb.duckdb.DuckDBPyRelation, file_name: str, *, compression: object = None) None +
+
+

Write the relation object to a Parquet file in ‘file_name’

+
+
+ +
+
+ +
+
+exception duckdb.Error +
+
+

Bases: Exception

+
+
+ +
+
+class duckdb.ExplainType +
+
+

Bases: pybind11_object

+

Members:

+

STANDARD

+

ANALYZE

+
+
+ANALYZE = <ExplainType.ANALYZE: 1> +
+
+
+ +
+
+STANDARD = <ExplainType.STANDARD: 0> +
+
+
+ +
+
+property name +
+
+
+ +
+
+property value +
+
+
+ +
+
+ +
+
+class duckdb.Expression +
+
+

Bases: pybind11_object

+
+
+alias(self: duckdb.duckdb.Expression, arg0: str) duckdb.duckdb.Expression +
+
+

Create a copy of this expression with the given alias.

+
+
Parameters:
+
+

name: The alias to use for the expression, this will affect how it can be referenced.

+
+
Returns:
+
+

Expression: self with an alias.

+
+
+
+
+ +
+
+asc(self: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+

Set the order by modifier to ASCENDING.

+
+
+ +
+
+cast(self: duckdb.duckdb.Expression, type: duckdb.duckdb.typing.DuckDBPyType) duckdb.duckdb.Expression +
+
+

Create a CastExpression to type from self

+
+
Parameters:
+
+

type: The type to cast to

+
+
Returns:
+
+

CastExpression: self::type

+
+
+
+
+ +
+
+desc(self: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+

Set the order by modifier to DESCENDING.

+
+
+ +
+
+isin(self: duckdb.duckdb.Expression, *args) duckdb.duckdb.Expression +
+
+

Return a IN expression comparing self to the input arguments.

+
+
Returns:
+
+

DuckDBPyExpression: The compare IN expression

+
+
+
+
+ +
+
+isnotin(self: duckdb.duckdb.Expression, *args) duckdb.duckdb.Expression +
+
+

Return a NOT IN expression comparing self to the input arguments.

+
+
Returns:
+
+

DuckDBPyExpression: The compare NOT IN expression

+
+
+
+
+ +
+
+nulls_first(self: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+

Set the NULL order by modifier to NULLS FIRST.

+
+
+ +
+
+nulls_last(self: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+

Set the NULL order by modifier to NULLS LAST.

+
+
+ +
+
+otherwise(self: duckdb.duckdb.Expression, value: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+

Add an ELSE <value> clause to the CaseExpression.

+
+
Parameters:
+
+

value: The value to use if none of the WHEN conditions are met.

+
+
Returns:
+
+

CaseExpression: self with an ELSE clause.

+
+
+
+
+ +
+
+show(self: duckdb.duckdb.Expression) None +
+
+

Print the stringified version of the expression.

+
+
+ +
+
+when(self: duckdb.duckdb.Expression, condition: duckdb.duckdb.Expression, value: duckdb.duckdb.Expression) duckdb.duckdb.Expression +
+
+

Add an additional WHEN <condition> THEN <value> clause to the CaseExpression.

+
+
Parameters:
+
+

condition: The condition that must be met. +value: The value to use if the condition is met.

+
+
Returns:
+
+

CaseExpression: self with an additional WHEN clause.

+
+
+
+
+ +
+
+ +
+
+exception duckdb.FatalException +
+
+

Bases: Error

+
+
+ +
+
+class duckdb.FloatValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+duckdb.FunctionExpression(function_name: str, *args) duckdb.duckdb.Expression +
+
+
+ +
+
+exception duckdb.HTTPException +
+
+

Bases: IOException

+

Thrown when an error occurs in the httpfs extension, or whilst downloading an extension.

+
+
+body: str +
+
+
+ +
+
+headers: Dict[str, str] +
+
+
+ +
+
+reason: str +
+
+
+ +
+
+status_code: int +
+
+
+ +
+
+ +
+
+class duckdb.HugeIntegerValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+exception duckdb.IOException +
+
+

Bases: OperationalError

+
+
+ +
+
+class duckdb.IntegerValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+exception duckdb.IntegrityError +
+
+

Bases: Error

+
+
+ +
+
+exception duckdb.InternalError +
+
+

Bases: Error

+
+
+ +
+
+exception duckdb.InternalException +
+
+

Bases: InternalError

+
+
+ +
+
+exception duckdb.InterruptException +
+
+

Bases: Error

+
+
+ +
+
+class duckdb.IntervalValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+exception duckdb.InvalidInputException +
+
+

Bases: ProgrammingError

+
+
+ +
+
+exception duckdb.InvalidTypeException +
+
+

Bases: ProgrammingError

+
+
+ +
+
+class duckdb.LongValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+exception duckdb.NotImplementedException +
+
+

Bases: NotSupportedError

+
+
+ +
+
+exception duckdb.NotSupportedError +
+
+

Bases: Error

+
+
+ +
+
+class duckdb.NullValue +
+
+

Bases: Value

+
+
+ +
+
+exception duckdb.OperationalError +
+
+

Bases: Error

+
+
+ +
+
+exception duckdb.OutOfMemoryException +
+
+

Bases: OperationalError

+
+
+ +
+
+exception duckdb.OutOfRangeException +
+
+

Bases: DataError

+
+
+ +
+
+exception duckdb.ParserException +
+
+

Bases: ProgrammingError

+
+
+ +
+
+exception duckdb.PermissionException +
+
+

Bases: Error

+
+
+ +
+
+exception duckdb.ProgrammingError +
+
+

Bases: Error

+
+
+ +
+
+class duckdb.PythonExceptionHandling +
+
+

Bases: pybind11_object

+

Members:

+

DEFAULT

+

RETURN_NULL

+
+
+DEFAULT = <PythonExceptionHandling.DEFAULT: 0> +
+
+
+ +
+
+RETURN_NULL = <PythonExceptionHandling.RETURN_NULL: 1> +
+
+
+ +
+
+property name +
+
+
+ +
+
+property value +
+
+
+ +
+
+ +
+
+exception duckdb.SequenceException +
+
+

Bases: Error

+
+
+ +
+
+exception duckdb.SerializationException +
+
+

Bases: OperationalError

+
+
+ +
+
+class duckdb.ShortValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+exception duckdb.StandardException +
+
+

Bases: Error

+
+
+ +
+
+duckdb.StarExpression(*args, **kwargs) +
+
+

Overloaded function.

+
    +
  1. StarExpression(*, exclude: list = []) -> duckdb.duckdb.Expression

  2. +
  3. StarExpression() -> duckdb.duckdb.Expression

  4. +
+
+
+ +
+
+class duckdb.StringValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+exception duckdb.SyntaxException +
+
+

Bases: ProgrammingError

+
+
+ +
+
+class duckdb.TimeTimeZoneValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.TimeValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.TimestampMilisecondValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.TimestampNanosecondValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.TimestampSecondValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.TimestampTimeZoneValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.TimestampValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+exception duckdb.TransactionException +
+
+

Bases: OperationalError

+
+
+ +
+
+exception duckdb.TypeMismatchException +
+
+

Bases: DataError

+
+
+ +
+
+class duckdb.UUIDValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.UnsignedBinaryValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.UnsignedIntegerValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.UnsignedLongValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.UnsignedShortValue(object: Any) +
+
+

Bases: Value

+
+
+ +
+
+class duckdb.Value(object: Any, type: DuckDBPyType) +
+
+

Bases: object

+
+
+ +
+
+exception duckdb.ValueOutOfRangeException +
+
+

Bases: DataError

+
+
+ +
+
+exception duckdb.Warning +
+
+

Bases: Exception

+
+
+ +
+
+duckdb.aggregate(df: pandas.DataFrame, aggr_expr: str, group_expr: str = '', connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Compute the aggregate aggr_expr by the optional groups group_expr on DataFrame df

+
+
+ +
+
+duckdb.alias(df: pandas.DataFrame, alias: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Create a relation from DataFrame df with the passed alias

+
+
+ +
+
+duckdb.append(table_name: str, df: pandas.DataFrame, *, by_name: bool = False, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +
+
+

Append the passed DataFrame to the named table

+
+
+ +
+
+duckdb.array_type(type: duckdb.duckdb.typing.DuckDBPyType, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create an array type object of ‘type’

+
+
+ +
+
+duckdb.arrow(*args, **kwargs) +
+
+

Overloaded function.

+
    +
  1. arrow(rows_per_batch: int = 1000000, connection: duckdb.DuckDBPyConnection = None) -> pyarrow.lib.Table

  2. +
+

Fetch a result as Arrow table following execute()

+
    +
  1. arrow(arrow_object: object, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Create a relation object from an Arrow object

+
+
+ +
+
+duckdb.begin(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +
+
+

Start a new transaction

+
+
+ +
+
+duckdb.close(connection: duckdb.DuckDBPyConnection = None) None +
+
+

Close the connection

+
+
+ +
+
+duckdb.commit(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +
+
+

Commit changes performed within a transaction

+
+
+ +
+
+duckdb.connect(database: str = ':memory:', read_only: bool = False, config: dict = None) duckdb.DuckDBPyConnection +
+
+

Create a DuckDB database instance. Can take a database file name to read/write persistent data and a read_only flag if no changes are desired

+
+
+ +
+
+duckdb.create_function(name: str, function: function, return_type: object = None, parameters: duckdb.duckdb.typing.DuckDBPyType = None, *, type: duckdb.duckdb.functional.PythonUDFType = <PythonUDFType.NATIVE: 0>, null_handling: duckdb.duckdb.functional.FunctionNullHandling = 0, exception_handling: duckdb.duckdb.PythonExceptionHandling = 0, side_effects: bool = False, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +
+
+

Create a DuckDB function out of the passing in python function so it can be used in queries

+
+
+ +
+
+duckdb.cursor(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +
+
+

Create a duplicate of the current connection

+
+
+ +
+
+duckdb.decimal_type(width: int, scale: int, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create a decimal type with ‘width’ and ‘scale’

+
+
+ +
+
+duckdb.description(connection: duckdb.DuckDBPyConnection = None) Optional[list] +
+
+

Get result set attributes, mainly column names

+
+
+ +
+
+duckdb.df(*args, **kwargs) +
+
+

Overloaded function.

+
    +
  1. df(*, date_as_object: bool = False, connection: duckdb.DuckDBPyConnection = None) -> pandas.DataFrame

  2. +
+

Fetch a result as DataFrame following execute()

+
    +
  1. df(df: pandas.DataFrame, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Create a relation object from the DataFrame df

+
+
+ +
+
+duckdb.distinct(df: pandas.DataFrame, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Compute the distinct rows from DataFrame df

+
+
+ +
+
+duckdb.dtype(type_str: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create a type object from ‘type_str’

+
+
+ +
+
+duckdb.duplicate(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +
+
+

Create a duplicate of the current connection

+
+
+ +
+
+duckdb.enum_type(name: str, type: duckdb.duckdb.typing.DuckDBPyType, values: list, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create an enum type of underlying ‘type’, consisting of the list of ‘values’

+
+
+ +
+
+duckdb.execute(query: str, parameters: object = None, multiple_parameter_sets: bool = False, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +
+
+

Execute the given SQL query, optionally using prepared statements with parameters set

+
+
+ +
+
+duckdb.executemany(query: str, parameters: object = None, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +
+
+

Execute the given prepared statement multiple times using the list of parameter sets in parameters

+
+
+ +
+
+duckdb.fetch_arrow_table(rows_per_batch: int = 1000000, connection: duckdb.DuckDBPyConnection = None) pyarrow.lib.Table +
+
+

Fetch a result as Arrow table following execute()

+
+
+ +
+
+duckdb.fetch_df(*, date_as_object: bool = False, connection: duckdb.DuckDBPyConnection = None) pandas.DataFrame +
+
+

Fetch a result as DataFrame following execute()

+
+
+ +
+
+duckdb.fetch_df_chunk(vectors_per_chunk: int = 1, *, date_as_object: bool = False, connection: duckdb.DuckDBPyConnection = None) pandas.DataFrame +
+
+

Fetch a chunk of the result as DataFrame following execute()

+
+
+ +
+
+duckdb.fetch_record_batch(rows_per_batch: int = 1000000, connection: duckdb.DuckDBPyConnection = None) pyarrow.lib.RecordBatchReader +
+
+

Fetch an Arrow RecordBatchReader following execute()

+
+
+ +
+
+duckdb.fetchall(connection: duckdb.DuckDBPyConnection = None) list +
+
+

Fetch all rows from a result following execute

+
+
+ +
+
+duckdb.fetchdf(*, date_as_object: bool = False, connection: duckdb.DuckDBPyConnection = None) pandas.DataFrame +
+
+

Fetch a result as DataFrame following execute()

+
+
+ +
+
+duckdb.fetchmany(size: int = 1, connection: duckdb.DuckDBPyConnection = None) list +
+
+

Fetch the next set of rows from a result following execute

+
+
+ +
+
+duckdb.fetchnumpy(connection: duckdb.DuckDBPyConnection = None) dict +
+
+

Fetch a result as list of NumPy arrays following execute

+
+
+ +
+
+duckdb.fetchone(connection: duckdb.DuckDBPyConnection = None) Optional[tuple] +
+
+

Fetch a single row from a result following execute

+
+
+ +
+
+duckdb.filesystem_is_registered(name: str, connection: duckdb.DuckDBPyConnection = None) bool +
+
+

Check if a filesystem with the provided name is currently registered

+
+
+ +
+
+duckdb.filter(df: pandas.DataFrame, filter_expr: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Filter the DataFrame df by the filter in filter_expr

+
+
+ +
+
+duckdb.from_arrow(arrow_object: object, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Create a relation object from an Arrow object

+
+
+ +
+
+duckdb.from_csv_auto(name: object, connection: duckdb.DuckDBPyConnection = None, header: object = None, compression: object = None, sep: object = None, delimiter: object = None, dtype: object = None, na_values: object = None, skiprows: object = None, quotechar: object = None, escapechar: object = None, encoding: object = None, parallel: object = None, date_format: object = None, timestamp_format: object = None, sample_size: object = None, all_varchar: object = None, normalize_names: object = None, filename: object = None, null_padding: object = None, names: object = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Create a relation object from the CSV file in ‘name’

+
+
+ +
+
+duckdb.from_df(df: pandas.DataFrame, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Create a relation object from the DataFrame df

+
+
+ +
+
+duckdb.from_parquet(*args, **kwargs) +
+
+

Overloaded function.

+
    +
  1. from_parquet(file_glob: str, binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Create a relation object from the Parquet files in file_glob

+
    +
  1. from_parquet(file_globs: List[str], binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Create a relation object from the Parquet files in file_globs

+
+
+ +
+
+duckdb.from_query(query: str, alias: str = '', connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

+
+
+ +
+
+duckdb.from_substrait(*args, **kwargs) +
+
+

Overloaded function.

+
    +
  1. from_substrait(proto: bytes, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Creates a query object from the substrait plan

+
    +
  1. from_substrait(proto: bytes, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Create a query object from protobuf plan

+
+
+ +
+
+duckdb.from_substrait_json(json: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Serialize a query object to protobuf

+
+
+ +
+
+duckdb.get_substrait(*args, **kwargs) +
+
+

Overloaded function.

+
    +
  1. get_substrait(query: str, connection: duckdb.DuckDBPyConnection = None, *, enable_optimizer: bool = True) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Serialize a query object to protobuf

+
    +
  1. get_substrait(query: str, connection: duckdb.DuckDBPyConnection = None, *, enable_optimizer: bool = True) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Serialize a query to protobuf

+
+
+ +
+
+duckdb.get_substrait_json(*args, **kwargs) +
+
+

Overloaded function.

+
    +
  1. get_substrait_json(query: str, connection: duckdb.DuckDBPyConnection = None, *, enable_optimizer: bool = True) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Serialize a query object to protobuf

+
    +
  1. get_substrait_json(query: str, connection: duckdb.DuckDBPyConnection = None, *, enable_optimizer: bool = True) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Serialize a query to protobuf on the JSON format

+
+
+ +
+
+duckdb.get_table_names(query: str, connection: duckdb.DuckDBPyConnection = None) Set[str] +
+
+

Extract the required table names from a query

+
+
+ +
+
+duckdb.install_extension(extension: str, *, force_install: bool = False, connection: duckdb.DuckDBPyConnection = None) None +
+
+

Install an extension by name

+
+
+ +
+
+duckdb.interrupt(connection: duckdb.DuckDBPyConnection = None) None +
+
+

Interrupt pending operations

+
+
+ +
+
+duckdb.limit(df: pandas.DataFrame, n: int, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Retrieve the first n rows from the DataFrame df

+
+
+ +
+
+duckdb.list_filesystems(connection: duckdb.DuckDBPyConnection = None) list +
+
+

List registered filesystems, including builtin ones

+
+
+ +
+
+duckdb.list_type(type: duckdb.duckdb.typing.DuckDBPyType, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create an array type object of ‘type’

+
+
+ +
+
+duckdb.load_extension(extension: str, connection: duckdb.DuckDBPyConnection = None) None +
+
+

Load an installed extension

+
+
+ +
+
+duckdb.map_type(key: duckdb.duckdb.typing.DuckDBPyType, value: duckdb.duckdb.typing.DuckDBPyType, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create a map type object from ‘key_type’ and ‘value_type’

+
+
+ +
+
+duckdb.order(df: pandas.DataFrame, order_expr: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Reorder the DataFrame df by order_expr

+
+
+ +
+
+duckdb.pl(rows_per_batch: int = 1000000, connection: duckdb.DuckDBPyConnection = None) duckdb::PolarsDataFrame +
+
+

Fetch a result as Polars DataFrame following execute()

+
+
+ +
+
+duckdb.project(df: pandas.DataFrame, project_expr: object, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Project the DataFrame df by the projection in project_expr

+
+
+ +
+
+duckdb.query(query: str, alias: str = '', connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

+
+
+ +
-duckdb.query_df(df: pandas.DataFrame, virtual_table_name: str, sql_query: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyResult +duckdb.query_df(df: pandas.DataFrame, virtual_table_name: str, sql_query: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Run the given SQL query in sql_query on the view named virtual_table_name that contains the content of DataFrame df

+
+
+ +
+
+duckdb.read_csv(name: object, connection: duckdb.DuckDBPyConnection = None, header: object = None, compression: object = None, sep: object = None, delimiter: object = None, dtype: object = None, na_values: object = None, skiprows: object = None, quotechar: object = None, escapechar: object = None, encoding: object = None, parallel: object = None, date_format: object = None, timestamp_format: object = None, sample_size: object = None, all_varchar: object = None, normalize_names: object = None, filename: object = None, null_padding: object = None, names: object = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Create a relation object from the CSV file in ‘name’

+
+
+ +
+
+duckdb.read_json(name: str, connection: duckdb.DuckDBPyConnection = None, columns: Optional[object] = None, sample_size: Optional[object] = None, maximum_depth: Optional[object] = None, records: Optional[str] = None, format: Optional[str] = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Create a relation object from the JSON file in ‘name’

+
+
+ +
+
+duckdb.read_parquet(*args, **kwargs) +
+
+

Overloaded function.

+
    +
  1. read_parquet(file_glob: str, binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Create a relation object from the Parquet files in file_glob

+
    +
  1. read_parquet(file_globs: List[str], binary_as_string: bool = False, *, file_row_number: bool = False, filename: bool = False, hive_partitioning: bool = False, union_by_name: bool = False, compression: object = None, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Create a relation object from the Parquet files in file_globs

+
+
+ +
+
+duckdb.register(view_name: str, python_object: object, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +
+
+

Register the passed Python Object value for querying with a view

+
+
+ +
+
+duckdb.register_filesystem(filesystem: fsspec.AbstractFileSystem, connection: duckdb.DuckDBPyConnection = None) None +
+
+

Register a fsspec compliant filesystem

+
+
+ +
+
+duckdb.remove_function(name: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +
+
+

Remove a previously created function

+
+
+ +
+
+duckdb.rollback(connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +
+
+

Roll back changes performed within a transaction

+
+
+ +
+
+duckdb.row_type(fields: object, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create a struct type object from ‘fields’

+
+
+ +
+
+duckdb.rowcount(connection: duckdb.DuckDBPyConnection = None) int +
+
+

Get result set row count

+
+
+ +
+
+duckdb.sql(query: str, alias: str = '', connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Run a SQL query. If it is a SELECT statement, create a relation object from the given SQL query, otherwise run the query as-is.

+
+
+ +
+
+duckdb.sqltype(type_str: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create a type object from ‘type_str’

+
+
+ +
+
+duckdb.string_type(collation: str = '', connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create a string type with an optional collation

+
+
+ +
+
+duckdb.struct_type(fields: object, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType
-

Run the given SQL query in sql_query on the view named virtual_table_name that contains the content of Data.Frame df

+

Create a struct type object from ‘fields’

+
+
+ +
+
+duckdb.table(table_name: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Create a relation object for the name’d table

+
+
+ +
+
+duckdb.table_function(name: str, parameters: object = None, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Create a relation object from the name’d table function with given parameters

+
+
+ +
+
+duckdb.tf(connection: duckdb.DuckDBPyConnection = None) dict +
+
+

Fetch a result as dict of TensorFlow Tensors following execute()

-class duckdb.token_type +class duckdb.token_type

Bases: pybind11_object

@@ -1564,56 +3189,56 @@ title: Python Client API

comment

-comment = <token_type.comment: 5> +comment = <token_type.comment: 5>
-identifier = <token_type.identifier: 0> +identifier = <token_type.identifier: 0>
-keyword = <token_type.keyword: 4> +keyword = <token_type.keyword: 4>
-property name +property name
-numeric_const = <token_type.numeric_const: 1> +numeric_const = <token_type.numeric_const: 1>
-operator = <token_type.operator: 3> +operator = <token_type.operator: 3>
-string_const = <token_type.string_const: 2> +string_const = <token_type.string_const: 2>
-property value +property value
@@ -1623,28 +3248,90 @@ title: Python Client API
-duckdb.tokenize(query: str) object +duckdb.tokenize(query: str) list

Tokenizes a SQL string, returning a list of (position, type) tuples that can be used for e.g. syntax highlighting

+
+
+duckdb.torch(connection: duckdb.DuckDBPyConnection = None) dict +
+
+

Fetch a result as dict of PyTorch Tensors following execute()

+
+
+ +
+
+duckdb.type(type_str: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create a type object from ‘type_str’

+
+
+ +
+
+duckdb.union_type(members: object, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.typing.DuckDBPyType +
+
+

Create a union type object from ‘members’

+
+
+ +
+
+duckdb.unregister(view_name: str, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyConnection +
+
+

Unregister the view name

+
+
+ +
+
+duckdb.unregister_filesystem(name: str, connection: duckdb.DuckDBPyConnection = None) None +
+
+

Unregister a filesystem

+
+
+
-duckdb.values(values: object, connection: duckdb.DuckDBPyConnection = None) duckdb.DuckDBPyRelation +duckdb.values(*args, **kwargs)
+

Overloaded function.

+
    +
  1. values(values: object, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +
+

Create a relation object from the passed values

+
    +
  1. values(values: object, connection: duckdb.DuckDBPyConnection = None) -> duckdb.duckdb.DuckDBPyRelation

  2. +

Create a relation object from the passed values

+
+
+duckdb.view(view_name: str, connection: duckdb.DuckDBPyConnection = None) duckdb.duckdb.DuckDBPyRelation +
+
+

Create a relation object for the name’d view

+
+
+
-duckdb.write_csv(df: pandas.DataFrame, file_name: str, connection: duckdb.DuckDBPyConnection = None) None +duckdb.write_csv(df: pandas.DataFrame, file_name: str, connection: duckdb.DuckDBPyConnection = None) None
-

Write the Data.Frame df to a CSV file in file_name

+

Write the DataFrame df to a CSV file in file_name

diff --git a/docs/sql/configuration.md b/docs/sql/configuration.md index 0434eb96051..8a3a9259ac3 100644 --- a/docs/sql/configuration.md +++ b/docs/sql/configuration.md @@ -28,47 +28,70 @@ SELECT current_setting('access_mode'); Below is a list of all available settings. -| name | description | input_type | default_value | -|------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|------------|-----------------| -| Calendar | The current calendar | VARCHAR | GREGORIAN | -| TimeZone | The current time zone | VARCHAR | System timezone | -| access_mode | Access mode of the database (**AUTOMATIC**, **READ_ONLY** or **READ_WRITE**) | VARCHAR | AUTOMATIC | -| allow_unsigned_extensions | Allow to load extensions with invalid or missing signatures | BOOLEAN | FALSE | -| binary_as_string | In Parquet files, interpret binary data as a string. | BOOLEAN | | -| checkpoint_threshold, wal_autocheckpoint | The WAL size threshold at which to automatically trigger a checkpoint (e.g. 1GB) | VARCHAR | 16.7MB | -| default_collation | The collation setting used when none is specified | VARCHAR | | -| default_null_order, null_order | Null ordering used when none is specified (**NULLS_FIRST** or **NULLS_LAST**) | VARCHAR | NULLS_FIRST | -| default_order | The order type used when none is specified (**ASC** or **DESC**) | VARCHAR | ASC | -| enable_external_access | Allow the database to access external state (through e.g. loading/installing modules, COPY TO/FROM, CSV readers, pandas replacement scans, etc) | BOOLEAN | TRUE | -| enable_object_cache | Whether or not object cache is used to cache e.g. Parquet metadata | BOOLEAN | FALSE | -| enable_profiling | Enables profiling, and sets the output format (**JSON**, **QUERY_TREE**, **QUERY_TREE_OPTIMIZER**) | VARCHAR | NULL | -| enable_progress_bar | Enables the progress bar, printing progress to the terminal for long queries | BOOLEAN | FALSE | -| explain_output | Output of EXPLAIN statements (**ALL**, **OPTIMIZED_ONLY**, **PHYSICAL_ONLY**) | VARCHAR | PHYSICAL_ONLY | -| external_threads | The number of external threads that work on DuckDB tasks. | BIGINT | 0 | -| file_search_path | A comma separated list of directories to search for input files | VARCHAR | | -| home_directory | Sets the home directory used by the system | VARCHAR | | -| httpfs_timeout | HTTP timeout read/write/connection/retry (default 30000ms) | UBIGINT | | -| log_query_path | Specifies the path to which queries should be logged (default: empty string, queries are not logged) | VARCHAR | NULL | -| max_expression_depth | The maximum expression depth limit in the parser. WARNING: increasing this setting and using very deep expressions might lead to stack overflow errors. | UBIGINT | 1000 | -| max_memory, memory_limit | The maximum memory of the system (e.g. 1GB) | VARCHAR | 75% of RAM | -| perfect_ht_threshold | Threshold in bytes for when to use a perfect hash table (default: 12) | BIGINT | 12 | -| preserve_identifier_case | Whether or not to preserve the identifier case, instead of always lowercasing all non-quoted identifiers | BOOLEAN | TRUE | -| preserve_insertion_order | Whether or not to preserve insertion order. If set to false the system is allowed to re-order any results that do not contain ORDER BY clauses. | BOOLEAN | TRUE | -| profile_output, profiling_output | The file to which profile output should be saved, or empty to print to the terminal | VARCHAR | | -| profiler_history_size | Sets the profiler history size | BIGINT | NULL | -| profiling_mode | The profiling mode (**STANDARD** or **DETAILED**) | VARCHAR | NULL | -| progress_bar_time | Sets the time (in milliseconds) how long a query needs to take before we start printing a progress bar | BIGINT | 2000 | -| s3_access_key_id | S3 Access Key ID | VARCHAR | | -| s3_endpoint | S3 Endpoint (default 's3.amazonaws.com') | VARCHAR | | -| s3_region | S3 Region | VARCHAR | | -| s3_secret_access_key | S3 Access Key | VARCHAR | | -| s3_session_token | S3 Session Token | VARCHAR | | -| s3_uploader_max_filesize | S3 Uploader max filesize (between 50GB and 5TB, default 800GB) | VARCHAR | | -| s3_uploader_max_parts_per_file | S3 Uploader max parts per file (between 1 and 10000, default 10000) | UBIGINT | | -| s3_uploader_thread_limit | S3 Uploader global thread limit (default 50) | UBIGINT | | -| s3_url_style | S3 url style ('vhost' (default) or 'path') | VARCHAR | | -| s3_use_ssl | S3 use SSL (default true) | BOOLEAN | | -| schema | Sets the default search schema. Equivalent to setting search_path to a single value. | VARCHAR | | -| search_path | Sets the default search search path as a comma-separated list of values | VARCHAR | | -| temp_directory | Set the directory to which to write temp files | VARCHAR | | -| threads, worker_threads | The number of total threads used by the system. | BIGINT | # Cores | +| name | description | input_type | default_value | +|------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|------------|------------------| +| Calendar | The current calendar | VARCHAR | GREGORIAN | +| TimeZone | The current time zone | VARCHAR | System timezone | +| access_mode | Access mode of the database (**AUTOMATIC**, **READ_ONLY** or **READ_WRITE**) | VARCHAR | AUTOMATIC | +| allocator_flush_threshold | Peak allocation threshold at which to flush the allocator after completing a task. | VARCHAR | 134.2MB | +| allow_unsigned_extensions | Allow to load extensions with invalid or missing signatures | BOOLEAN | FALSE | +| arrow_large_buffer_size | If arrow buffers for strings, blobs, uuids and bits should be exported using large buffers | BOOLEAN | FALSE | +| binary_as_string | In Parquet files, interpret binary data as a string. | BOOLEAN | | +| checkpoint_threshold, wal_autocheckpoint | The WAL size threshold at which to automatically trigger a checkpoint (e.g. 1GB) | VARCHAR | 16.7MB | +| custom_extension_repository | Overrides the custom endpoint for remote extension installation | VARCHAR | | +| default_collation | The collation setting used when none is specified | VARCHAR | | +| default_null_order, null_order | Null ordering used when none is specified (**NULLS_FIRST** or **NULLS_LAST**) | VARCHAR | NULLS_LAST | +| default_order | The order type used when none is specified (**ASC** or **DESC**) | VARCHAR | ASC | +| disabled_filesystems | Disable specific file systems preventing access (e.g. LocalFileSystem) | VARCHAR | | +| enable_external_access | Allow the database to access external state (through e.g. loading/installing modules, COPY TO/FROM, CSV readers, pandas replacement scans, etc) | BOOLEAN | TRUE | +| enable_fsst_vectors | Allow scans on FSST compressed segments to emit compressed vectors to utilize late decompression | BOOLEAN | FALSE | +| enable_http_metadata_cache | Whether or not the global http metadata is used to cache HTTP metadata | BOOLEAN | FALSE | +| enable_object_cache | Whether or not object cache is used to cache e.g. Parquet metadata | BOOLEAN | FALSE | +| enable_profiling | Enables profiling, and sets the output format (**JSON**, **QUERY_TREE**, **QUERY_TREE_OPTIMIZER**) | VARCHAR | NULL | +| enable_progress_bar | Enables the progress bar, printing progress to the terminal for long queries | BOOLEAN | FALSE | +| enable_progress_bar_print | Controls the printing of the progress bar, when 'enable_progress_bar' is true | BOOLEAN | TRUE | +| experimental_parallel_csv | Whether or not to use the experimental parallel CSV reader | BOOLEAN | NULL | +| explain_output | Output of EXPLAIN statements (**ALL**, **OPTIMIZED_ONLY**, **PHYSICAL_ONLY**) | VARCHAR | PHYSICAL_ONLY | +| extension_directory | Set the directory to store extensions in | VARCHAR | | +| external_threads | The number of external threads that work on DuckDB tasks. | BIGINT | 0 | +| file_search_path | A comma separated list of directories to search for input files | VARCHAR | | +| force_download | Forces upfront download of file | BOOLEAN | 0 | +| home_directory | Sets the home directory used by the system | VARCHAR | | +| http_retries | HTTP retries on I/O error (default 3) | UBIGINT | 3 | +| http_retry_backoff | Backoff factor for exponentially increasing retry wait time (default 4) | FLOAT | 4 | +| http_retry_wait_ms | Time between retries (default 100ms) | UBIGINT | 100 | +| http_timeout | HTTP timeout read/write/connection/retry (default 30000ms) | UBIGINT | 30000 | +| immediate_transaction_mode | Whether transactions should be started lazily when needed, or immediately when BEGIN TRANSACTION is called | BOOLEAN | FALSE | +| integer_division | Whether or not the / operator defaults to integer division, or to floating point division | BOOLEAN | 0 | +| lock_configuration | Whether or not the configuration can be altered | BOOLEAN | FALSE | +| log_query_path | Specifies the path to which queries should be logged (default: empty string, queries are not logged) | VARCHAR | NULL | +| max_expression_depth | The maximum expression depth limit in the parser. WARNING: increasing this setting and using very deep expressions might lead to stack overflow errors. | UBIGINT | 1000 | +| max_memory, memory_limit | The maximum memory of the system (e.g. 1GB) | VARCHAR | 75% of RAM | +| ordered_aggregate_threshold | the number of rows to accumulate before sorting, used for tuning | UBIGINT | 262144 | +| password | The password to use. Ignored for legacy compatibility. | VARCHAR | NULL | +| perfect_ht_threshold | Threshold in bytes for when to use a perfect hash table (default: 12) | BIGINT | 12 | +| pivot_filter_threshold | The threshold to switch from using filtered aggregates to LIST with a dedicated pivot operator | BIGINT | 10 | +| pivot_limit | The maximum number of pivot columns in a pivot statement (default: 100000) | BIGINT | 100000 | +| prefer_range_joins | Force use of range joins with mixed predicates | BOOLEAN | FALSE | +| preserve_identifier_case | Whether or not to preserve the identifier case, instead of always lowercasing all non-quoted identifiers | BOOLEAN | TRUE | +| preserve_insertion_order | Whether or not to preserve insertion order. If set to false the system is allowed to re-order any results that do not contain ORDER BY clauses. | BOOLEAN | TRUE | +| profile_output, profiling_output | The file to which profile output should be saved, or empty to print to the terminal | VARCHAR | | +| profiler_history_size | Sets the profiler history size | BIGINT | NULL | +| profiling_mode | The profiling mode (**STANDARD** or **DETAILED**) | VARCHAR | NULL | +| progress_bar_time | Sets the time (in milliseconds) how long a query needs to take before we start printing a progress bar | BIGINT | 2000 | +| s3_access_key_id | S3 Access Key ID | VARCHAR | | +| s3_endpoint | S3 Endpoint (default 's3.amazonaws.com') | VARCHAR | S3.AMAZONAWS.COM | +| s3_region | S3 Region | VARCHAR | | +| s3_secret_access_key | S3 Access Key | VARCHAR | | +| s3_session_token | S3 Session Token | VARCHAR | | +| s3_uploader_max_filesize | S3 Uploader max filesize (between 50GB and 5TB, default 800GB) | VARCHAR | 800GB | +| s3_uploader_max_parts_per_file | S3 Uploader max parts per file (between 1 and 10000, default 10000) | UBIGINT | 10000 | +| s3_uploader_thread_limit | S3 Uploader global thread limit (default 50) | UBIGINT | 50 | +| s3_url_compatibility_mode | Disable Globs and Query Parameters on S3 urls | BOOLEAN | 0 | +| s3_url_style | S3 url style ('vhost' (default) or 'path') | VARCHAR | VHOST | +| s3_use_ssl | S3 use SSL (default true) | BOOLEAN | 1 | +| schema | Sets the default search schema. Equivalent to setting search_path to a single value. | VARCHAR | MAIN | +| search_path | Sets the default search search path as a comma-separated list of values | VARCHAR | | +| temp_directory | Set the directory to which to write temp files | VARCHAR | | +| threads, worker_threads | The number of total threads used by the system. | BIGINT | # Cores | +| username, user | The username to use. Ignored for legacy compatibility. | VARCHAR | NULL |