pyexasol 2.3.2__tar.gz → 2.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyexasol-2.3.2 → pyexasol-2.4.0}/PKG-INFO +3 -2
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/callback.py +6 -5
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/connection.py +127 -38
- pyexasol-2.4.0/pyexasol/database_versions.py +51 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/ext.py +6 -1
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/http_transport.py +84 -244
- pyexasol-2.4.0/pyexasol/query_builders/base_builder.py +51 -0
- pyexasol-2.4.0/pyexasol/query_builders/common_formattings.py +185 -0
- pyexasol-2.4.0/pyexasol/query_builders/csv/__init__.py +22 -0
- pyexasol-2.4.0/pyexasol/query_builders/csv/builders.py +261 -0
- pyexasol-2.4.0/pyexasol/query_builders/csv/clause_formatter.py +160 -0
- pyexasol-2.4.0/pyexasol/query_builders/parquet/__init__.py +9 -0
- pyexasol-2.4.0/pyexasol/query_builders/parquet/builders.py +128 -0
- pyexasol-2.4.0/pyexasol/query_builders/parquet/clause_formatter.py +34 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyproject.toml +7 -2
- {pyexasol-2.3.2 → pyexasol-2.4.0}/LICENSE.txt +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/README.md +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/exasol/driver/__init__.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/exasol/driver/websocket/__init__.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/exasol/driver/websocket/_connection.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/exasol/driver/websocket/_cursor.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/exasol/driver/websocket/_errors.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/exasol/driver/websocket/_protocols.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/exasol/driver/websocket/_types.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/exasol/driver/websocket/dbapi2.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/__init__.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/__main__.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/_metadata.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/_sql_splitter.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/constant.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/db2/__init__.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/exceptions.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/formatter.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/local_config.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/logger.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/mapper.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/meta.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/py.typed +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/script_output.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/statement.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol/warnings.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol_utils/__init__.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol_utils/bench.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol_utils/bench_sql/prepare.sql +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol_utils/bench_sql/t1_group_by.sql +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol_utils/bench_sql/t2_local_join.sql +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol_utils/bench_sql/t3_global_join.sql +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol_utils/bench_sql/t4_sort.sql +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol_utils/docker_util.py +0 -0
- {pyexasol-2.3.2 → pyexasol-2.4.0}/pyexasol_utils/script_output.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyexasol
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: Exasol python driver with extra features
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
License-File: LICENSE.txt
|
|
@@ -39,12 +39,13 @@ Requires-Dist: pproxy ; extra == "all"
|
|
|
39
39
|
Requires-Dist: pproxy ; extra == "examples"
|
|
40
40
|
Requires-Dist: pyarrow (>=21.0.0) ; extra == "all"
|
|
41
41
|
Requires-Dist: pyarrow (>=21.0.0) ; extra == "pyarrow"
|
|
42
|
+
Requires-Dist: pydantic (>=2.13.4,<3.0.0)
|
|
42
43
|
Requires-Dist: pytest-benchmark[histogram] (>=5.1.0,<6) ; extra == "performance"
|
|
43
44
|
Requires-Dist: python-rapidjson (>=1.21.0,<2.0.0) ; extra == "all"
|
|
44
45
|
Requires-Dist: python-rapidjson (>=1.21.0,<2.0.0) ; extra == "rapidjson"
|
|
45
46
|
Requires-Dist: ujson (>=5.10.0,<6.0.0) ; extra == "all"
|
|
46
47
|
Requires-Dist: ujson (>=5.10.0,<6.0.0) ; extra == "ujson"
|
|
47
|
-
Requires-Dist: websocket-client (>=1.0.1
|
|
48
|
+
Requires-Dist: websocket-client (>=1.0.1,<=1.9.0)
|
|
48
49
|
Project-URL: Changelog, https://exasol.github.io/pyexasol/master/changes/changelog.html
|
|
49
50
|
Project-URL: Documentation, https://github.com/exasol/pyexasol/
|
|
50
51
|
Project-URL: Homepage, https://www.exasol.com/
|
|
@@ -240,11 +240,12 @@ def import_from_parquet(
|
|
|
240
240
|
|
|
241
241
|
Args:
|
|
242
242
|
source: Local filepath specification(s) to process. Can be one of:
|
|
243
|
-
|
|
244
|
-
- pathlib.Path
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
|
|
244
|
+
- ``list[pathlib.Path]``: list of specific files
|
|
245
|
+
- ``pathlib.Path``: can be either a file or directory. If it is a directory,
|
|
246
|
+
all files matching the following pattern ``*.parquet`` will be processed.
|
|
247
|
+
- ``str``: representing a filepath which already contains a glob pattern
|
|
248
|
+
(e.g., ``/local_dir/*.parquet``)
|
|
248
249
|
**kwargs:
|
|
249
250
|
Custom params for :func:`pyarrow.parquet.ParquetFile.iter_batches`. This can be used
|
|
250
251
|
to specify what columns should be read and their preferred order.
|
|
@@ -34,7 +34,10 @@ from cryptography.hazmat.primitives.asymmetric import padding
|
|
|
34
34
|
from packaging.version import Version
|
|
35
35
|
|
|
36
36
|
from . import callback as cb
|
|
37
|
-
from . import
|
|
37
|
+
from . import (
|
|
38
|
+
constant,
|
|
39
|
+
database_versions,
|
|
40
|
+
)
|
|
38
41
|
from ._metadata import __version__
|
|
39
42
|
from ._sql_splitter import split_sql_script
|
|
40
43
|
from .exceptions import (
|
|
@@ -57,9 +60,14 @@ from .http_transport import (
|
|
|
57
60
|
ExaHttpThread,
|
|
58
61
|
ExaSQLExportThread,
|
|
59
62
|
ExaSQLImportThread,
|
|
63
|
+
ExaSQLThread,
|
|
60
64
|
)
|
|
61
65
|
from .logger import ExaLogger
|
|
62
66
|
from .meta import ExaMetaData
|
|
67
|
+
from .query_builders.csv.builders import (
|
|
68
|
+
ExportBuilder,
|
|
69
|
+
ImportBuilder,
|
|
70
|
+
)
|
|
63
71
|
from .script_output import ExaScriptOutputProcess
|
|
64
72
|
from .statement import ExaStatement
|
|
65
73
|
from .warnings import PyexasolWarning
|
|
@@ -492,7 +500,7 @@ class ExaConnection:
|
|
|
492
500
|
def export_to_file(
|
|
493
501
|
self,
|
|
494
502
|
dst,
|
|
495
|
-
query_or_table: str,
|
|
503
|
+
query_or_table: str | tuple[str, ...],
|
|
496
504
|
query_params: dict | None = None,
|
|
497
505
|
export_params: dict | None = None,
|
|
498
506
|
):
|
|
@@ -506,7 +514,13 @@ class ExaConnection:
|
|
|
506
514
|
dst:
|
|
507
515
|
Path to file or file-like object where data will be exported to.
|
|
508
516
|
query_or_table:
|
|
509
|
-
|
|
517
|
+
Source from which to export data. Can be one of:
|
|
518
|
+
|
|
519
|
+
- ``tuple[str, ...]``: fully qualified table identifier, such as
|
|
520
|
+
``("SCHEMA", "TABLE")``. Quoted table names must be fully qualified
|
|
521
|
+
using this tuple pattern.
|
|
522
|
+
- ``str``: if lacks non-trailing space, it is treated like a
|
|
523
|
+
table identifier. Otherwise, it is treated like a query.
|
|
510
524
|
query_params:
|
|
511
525
|
Values for SQL query placeholders.
|
|
512
526
|
export_params:
|
|
@@ -526,7 +540,7 @@ class ExaConnection:
|
|
|
526
540
|
|
|
527
541
|
def export_to_list(
|
|
528
542
|
self,
|
|
529
|
-
query_or_table: str,
|
|
543
|
+
query_or_table: str | tuple[str, ...],
|
|
530
544
|
query_params: dict | None = None,
|
|
531
545
|
export_params: dict | None = None,
|
|
532
546
|
) -> list:
|
|
@@ -535,7 +549,13 @@ class ExaConnection:
|
|
|
535
549
|
|
|
536
550
|
Args:
|
|
537
551
|
query_or_table:
|
|
538
|
-
|
|
552
|
+
Source from which to export data. Can be one of:
|
|
553
|
+
|
|
554
|
+
- ``tuple[str, ...]``: fully qualified table identifier, such as
|
|
555
|
+
``("SCHEMA", "TABLE")``. Quoted table names must be fully qualified
|
|
556
|
+
using this tuple pattern.
|
|
557
|
+
- ``str``: if lacks non-trailing space, it is treated like a
|
|
558
|
+
table identifier. Otherwise, it is treated like a query.
|
|
539
559
|
query_params:
|
|
540
560
|
Values for SQL query placeholders.
|
|
541
561
|
export_params:
|
|
@@ -559,7 +579,7 @@ class ExaConnection:
|
|
|
559
579
|
|
|
560
580
|
def export_to_pandas(
|
|
561
581
|
self,
|
|
562
|
-
query_or_table: str,
|
|
582
|
+
query_or_table: str | tuple[str, ...],
|
|
563
583
|
query_params: dict | None = None,
|
|
564
584
|
callback_params: dict | None = None,
|
|
565
585
|
export_params: dict | None = None,
|
|
@@ -569,7 +589,13 @@ class ExaConnection:
|
|
|
569
589
|
|
|
570
590
|
Args:
|
|
571
591
|
query_or_table:
|
|
572
|
-
|
|
592
|
+
Source from which to export data. Can be one of:
|
|
593
|
+
|
|
594
|
+
- ``tuple[str, ...]``: fully qualified table identifier, such as
|
|
595
|
+
``("SCHEMA", "TABLE")``. Quoted table names must be fully qualified
|
|
596
|
+
using this tuple pattern.
|
|
597
|
+
- ``str``: if lacks non-trailing space, it is treated like a
|
|
598
|
+
table identifier. Otherwise, it is treated like a query.
|
|
573
599
|
query_params:
|
|
574
600
|
Values for SQL query placeholders.
|
|
575
601
|
callback_params:
|
|
@@ -607,7 +633,7 @@ class ExaConnection:
|
|
|
607
633
|
def export_to_parquet(
|
|
608
634
|
self,
|
|
609
635
|
dst: Path | str,
|
|
610
|
-
query_or_table: str,
|
|
636
|
+
query_or_table: str | tuple[str, ...],
|
|
611
637
|
query_params: dict | None = None,
|
|
612
638
|
callback_params: dict | None = None,
|
|
613
639
|
export_params: dict | None = None,
|
|
@@ -639,7 +665,13 @@ class ExaConnection:
|
|
|
639
665
|
discussed on `Importing and Exporting Data <https://exasol.github.io/pyexasol/master/user_guide/exploring_features/import_and_export/index.html>`__.
|
|
640
666
|
|
|
641
667
|
query_or_table:
|
|
642
|
-
|
|
668
|
+
Source from which to export data. Can be one of:
|
|
669
|
+
|
|
670
|
+
- ``tuple[str, ...]``: fully qualified table identifier, such as
|
|
671
|
+
``("SCHEMA", "TABLE")``. Quoted table names must be fully qualified
|
|
672
|
+
using this tuple pattern.
|
|
673
|
+
- ``str``: if lacks non-trailing space, it is treated like a
|
|
674
|
+
table identifier. Otherwise, it is treated like a query.
|
|
643
675
|
query_params:
|
|
644
676
|
Values for SQL query placeholders.
|
|
645
677
|
callback_params:
|
|
@@ -681,7 +713,7 @@ class ExaConnection:
|
|
|
681
713
|
|
|
682
714
|
def export_to_polars(
|
|
683
715
|
self,
|
|
684
|
-
query_or_table: str,
|
|
716
|
+
query_or_table: str | tuple[str, ...],
|
|
685
717
|
query_params: dict | None = None,
|
|
686
718
|
callback_params: dict | None = None,
|
|
687
719
|
export_params: dict | None = None,
|
|
@@ -691,7 +723,13 @@ class ExaConnection:
|
|
|
691
723
|
|
|
692
724
|
Args:
|
|
693
725
|
query_or_table:
|
|
694
|
-
|
|
726
|
+
Source from which to export data. Can be one of:
|
|
727
|
+
|
|
728
|
+
- ``tuple[str, ...]``: fully qualified table identifier, such as
|
|
729
|
+
``("SCHEMA", "TABLE")``. Quoted table names must be fully qualified
|
|
730
|
+
using this tuple pattern.
|
|
731
|
+
- ``str``: if lacks non-trailing space, it is treated like a
|
|
732
|
+
table identifier. Otherwise, it is treated like a query.
|
|
695
733
|
query_params:
|
|
696
734
|
Values for SQL query placeholders.
|
|
697
735
|
callback_params:
|
|
@@ -726,7 +764,12 @@ class ExaConnection:
|
|
|
726
764
|
export_params,
|
|
727
765
|
)
|
|
728
766
|
|
|
729
|
-
def import_from_file(
|
|
767
|
+
def import_from_file(
|
|
768
|
+
self,
|
|
769
|
+
src,
|
|
770
|
+
table: str | tuple[str, ...],
|
|
771
|
+
import_params: dict | None = None,
|
|
772
|
+
):
|
|
730
773
|
"""
|
|
731
774
|
Import a large amount of data from a file or file-like object.
|
|
732
775
|
|
|
@@ -734,7 +777,11 @@ class ExaConnection:
|
|
|
734
777
|
src:
|
|
735
778
|
Source file or file-like object.
|
|
736
779
|
table:
|
|
737
|
-
Destination table for IMPORT.
|
|
780
|
+
Destination table for IMPORT. Can be one of:
|
|
781
|
+
|
|
782
|
+
- ``str``: table identifier.
|
|
783
|
+
- ``tuple[str, ...]``: schema-qualified table identifier, such as
|
|
784
|
+
``("SCHEMA", "TABLE")``.
|
|
738
785
|
import_params:
|
|
739
786
|
Custom parameters for IMPORT query.
|
|
740
787
|
|
|
@@ -746,7 +793,10 @@ class ExaConnection:
|
|
|
746
793
|
)
|
|
747
794
|
|
|
748
795
|
def import_from_iterable(
|
|
749
|
-
self,
|
|
796
|
+
self,
|
|
797
|
+
src: Iterable,
|
|
798
|
+
table: str | tuple[str, ...],
|
|
799
|
+
import_params: dict | None = None,
|
|
750
800
|
):
|
|
751
801
|
"""
|
|
752
802
|
Import a large amount of data from an ``iterable`` Python object.
|
|
@@ -756,7 +806,11 @@ class ExaConnection:
|
|
|
756
806
|
Source object implementing ``__iter__``.
|
|
757
807
|
Iterator must return tuples of values.
|
|
758
808
|
table:
|
|
759
|
-
Destination table for IMPORT.
|
|
809
|
+
Destination table for IMPORT. Can be one of:
|
|
810
|
+
|
|
811
|
+
- ``str``: table identifier.
|
|
812
|
+
- ``tuple[str, ...]``: schema-qualified table identifier, such as
|
|
813
|
+
``("SCHEMA", "TABLE")``.
|
|
760
814
|
import_params:
|
|
761
815
|
Custom parameters for IMPORT query.
|
|
762
816
|
"""
|
|
@@ -767,7 +821,7 @@ class ExaConnection:
|
|
|
767
821
|
def import_from_pandas(
|
|
768
822
|
self,
|
|
769
823
|
src: "pandas.DataFrame",
|
|
770
|
-
table: str,
|
|
824
|
+
table: str | tuple[str, ...],
|
|
771
825
|
callback_params: dict | None = None,
|
|
772
826
|
import_params: dict | None = None,
|
|
773
827
|
):
|
|
@@ -778,7 +832,11 @@ class ExaConnection:
|
|
|
778
832
|
src:
|
|
779
833
|
Source :class:`pandas.DataFrame` instance.
|
|
780
834
|
table:
|
|
781
|
-
Destination table for IMPORT.
|
|
835
|
+
Destination table for IMPORT. Can be one of:
|
|
836
|
+
|
|
837
|
+
- ``str``: table identifier.
|
|
838
|
+
- ``tuple[str, ...]``: schema-qualified table identifier, such as
|
|
839
|
+
``("SCHEMA", "TABLE")``.
|
|
782
840
|
callback_params:
|
|
783
841
|
Dictionary with additional parameters for callback function
|
|
784
842
|
`pandas.DataFrame.to_csv <https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_csv.html>`__.
|
|
@@ -792,7 +850,7 @@ class ExaConnection:
|
|
|
792
850
|
def import_from_polars(
|
|
793
851
|
self,
|
|
794
852
|
src: Union["polars.LazyFrame", "polars.DataFrame"],
|
|
795
|
-
table: str,
|
|
853
|
+
table: str | tuple[str, ...],
|
|
796
854
|
callback_params: dict | None = None,
|
|
797
855
|
import_params: dict | None = None,
|
|
798
856
|
):
|
|
@@ -803,7 +861,11 @@ class ExaConnection:
|
|
|
803
861
|
src:
|
|
804
862
|
Source :class:`polars.DataFrame` or :class:`polars.LazyFrame` instance.
|
|
805
863
|
table:
|
|
806
|
-
Destination table for IMPORT.
|
|
864
|
+
Destination table for IMPORT. Can be one of:
|
|
865
|
+
|
|
866
|
+
- ``str``: table identifier.
|
|
867
|
+
- ``tuple[str, ...]``: schema-qualified table identifier, such as
|
|
868
|
+
``("SCHEMA", "TABLE")``.
|
|
807
869
|
callback_params:
|
|
808
870
|
Dictionary with additional parameters for callback function
|
|
809
871
|
`polars.DataFrame.write_csv <https://docs.pola.rs/api/python/stable/reference/api/polars.DataFrame.write_csv.html>`__.
|
|
@@ -817,7 +879,7 @@ class ExaConnection:
|
|
|
817
879
|
def import_from_parquet(
|
|
818
880
|
self,
|
|
819
881
|
source: list[Path] | Path | str,
|
|
820
|
-
table: str,
|
|
882
|
+
table: str | tuple[str, ...],
|
|
821
883
|
callback_params: dict | None = None,
|
|
822
884
|
import_params: dict | None = None,
|
|
823
885
|
):
|
|
@@ -826,13 +888,18 @@ class ExaConnection:
|
|
|
826
888
|
|
|
827
889
|
Args:
|
|
828
890
|
source: Local filepath specification(s) to process. Can be one of:
|
|
829
|
-
|
|
830
|
-
- pathlib.Path
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
891
|
+
|
|
892
|
+
- ``list[pathlib.Path]``: list of specific files
|
|
893
|
+
- ``pathlib.Path``: can be either a file or directory. If it's a directory,
|
|
894
|
+
all files matching this pattern ``*.parquet`` will be processed.
|
|
895
|
+
- ``str``: representing a filepath which already contains a glob pattern
|
|
896
|
+
(e.g., ``/local_dir/*.parquet``)
|
|
834
897
|
table:
|
|
835
|
-
Destination table for IMPORT.
|
|
898
|
+
Destination table for IMPORT. Can be one of:
|
|
899
|
+
|
|
900
|
+
- ``str``: table identifier.
|
|
901
|
+
- ``tuple[str, ...]``: schema-qualified table identifier, such as
|
|
902
|
+
``("SCHEMA", "TABLE")``.
|
|
836
903
|
callback_params:
|
|
837
904
|
Dict with additional parameters for callback function
|
|
838
905
|
`parquet.ParquetFile.iter_batches <https://arrow.apache.org/docs/python/generated/pyarrow.parquet.ParquetFile.html#pyarrow.parquet.ParquetFile.iter_batches>`__.
|
|
@@ -847,7 +914,7 @@ class ExaConnection:
|
|
|
847
914
|
self,
|
|
848
915
|
callback: Callable,
|
|
849
916
|
dst,
|
|
850
|
-
query_or_table: str,
|
|
917
|
+
query_or_table: str | tuple[str, ...],
|
|
851
918
|
query_params: dict | None = None,
|
|
852
919
|
callback_params: dict | None = None,
|
|
853
920
|
export_params: dict | None = None,
|
|
@@ -861,7 +928,13 @@ class ExaConnection:
|
|
|
861
928
|
dst:
|
|
862
929
|
(optional) Path to file or file-like object where data will be exported to.
|
|
863
930
|
query_or_table:
|
|
864
|
-
|
|
931
|
+
Source from which to export data. Can be one of:
|
|
932
|
+
|
|
933
|
+
- ``tuple[str, ...]``: fully qualified table identifier, such as
|
|
934
|
+
``("SCHEMA", "TABLE")``. Quoted table names must be fully qualified
|
|
935
|
+
using this tuple pattern.
|
|
936
|
+
- ``str``: if lacks non-trailing space, it is treated like a
|
|
937
|
+
table identifier. Otherwise, it is treated like a query.
|
|
865
938
|
query_params:
|
|
866
939
|
Values for SQL query placeholders.
|
|
867
940
|
callback_params:
|
|
@@ -874,6 +947,7 @@ class ExaConnection:
|
|
|
874
947
|
|
|
875
948
|
Raises:
|
|
876
949
|
TypeError: callback argument is not Callable.
|
|
950
|
+
pydantic.ValidationError: Invalid values from ``export_params``.
|
|
877
951
|
ExaExportError: one or more exceptions occurred when executing the
|
|
878
952
|
callback function.
|
|
879
953
|
|
|
@@ -899,13 +973,19 @@ class ExaConnection:
|
|
|
899
973
|
if export_params is None:
|
|
900
974
|
export_params = {}
|
|
901
975
|
|
|
902
|
-
if query_params is not None:
|
|
976
|
+
if query_params is not None and isinstance(query_or_table, str):
|
|
903
977
|
query_or_table = self.format.format(query_or_table, **query_params)
|
|
904
978
|
|
|
905
979
|
compression = (
|
|
906
980
|
False if ("format" in export_params) else self.options["compression"]
|
|
907
981
|
)
|
|
908
982
|
|
|
983
|
+
export_builder = ExportBuilder(
|
|
984
|
+
compression=compression,
|
|
985
|
+
query_or_table=query_or_table,
|
|
986
|
+
**export_params,
|
|
987
|
+
)
|
|
988
|
+
|
|
909
989
|
# Set when either worker finishes, successfully or exceptionally. It
|
|
910
990
|
# wakes the coordinator but does not terminate the other worker.
|
|
911
991
|
worker_finished_event = threading.Event()
|
|
@@ -916,12 +996,11 @@ class ExaConnection:
|
|
|
916
996
|
encryption=self.options["encryption"],
|
|
917
997
|
worker_finished_event=worker_finished_event,
|
|
918
998
|
)
|
|
919
|
-
sql_thread =
|
|
999
|
+
sql_thread = ExaSQLThread(
|
|
920
1000
|
connection=self,
|
|
921
1001
|
compression=compression,
|
|
922
|
-
query_or_table=query_or_table,
|
|
923
|
-
export_params=export_params,
|
|
924
1002
|
worker_finished_event=worker_finished_event,
|
|
1003
|
+
query_builder=export_builder,
|
|
925
1004
|
)
|
|
926
1005
|
|
|
927
1006
|
try:
|
|
@@ -966,7 +1045,7 @@ class ExaConnection:
|
|
|
966
1045
|
self,
|
|
967
1046
|
callback: Callable,
|
|
968
1047
|
src,
|
|
969
|
-
table: str,
|
|
1048
|
+
table: str | tuple[str, ...],
|
|
970
1049
|
callback_params: dict | None = None,
|
|
971
1050
|
import_params: dict | None = None,
|
|
972
1051
|
):
|
|
@@ -979,7 +1058,11 @@ class ExaConnection:
|
|
|
979
1058
|
src:
|
|
980
1059
|
Source for the callback function.
|
|
981
1060
|
table:
|
|
982
|
-
Destination table for IMPORT.
|
|
1061
|
+
Destination table for IMPORT. Can be one of:
|
|
1062
|
+
|
|
1063
|
+
- ``str``: table identifier.
|
|
1064
|
+
- ``tuple[str, ...]``: schema-qualified table identifier, such as
|
|
1065
|
+
``("SCHEMA", "TABLE")``.
|
|
983
1066
|
callback_params:
|
|
984
1067
|
Dictionary with additional parameters for callback function.
|
|
985
1068
|
import_params:
|
|
@@ -987,6 +1070,7 @@ class ExaConnection:
|
|
|
987
1070
|
|
|
988
1071
|
Raises:
|
|
989
1072
|
TypeError: callback argument is not Callable.
|
|
1073
|
+
pydantic.ValidationError: Invalid values from ``import_params``.
|
|
990
1074
|
"""
|
|
991
1075
|
if not callable(callback):
|
|
992
1076
|
raise TypeError(
|
|
@@ -1003,6 +1087,12 @@ class ExaConnection:
|
|
|
1003
1087
|
False if ("format" in import_params) else self.options["compression"]
|
|
1004
1088
|
)
|
|
1005
1089
|
|
|
1090
|
+
import_builder = ImportBuilder(
|
|
1091
|
+
compression=compression,
|
|
1092
|
+
table=table,
|
|
1093
|
+
**import_params,
|
|
1094
|
+
)
|
|
1095
|
+
|
|
1006
1096
|
# Set when either worker finishes, successfully or exceptionally. It
|
|
1007
1097
|
# wakes the coordinator but does not terminate the other worker.
|
|
1008
1098
|
worker_finished_event = threading.Event()
|
|
@@ -1013,12 +1103,11 @@ class ExaConnection:
|
|
|
1013
1103
|
encryption=self.options["encryption"],
|
|
1014
1104
|
worker_finished_event=worker_finished_event,
|
|
1015
1105
|
)
|
|
1016
|
-
sql_thread =
|
|
1106
|
+
sql_thread = ExaSQLThread(
|
|
1017
1107
|
connection=self,
|
|
1018
1108
|
compression=compression,
|
|
1019
|
-
table=table,
|
|
1020
|
-
import_params=import_params,
|
|
1021
1109
|
worker_finished_event=worker_finished_event,
|
|
1110
|
+
query_builder=import_builder,
|
|
1022
1111
|
)
|
|
1023
1112
|
|
|
1024
1113
|
try:
|
|
@@ -1168,7 +1257,7 @@ class ExaConnection:
|
|
|
1168
1257
|
and calls this "releaseVersion".
|
|
1169
1258
|
"""
|
|
1170
1259
|
if release_version := self.login_info.get("releaseVersion"):
|
|
1171
|
-
return
|
|
1260
|
+
return database_versions.parse(release_version)
|
|
1172
1261
|
return None
|
|
1173
1262
|
|
|
1174
1263
|
def last_statement(self) -> ExaStatement:
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Minimum Exasol database versions required for supported features."""
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
from packaging.version import Version
|
|
7
|
+
|
|
8
|
+
VERSION_PATTERN = re.compile(r"^\d+\.\d+\.\d+")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ExasolVersionFormatError(Exception):
|
|
12
|
+
"""Unsupported format of Exasol version."""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def parse(version: str) -> Version:
|
|
16
|
+
if m := VERSION_PATTERN.match(version):
|
|
17
|
+
return Version(m.group(0))
|
|
18
|
+
raise ExasolVersionFormatError(f'Unsupported Exasol version "{version}".')
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass(frozen=True)
|
|
22
|
+
class DatabaseFeatureVersion:
|
|
23
|
+
"""Document a database feature's minimum supported Exasol version."""
|
|
24
|
+
|
|
25
|
+
version: Version
|
|
26
|
+
description: str
|
|
27
|
+
documentation_url: str
|
|
28
|
+
|
|
29
|
+
def is_supported_by(self, database_version: Version | None) -> bool:
|
|
30
|
+
"""Return whether the given database version supports this feature."""
|
|
31
|
+
return database_version is not None and database_version >= self.version
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
MIN_VERSION_FOR_TLS_PUBLIC_KEY = DatabaseFeatureVersion(
|
|
35
|
+
version=Version("8.32.0"),
|
|
36
|
+
description=(
|
|
37
|
+
"Exasol 8.32.0 introduced certificate verification for IMPORT and "
|
|
38
|
+
"EXPORT file connections, requiring the SHA-256 fingerprint of the "
|
|
39
|
+
"server certificate's public key when encryption is enabled."
|
|
40
|
+
),
|
|
41
|
+
documentation_url="https://docs.exasol.com/db/latest/changelogs/21747.htm",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
MIN_VERSION_FOR_NATIVE_PARQUET_IMPORT = DatabaseFeatureVersion(
|
|
45
|
+
version=Version("2026.1.0"),
|
|
46
|
+
description=(
|
|
47
|
+
"Exasol 2026.1.0 introduced full native Parquet import support, "
|
|
48
|
+
"including imports from local files."
|
|
49
|
+
),
|
|
50
|
+
documentation_url="https://docs.exasol.com/db/latest/release_notes_db/2026.1.0.htm",
|
|
51
|
+
)
|
|
@@ -404,7 +404,12 @@ class ExaExtension:
|
|
|
404
404
|
|
|
405
405
|
Args:
|
|
406
406
|
query_or_table:
|
|
407
|
-
|
|
407
|
+
Source from which to export data. Can be one of:
|
|
408
|
+
|
|
409
|
+
- ``tuple[str, ...]``: schema-qualified table identifier, such as
|
|
410
|
+
``("SCHEMA", "TABLE")``.
|
|
411
|
+
- ``str``: if it contains a non-trailing space, it is treated like
|
|
412
|
+
an SQL query. Otherwise, it is treated like a table identifier.
|
|
408
413
|
query_params:
|
|
409
414
|
Additional query parameters.
|
|
410
415
|
|