Exasol Parameters#
The export_params, are defined for all
export_to_*Variants to generate theEXPORTstatement.The import_params are defined for all
import_from_*Variants to generate theIMPORTstatement.
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.http_transport.ExportQuery.
Name |
Sample value |
Description |
|---|---|---|
|
|
Representation of boolean values, see Available values below. |
|
|
Column delimiter for CSV (quoting) |
|
|
Column separator for CSV |
|
|
List of table columns, useful to reorder table columns during export from table |
|
|
Add a comment before the beginning of the query. See Comment. |
|
|
|
|
|
Mode for delimiting single values, see Available values below. |
|
|
File encoding |
|
|
Format to use when exporting the file or stream, see Available values below. |
|
|
Custom NULL value |
|
|
Row separator for CSV (line-endings) |
|
|
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 |
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.http_transport.ImportQuery.
Name |
Sample value |
Description |
|---|---|---|
|
|
Column delimiter for CSV (quoting) |
|
|
Column separator for CSV |
|
|
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 |
|
|
Add a comment before the beginning of the query. See Comment. |
|
|
|
|
|
File encoding |
|
|
Format to assume when importing the file or stream, see Available values below. |
|
|
Custom NULL value |
|
|
Row separator for CSV (line-endings) |
|
|
How many first rows to skip, useful for skipping header |
|
|
Trim mode, see Available values below. |
Available values#
Some parameters support an enumeration of specific 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"
class Delimit(StringEnum):
AUTO = "AUTO"
ALWAYS = "ALWAYS"
NEVER = "NEVER"
class FileFormat(StringEnum):
BZ2 = "bz2"
CSV = "csv"
GZ = "gz"
ZIP = "zip"
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.