API Reference#
Classes
- pyexasol.connect(**kwargs) ExaConnection[source]#
Create a new connection object.
- Parameters:
**kwargs – For details, refer to the
pyexasol.ExaConnectionclass.
- pyexasol.connect_local_config(config_section, config_path=None, **kwargs) ExaConnection[source]#
Constructor for connection objects based on a local config file.
- Info:
The default config path is ~/.pyexasol.ini
Extra arguments override values from config
- Parameters:
config_section – Name of config section (required!)
config_path – Custom path to local config file
kwargs – Arguments for “connect()” function
- pyexasol.http_transport(ipaddr, port, compression=False, encryption=True) ExaHTTPTransportWrapper[source]#
Constructor for HTTP Transport wrapper for parallel HTTP Transport (EXPORT or IMPORT)
- Parameters:
ipaddr – IP address of one of Exasol nodes received from
pyexasol.ExaConnection.get_nodes()port – Port of one of Exasol nodes received from
pyexasol.ExaConnection.get_nodes()compression – Use zlib compression for HTTP transport, must be the same as compression of main connection
encryption – Use SSL/TLS encryption for HTTP transport, must be the same as encryption of main connection
- Info:
Compression and encryption arguments should match
pyexasol.connect()How to use:
Parent process opens main connection to Exasol with pyexasol.connect()
Parent process creates any number of child processes (possibly on remote host or another container)
Every child process starts HTTP transport sub-connection with pyexasol.http_transport()
and gets “ipaddr:port” string using ExaHTTPTransportWrapper.address
Every child process sends address string to parent process using any communication method (Pipe, Queue, Redis, etc.)
Parent process runs .export_parallel() or .import_parallel(), which initiates EXPORT or IMPORT query in Exasol
Every child process receives or sends a chunk of data using ExaHTTPTransportWrapper.export_*() or .import_*()
Parent process waits for Exasol query and for child processes to finish
All child processes should run in parallel. It is NOT possible to process some data first, and process some more data later.
If an exception is raised in child process, it will close the pipe used for HTTP transport. Closing the pipe prematurely will cause SQL query to fail and will raise an exception in parent process. Parent process is responsible for closing other child processes and cleaning up.
PyExasol does not provide a complete solution to manage child processes, only examples. The final solution depends on your hardware, network configuration, cloud provider and container orchestration software.