Exasol Parameters#

Please refer to the Exasol User Manual to learn more about:

export_params#

These parameters are given as a dictionary, like export_params = { "name1": "value1", "name2": ["value2", "value3"]}. This dictionary is passed into the Variants for a selected export_to_* method. When the code is executed, these are validated using the pyexasol.query_builders.csv.builders.ExportBuilder.

Note

pyexasol.http_transport.ExportQuery is deprecated. Use ExportBuilder instead.

Name

Sample value

Description

boolean

BooleanRepresentation.NUMERIC

Representation of boolean values, see Available values below.

column_delimiter

'"'

Column delimiter for CSV (quoting)

column_separator

","

Column separator for CSV

columns

["id", "name"]

List of table columns, useful to reorder table columns during export from table

comment

"This is a query description"

Add a comment before the beginning of the query. See Comment.

csv_cols

["1..5", "6 FORMAT='999.99'", "8"]

List of CSV columns with optional numeric or date formats

delimit

Delimit.AUTO

Mode for delimiting single values, see Available values below.

encoding

"UTF8"

File encoding

format

FileFormat.GZ

Format to use when exporting the file or stream, see Available values below.

null

"\x00"

Custom NULL value

row_separator

"LF"

Row separator for CSV (line-endings)

with_column_names

True

Add column names as the first line, which may be useful for external APIs (e.g. pandas). The default value for this is False, except for export_to_pandas, export_to_parquet, and export_to_polars where it is set to True.

import_params#

These parameters are given as a dictionary, like import_params = { "name1": "value1", "name2": ["value2", "value3"]}. This dictionary is passed into the Variants for a selected import_from_* method. When the code is executed, these are validated using the pyexasol.query_builders.csv.builders.ImportBuilder.

Note

pyexasol.http_transport.ImportQuery is deprecated. Use ImportBuilder instead.

Name

Sample value

Description

column_delimiter

'"'

Column delimiter for CSV (quoting)

column_separator

","

Column separator for CSV

columns

["id", "name"]

List of table columns in the data source, useful if the column order of data source does not match the column order of Exasol table

comment

"This is a query description"

Add a comment before the beginning of the query. See Comment.

csv_cols

["1..5", "6 FORMAT='999.99'", "8"]

List of CSV columns with optional numeric or date formats

encoding

"UTF8"

File encoding

format

FileFormat.GZ

Format to assume when importing the file or stream, see Available values below.

null

"\x00"

Custom NULL value

row_separator

"CRLF"

Row separator for CSV (line-endings). PyExasol sends no ROW SEPARATOR clause unless you set this, so the database default of LF applies. Set "CRLF" only if you supply CSV with CRLF line endings, for example to import_from_file, see the import note.

skip

1

How many first rows to skip, useful for skipping header

trim

Trim.TRIM

Trim mode, see Available values below.

Available values#

Some parameters support an enumeration of specific values.

Available values for representing boolean values#
class BooleanRepresentation(enum.StrEnum):
    NUMERIC = "1/0"
    TRUE_FALSE_UPPER_CASE = "TRUE/FALSE"
    TRUE_FALSE_LOWER_CASE = "true/false"
    TRUE_FALSE_CAPITALIZED = "True/False"
    T_F_UPPER_CASE = "T/F"
    T_F_LOWER_CASE = "t/f"
    Y_N_LOWER_CASE = "y/n"
    Y_N_UPPER_CASE = "Y/N"
    YES_NO_LOWER_CASE = "yes/no"
    YES_NO_CAPITALIZED = "Yes/No"
    YES_NO_UPPER_CASE = "YES/NO"
Available values for delimiters#
class Delimit(StringEnum):
    AUTO = "AUTO"
    ALWAYS = "ALWAYS"
    NEVER = "NEVER"
Available values for file formats#
class FileFormat(StringEnum):
    BZ2 = "bz2"
    CSV = "csv"
    GZ = "gz"
    ZIP = "zip"
Available values for trimming values#
class Trim(StringEnum):
    TRIM = "TRIM"
    LTRIM = "LTRIM"
    RTRIM = "RTRIM"

Comment#

For any export_* or import_* call, you can add a comment that will be inserted before the beginning of the query.

This can be used for profiling and auditing. Example:

connection.import_from_file(
    "/test/my_file.csv",
    "users",
    import_params={
        "comment": (
            "This comment will be inserted before the query. "
            "This query is importing users from CSV."
        )
    }
)

The comment is inserted as a block comment (/* <comment> */). The block comment closing sequence (*/) must not be used inside the comment.