snowflake-connector-python 4.4.0__cp314-cp314-win_amd64.whl
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.
- snowflake/connector/__init__.py +118 -0
- snowflake/connector/_query_context_cache.py +276 -0
- snowflake/connector/_sql_util.py +48 -0
- snowflake/connector/_utils.py +353 -0
- snowflake/connector/aio/README.md +88 -0
- snowflake/connector/aio/__init__.py +163 -0
- snowflake/connector/aio/_azure_storage_client.py +227 -0
- snowflake/connector/aio/_bind_upload_agent.py +69 -0
- snowflake/connector/aio/_connection.py +1216 -0
- snowflake/connector/aio/_cursor.py +1402 -0
- snowflake/connector/aio/_description.py +5 -0
- snowflake/connector/aio/_direct_file_operation_utils.py +88 -0
- snowflake/connector/aio/_file_transfer_agent.py +316 -0
- snowflake/connector/aio/_gcs_storage_client.py +360 -0
- snowflake/connector/aio/_network.py +860 -0
- snowflake/connector/aio/_ocsp_asn1crypto.py +51 -0
- snowflake/connector/aio/_ocsp_snowflake.py +608 -0
- snowflake/connector/aio/_pandas_tools.py +561 -0
- snowflake/connector/aio/_result_batch.py +442 -0
- snowflake/connector/aio/_result_set.py +309 -0
- snowflake/connector/aio/_s3_storage_client.py +460 -0
- snowflake/connector/aio/_session_manager.py +588 -0
- snowflake/connector/aio/_storage_client.py +331 -0
- snowflake/connector/aio/_telemetry.py +97 -0
- snowflake/connector/aio/_time_util.py +57 -0
- snowflake/connector/aio/_wif_util.py +324 -0
- snowflake/connector/aio/auth/__init__.py +52 -0
- snowflake/connector/aio/auth/_auth.py +406 -0
- snowflake/connector/aio/auth/_by_plugin.py +131 -0
- snowflake/connector/aio/auth/_default.py +28 -0
- snowflake/connector/aio/auth/_idtoken.py +54 -0
- snowflake/connector/aio/auth/_keypair.py +60 -0
- snowflake/connector/aio/auth/_no_auth.py +31 -0
- snowflake/connector/aio/auth/_oauth.py +27 -0
- snowflake/connector/aio/auth/_oauth_code.py +117 -0
- snowflake/connector/aio/auth/_oauth_credentials.py +100 -0
- snowflake/connector/aio/auth/_okta.py +247 -0
- snowflake/connector/aio/auth/_pat.py +27 -0
- snowflake/connector/aio/auth/_usrpwdmfa.py +30 -0
- snowflake/connector/aio/auth/_webbrowser.py +405 -0
- snowflake/connector/aio/auth/_workload_identity.py +60 -0
- snowflake/connector/arrow_context.py +211 -0
- snowflake/connector/auth/__init__.py +53 -0
- snowflake/connector/auth/_auth.py +669 -0
- snowflake/connector/auth/_http_server.py +257 -0
- snowflake/connector/auth/_oauth_base.py +472 -0
- snowflake/connector/auth/by_plugin.py +219 -0
- snowflake/connector/auth/default.py +36 -0
- snowflake/connector/auth/idtoken.py +72 -0
- snowflake/connector/auth/keypair.py +225 -0
- snowflake/connector/auth/no_auth.py +39 -0
- snowflake/connector/auth/oauth.py +49 -0
- snowflake/connector/auth/oauth_code.py +490 -0
- snowflake/connector/auth/oauth_credentials.py +71 -0
- snowflake/connector/auth/okta.py +339 -0
- snowflake/connector/auth/pat.py +40 -0
- snowflake/connector/auth/usrpwdmfa.py +69 -0
- snowflake/connector/auth/webbrowser.py +514 -0
- snowflake/connector/auth/workload_identity.py +110 -0
- snowflake/connector/azure_storage_client.py +278 -0
- snowflake/connector/backoff_policies.py +141 -0
- snowflake/connector/bind_upload_agent.py +89 -0
- snowflake/connector/cache.py +696 -0
- snowflake/connector/compat.py +127 -0
- snowflake/connector/config_manager.py +553 -0
- snowflake/connector/connection.py +2671 -0
- snowflake/connector/connection_diagnostic.py +793 -0
- snowflake/connector/constants.py +460 -0
- snowflake/connector/converter.py +809 -0
- snowflake/connector/converter_issue23517.py +87 -0
- snowflake/connector/converter_null.py +14 -0
- snowflake/connector/converter_snowsql.py +205 -0
- snowflake/connector/crl.py +919 -0
- snowflake/connector/crl_cache.py +734 -0
- snowflake/connector/cursor.py +2099 -0
- snowflake/connector/dbapi.py +53 -0
- snowflake/connector/description.py +21 -0
- snowflake/connector/direct_file_operation_utils.py +88 -0
- snowflake/connector/encryption_util.py +220 -0
- snowflake/connector/errorcode.py +94 -0
- snowflake/connector/errors.py +666 -0
- snowflake/connector/externals_utils/__init__.py +0 -0
- snowflake/connector/externals_utils/externals_setup.py +30 -0
- snowflake/connector/feature.py +4 -0
- snowflake/connector/file_compression_type.py +118 -0
- snowflake/connector/file_lock.py +72 -0
- snowflake/connector/file_transfer_agent.py +1244 -0
- snowflake/connector/file_util.py +153 -0
- snowflake/connector/gcs_storage_client.py +476 -0
- snowflake/connector/gzip_decoder.py +85 -0
- snowflake/connector/interval_util.py +26 -0
- snowflake/connector/local_storage_client.py +90 -0
- snowflake/connector/log_configuration.py +62 -0
- snowflake/connector/logging_utils/__init__.py +0 -0
- snowflake/connector/logging_utils/filters.py +72 -0
- snowflake/connector/minicore/__init__.py +0 -0
- snowflake/connector/minicore/aix_ppc64/libsf_mini_core.a +0 -0
- snowflake/connector/minicore/aix_ppc64/libsf_mini_core_static.a +0 -0
- snowflake/connector/minicore/linux_aarch64_glibc/libsf_mini_core.so +0 -0
- snowflake/connector/minicore/linux_aarch64_musl/libsf_mini_core.so +0 -0
- snowflake/connector/minicore/linux_x86_64_glibc/libsf_mini_core.so +0 -0
- snowflake/connector/minicore/linux_x86_64_musl/libsf_mini_core.so +0 -0
- snowflake/connector/minicore/macos_aarch64/libsf_mini_core.dylib +0 -0
- snowflake/connector/minicore/macos_x86_64/libsf_mini_core.dylib +0 -0
- snowflake/connector/minicore/windows_x86_64/sf_mini_core.dll +0 -0
- snowflake/connector/minicore/windows_x86_64/sf_mini_core_static.lib +0 -0
- snowflake/connector/nanoarrow_arrow_iterator.cp314-win_amd64.pyd +0 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/ArrayConverter.cpp +60 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/ArrayConverter.hpp +29 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/BinaryConverter.cpp +19 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/BinaryConverter.hpp +26 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/BooleanConverter.cpp +21 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/BooleanConverter.hpp +23 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowChunkIterator.cpp +570 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowChunkIterator.hpp +98 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowIterator.cpp +125 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowIterator.hpp +115 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowTableIterator.cpp +1140 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowTableIterator.hpp +138 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DateConverter.cpp +47 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DateConverter.hpp +46 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DecFloatConverter.cpp +83 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DecFloatConverter.hpp +35 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DecimalConverter.cpp +97 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DecimalConverter.hpp +72 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/FixedSizeListConverter.cpp +73 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/FixedSizeListConverter.hpp +28 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/FloatConverter.cpp +30 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/FloatConverter.hpp +35 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IColumnConverter.hpp +17 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IntConverter.cpp +23 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IntConverter.hpp +45 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IntervalConverter.cpp +75 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IntervalConverter.hpp +57 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/LICENSE.txt +209 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/MapConverter.cpp +75 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/MapConverter.hpp +30 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/ObjectConverter.cpp +46 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/ObjectConverter.hpp +29 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Common.cpp +8 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Common.hpp +95 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Helpers.cpp +57 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Helpers.hpp +36 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/SnowflakeType.cpp +34 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/SnowflakeType.hpp +48 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/StringConverter.cpp +19 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/StringConverter.hpp +26 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeConverter.cpp +36 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeConverter.hpp +31 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeStampConverter.cpp +346 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeStampConverter.hpp +145 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/macros.hpp +14 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/time.cpp +67 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/time.hpp +68 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_accessors.h +101 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_alloc.h +127 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_assert.h +45 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_builder.h +1908 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_emitter.h +215 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_endian.h +125 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_epilogue.h +7 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_flatbuffers.h +55 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_identifier.h +148 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_iov.h +31 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_prologue.h +8 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_refmap.h +144 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_rtconfig.h +162 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_types.h +97 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_verifier.h +239 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/flatcc_portable.h +14 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/paligned_alloc.h +210 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pattributes.h +84 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic.h +84 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic_pop.h +20 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic_push.h +51 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pendian.h +206 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pendian_detect.h +118 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pinline.h +19 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pinttypes.h +52 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/portable.h +2 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/portable_basic.h +25 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstatic_assert.h +67 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstdalign.h +162 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstdint.h +898 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/punaligned.h +190 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pversion.h +6 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pwarnings.h +52 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc.c +3204 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.c +3217 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.h +3618 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.hpp +379 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_arrow_iterator.pyx +262 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_device.c +512 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_device.h +350 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.c +33273 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.h +397 -0
- snowflake/connector/nanoarrow_cpp/Logging/logging.cpp +100 -0
- snowflake/connector/nanoarrow_cpp/Logging/logging.hpp +49 -0
- snowflake/connector/network.py +1227 -0
- snowflake/connector/ocsp_asn1crypto.py +447 -0
- snowflake/connector/ocsp_snowflake.py +1939 -0
- snowflake/connector/options.py +179 -0
- snowflake/connector/os_details.py +88 -0
- snowflake/connector/pandas_tools.py +734 -0
- snowflake/connector/platform_detection.py +555 -0
- snowflake/connector/proxy.py +28 -0
- snowflake/connector/py.typed +0 -0
- snowflake/connector/result_batch.py +917 -0
- snowflake/connector/result_set.py +340 -0
- snowflake/connector/s3_storage_client.py +614 -0
- snowflake/connector/secret_detector.py +181 -0
- snowflake/connector/session_manager.py +650 -0
- snowflake/connector/sf_dirs.py +64 -0
- snowflake/connector/sfbinaryformat.py +35 -0
- snowflake/connector/sfdatetime.py +345 -0
- snowflake/connector/snow_logging.py +144 -0
- snowflake/connector/sqlstate.py +9 -0
- snowflake/connector/ssd_internal_keys.py +30 -0
- snowflake/connector/ssl_wrap_socket.py +281 -0
- snowflake/connector/storage_client.py +486 -0
- snowflake/connector/telemetry.py +254 -0
- snowflake/connector/telemetry_oob.py +544 -0
- snowflake/connector/test_util.py +30 -0
- snowflake/connector/time_util.py +159 -0
- snowflake/connector/token_cache.py +457 -0
- snowflake/connector/tool/__init__.py +0 -0
- snowflake/connector/tool/dump_certs.py +57 -0
- snowflake/connector/tool/dump_ocsp_response.py +139 -0
- snowflake/connector/tool/dump_ocsp_response_cache.py +194 -0
- snowflake/connector/tool/probe_connection.py +69 -0
- snowflake/connector/url_util.py +55 -0
- snowflake/connector/util_text.py +320 -0
- snowflake/connector/vendored/__init__.py +3 -0
- snowflake/connector/vendored/requests/LICENSE +175 -0
- snowflake/connector/vendored/requests/__init__.py +184 -0
- snowflake/connector/vendored/requests/__version__.py +14 -0
- snowflake/connector/vendored/requests/_internal_utils.py +50 -0
- snowflake/connector/vendored/requests/adapters.py +696 -0
- snowflake/connector/vendored/requests/api.py +157 -0
- snowflake/connector/vendored/requests/auth.py +314 -0
- snowflake/connector/vendored/requests/certs.py +17 -0
- snowflake/connector/vendored/requests/compat.py +106 -0
- snowflake/connector/vendored/requests/cookies.py +561 -0
- snowflake/connector/vendored/requests/exceptions.py +151 -0
- snowflake/connector/vendored/requests/help.py +134 -0
- snowflake/connector/vendored/requests/hooks.py +33 -0
- snowflake/connector/vendored/requests/models.py +1039 -0
- snowflake/connector/vendored/requests/packages.py +23 -0
- snowflake/connector/vendored/requests/sessions.py +831 -0
- snowflake/connector/vendored/requests/status_codes.py +128 -0
- snowflake/connector/vendored/requests/structures.py +99 -0
- snowflake/connector/vendored/requests/utils.py +1086 -0
- snowflake/connector/vendored/urllib3/LICENSE.txt +21 -0
- snowflake/connector/vendored/urllib3/__init__.py +211 -0
- snowflake/connector/vendored/urllib3/_base_connection.py +165 -0
- snowflake/connector/vendored/urllib3/_collections.py +487 -0
- snowflake/connector/vendored/urllib3/_request_methods.py +278 -0
- snowflake/connector/vendored/urllib3/_version.py +34 -0
- snowflake/connector/vendored/urllib3/connection.py +1108 -0
- snowflake/connector/vendored/urllib3/connectionpool.py +1178 -0
- snowflake/connector/vendored/urllib3/contrib/__init__.py +0 -0
- snowflake/connector/vendored/urllib3/contrib/emscripten/__init__.py +17 -0
- snowflake/connector/vendored/urllib3/contrib/emscripten/connection.py +260 -0
- snowflake/connector/vendored/urllib3/contrib/emscripten/emscripten_fetch_worker.js +110 -0
- snowflake/connector/vendored/urllib3/contrib/emscripten/fetch.py +726 -0
- snowflake/connector/vendored/urllib3/contrib/emscripten/request.py +22 -0
- snowflake/connector/vendored/urllib3/contrib/emscripten/response.py +277 -0
- snowflake/connector/vendored/urllib3/contrib/pyopenssl.py +564 -0
- snowflake/connector/vendored/urllib3/contrib/socks.py +228 -0
- snowflake/connector/vendored/urllib3/exceptions.py +335 -0
- snowflake/connector/vendored/urllib3/fields.py +341 -0
- snowflake/connector/vendored/urllib3/filepost.py +89 -0
- snowflake/connector/vendored/urllib3/http2/__init__.py +53 -0
- snowflake/connector/vendored/urllib3/http2/connection.py +356 -0
- snowflake/connector/vendored/urllib3/http2/probe.py +87 -0
- snowflake/connector/vendored/urllib3/poolmanager.py +651 -0
- snowflake/connector/vendored/urllib3/py.typed +2 -0
- snowflake/connector/vendored/urllib3/response.py +1480 -0
- snowflake/connector/vendored/urllib3/util/__init__.py +42 -0
- snowflake/connector/vendored/urllib3/util/connection.py +137 -0
- snowflake/connector/vendored/urllib3/util/proxy.py +43 -0
- snowflake/connector/vendored/urllib3/util/request.py +263 -0
- snowflake/connector/vendored/urllib3/util/response.py +101 -0
- snowflake/connector/vendored/urllib3/util/retry.py +549 -0
- snowflake/connector/vendored/urllib3/util/ssl_.py +527 -0
- snowflake/connector/vendored/urllib3/util/ssl_match_hostname.py +159 -0
- snowflake/connector/vendored/urllib3/util/ssltransport.py +271 -0
- snowflake/connector/vendored/urllib3/util/timeout.py +275 -0
- snowflake/connector/vendored/urllib3/util/url.py +469 -0
- snowflake/connector/vendored/urllib3/util/util.py +42 -0
- snowflake/connector/vendored/urllib3/util/wait.py +124 -0
- snowflake/connector/version.py +3 -0
- snowflake/connector/wif_util.py +434 -0
- snowflake_connector_python-4.4.0.dist-info/DELVEWHEEL +2 -0
- snowflake_connector_python-4.4.0.dist-info/METADATA +1591 -0
- snowflake_connector_python-4.4.0.dist-info/RECORD +302 -0
- snowflake_connector_python-4.4.0.dist-info/WHEEL +5 -0
- snowflake_connector_python-4.4.0.dist-info/entry_points.txt +4 -0
- snowflake_connector_python-4.4.0.dist-info/licenses/LICENSE.txt +202 -0
- snowflake_connector_python-4.4.0.dist-info/licenses/NOTICE +8 -0
- snowflake_connector_python-4.4.0.dist-info/top_level.txt +1 -0
- snowflake_connector_python.libs/msvcp140-0f885b509a685d2bbfa652fed26b5fb3.dll +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#include "CArrowIterator.hpp"
|
|
2
|
+
|
|
3
|
+
#include <memory>
|
|
4
|
+
|
|
5
|
+
#include "nanoarrow.h"
|
|
6
|
+
#include "nanoarrow_ipc.h"
|
|
7
|
+
|
|
8
|
+
namespace sf {
|
|
9
|
+
|
|
10
|
+
const char* const NANOARROW_TYPE_ENUM_STRING[] = {
|
|
11
|
+
"NANOARROW_TYPE_UNINITIALIZED",
|
|
12
|
+
"NANOARROW_TYPE_NA",
|
|
13
|
+
"NANOARROW_TYPE_BOOL",
|
|
14
|
+
"NANOARROW_TYPE_UINT8",
|
|
15
|
+
"NANOARROW_TYPE_INT8",
|
|
16
|
+
"NANOARROW_TYPE_UINT16",
|
|
17
|
+
"NANOARROW_TYPE_INT16",
|
|
18
|
+
"NANOARROW_TYPE_UINT32",
|
|
19
|
+
"NANOARROW_TYPE_INT32",
|
|
20
|
+
"NANOARROW_TYPE_UINT64",
|
|
21
|
+
"NANOARROW_TYPE_INT64",
|
|
22
|
+
"NANOARROW_TYPE_HALF_FLOAT",
|
|
23
|
+
"NANOARROW_TYPE_FLOAT",
|
|
24
|
+
"NANOARROW_TYPE_DOUBLE",
|
|
25
|
+
"NANOARROW_TYPE_STRING",
|
|
26
|
+
"NANOARROW_TYPE_BINARY",
|
|
27
|
+
"NANOARROW_TYPE_FIXED_SIZE_BINARY",
|
|
28
|
+
"NANOARROW_TYPE_DATE32",
|
|
29
|
+
"NANOARROW_TYPE_DATE64",
|
|
30
|
+
"NANOARROW_TYPE_TIMESTAMP",
|
|
31
|
+
"NANOARROW_TYPE_TIME32",
|
|
32
|
+
"NANOARROW_TYPE_TIME64",
|
|
33
|
+
"NANOARROW_TYPE_INTERVAL_MONTHS",
|
|
34
|
+
"NANOARROW_TYPE_INTERVAL_DAY_TIME",
|
|
35
|
+
"NANOARROW_TYPE_DECIMAL128",
|
|
36
|
+
"NANOARROW_TYPE_DECIMAL256",
|
|
37
|
+
"NANOARROW_TYPE_LIST",
|
|
38
|
+
"NANOARROW_TYPE_STRUCT",
|
|
39
|
+
"NANOARROW_TYPE_SPARSE_UNION",
|
|
40
|
+
"NANOARROW_TYPE_DENSE_UNION",
|
|
41
|
+
"NANOARROW_TYPE_DICTIONARY",
|
|
42
|
+
"NANOARROW_TYPE_MAP",
|
|
43
|
+
"NANOARROW_TYPE_EXTENSION",
|
|
44
|
+
"NANOARROW_TYPE_FIXED_SIZE_LIST",
|
|
45
|
+
"NANOARROW_TYPE_DURATION",
|
|
46
|
+
"NANOARROW_TYPE_LARGE_STRING",
|
|
47
|
+
"NANOARROW_TYPE_LARGE_BINARY",
|
|
48
|
+
"NANOARROW_TYPE_LARGE_LIST",
|
|
49
|
+
"NANOARROW_TYPE_INTERVAL_MONTH_DAY_NANO"};
|
|
50
|
+
|
|
51
|
+
Logger* CArrowIterator::logger =
|
|
52
|
+
new Logger("snowflake.connector.CArrowIterator");
|
|
53
|
+
|
|
54
|
+
CArrowIterator::CArrowIterator(char* arrow_bytes, int64_t arrow_bytes_size) {
|
|
55
|
+
int returnCode = 0;
|
|
56
|
+
ArrowBuffer input_buffer;
|
|
57
|
+
ArrowBufferInit(&input_buffer);
|
|
58
|
+
returnCode = ArrowBufferAppend(&input_buffer, arrow_bytes, arrow_bytes_size);
|
|
59
|
+
SF_CHECK_ARROW_RC(
|
|
60
|
+
returnCode,
|
|
61
|
+
"[Snowflake Exception] error loading arrow bytes, error code: %d",
|
|
62
|
+
returnCode);
|
|
63
|
+
ArrowIpcInputStream input;
|
|
64
|
+
returnCode = ArrowIpcInputStreamInitBuffer(&input, &input_buffer);
|
|
65
|
+
SF_CHECK_ARROW_RC(returnCode,
|
|
66
|
+
"[Snowflake Exception] error initializing "
|
|
67
|
+
"ArrowIpcInputStream, error code: %d",
|
|
68
|
+
returnCode);
|
|
69
|
+
ArrowArrayStream stream;
|
|
70
|
+
returnCode = ArrowIpcArrayStreamReaderInit(&stream, &input, nullptr);
|
|
71
|
+
SF_CHECK_ARROW_RC_AND_RELEASE_ARROW_STREAM(
|
|
72
|
+
returnCode, stream,
|
|
73
|
+
"[Snowflake Exception] error initializing ArrowIpcArrayStreamReader, "
|
|
74
|
+
"error code: %d",
|
|
75
|
+
returnCode);
|
|
76
|
+
returnCode = stream.get_schema(&stream, m_ipcArrowSchema.get());
|
|
77
|
+
SF_CHECK_ARROW_RC_AND_RELEASE_ARROW_STREAM(
|
|
78
|
+
returnCode, stream,
|
|
79
|
+
"[Snowflake Exception] error getting schema from stream, error code: %d",
|
|
80
|
+
returnCode);
|
|
81
|
+
|
|
82
|
+
while (true) {
|
|
83
|
+
nanoarrow::UniqueArray newUniqueArray;
|
|
84
|
+
nanoarrow::UniqueArrayView newUniqueArrayView;
|
|
85
|
+
auto retcode = stream.get_next(&stream, newUniqueArray.get());
|
|
86
|
+
if (retcode == NANOARROW_OK && newUniqueArray->release != nullptr) {
|
|
87
|
+
m_ipcArrowArrayVec.push_back(std::move(newUniqueArray));
|
|
88
|
+
|
|
89
|
+
ArrowError error;
|
|
90
|
+
returnCode = ArrowArrayViewInitFromSchema(newUniqueArrayView.get(),
|
|
91
|
+
m_ipcArrowSchema.get(), &error);
|
|
92
|
+
SF_CHECK_ARROW_RC_AND_RELEASE_ARROW_STREAM(
|
|
93
|
+
returnCode, stream,
|
|
94
|
+
"[Snowflake Exception] error initializing ArrowArrayView from schema "
|
|
95
|
+
": %s, error code: %d",
|
|
96
|
+
ArrowErrorMessage(&error), returnCode);
|
|
97
|
+
|
|
98
|
+
returnCode = ArrowArrayViewSetArray(newUniqueArrayView.get(),
|
|
99
|
+
newUniqueArray.get(), &error);
|
|
100
|
+
SF_CHECK_ARROW_RC_AND_RELEASE_ARROW_STREAM(
|
|
101
|
+
returnCode, stream,
|
|
102
|
+
"[Snowflake Exception] error setting ArrowArrayView from array : %s, "
|
|
103
|
+
"error code: %d",
|
|
104
|
+
ArrowErrorMessage(&error), returnCode);
|
|
105
|
+
m_ipcArrowArrayViewVec.push_back(std::move(newUniqueArrayView));
|
|
106
|
+
} else {
|
|
107
|
+
SF_CHECK_ARROW_RC_AND_RELEASE_ARROW_STREAM(
|
|
108
|
+
retcode, stream,
|
|
109
|
+
"[Snowflake Exception] error getting schema from stream, error code: "
|
|
110
|
+
"%d",
|
|
111
|
+
returnCode);
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
stream.release(&stream);
|
|
116
|
+
logger->debug(__FILE__, __func__, __LINE__, "Arrow BatchSize: %d",
|
|
117
|
+
m_ipcArrowArrayVec.size());
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
ReturnVal CArrowIterator::checkInitializationStatus() {
|
|
121
|
+
SF_CHECK_PYTHON_ERR()
|
|
122
|
+
return ReturnVal(nullptr, nullptr);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
} // namespace sf
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
#ifndef PC_ARROWITERATOR_HPP
|
|
2
|
+
#define PC_ARROWITERATOR_HPP
|
|
3
|
+
|
|
4
|
+
#include <cstdint>
|
|
5
|
+
#include <memory>
|
|
6
|
+
#include <string>
|
|
7
|
+
#include <vector>
|
|
8
|
+
|
|
9
|
+
#include "Python/Common.hpp"
|
|
10
|
+
#include "logging.hpp"
|
|
11
|
+
#include "nanoarrow.hpp"
|
|
12
|
+
|
|
13
|
+
#define SF_CHECK_ARROW_RC(arrow_status, format_string, ...) \
|
|
14
|
+
if (arrow_status != NANOARROW_OK) { \
|
|
15
|
+
std::string errorInfo = \
|
|
16
|
+
Logger::formatString(format_string, ##__VA_ARGS__); \
|
|
17
|
+
logger->error(__FILE__, __func__, __LINE__, errorInfo.c_str()); \
|
|
18
|
+
PyErr_SetString(PyExc_Exception, errorInfo.c_str()); \
|
|
19
|
+
return; \
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#define SF_CHECK_ARROW_RC_AND_RETURN(arrow_status, ret_val, format_string, \
|
|
23
|
+
...) \
|
|
24
|
+
if (arrow_status != NANOARROW_OK) { \
|
|
25
|
+
std::string errorInfo = \
|
|
26
|
+
Logger::formatString(format_string, ##__VA_ARGS__); \
|
|
27
|
+
logger->error(__FILE__, __func__, __LINE__, errorInfo.c_str()); \
|
|
28
|
+
PyErr_SetString(PyExc_Exception, errorInfo.c_str()); \
|
|
29
|
+
return ret_val; \
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#define SF_CHECK_ARROW_RC_AND_RELEASE_ARROW_STREAM(arrow_status, stream, \
|
|
33
|
+
format_string, ...) \
|
|
34
|
+
if (arrow_status != NANOARROW_OK) { \
|
|
35
|
+
std::string errorInfo = std::string(format_string) + \
|
|
36
|
+
std::string(", error info: ") + \
|
|
37
|
+
std::string(stream.get_last_error(&stream)); \
|
|
38
|
+
std::string fullErrorInfo = \
|
|
39
|
+
Logger::formatString(errorInfo.c_str(), ##__VA_ARGS__); \
|
|
40
|
+
logger->error(__FILE__, __func__, __LINE__, fullErrorInfo.c_str()); \
|
|
41
|
+
PyErr_SetString(PyExc_Exception, fullErrorInfo.c_str()); \
|
|
42
|
+
stream.release(&stream); \
|
|
43
|
+
return; \
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
#define SF_CHECK_PYTHON_ERR() \
|
|
47
|
+
if (py::checkPyError()) { \
|
|
48
|
+
PyObject *type, *val, *traceback; \
|
|
49
|
+
PyErr_Fetch(&type, &val, &traceback); \
|
|
50
|
+
PyErr_Clear(); \
|
|
51
|
+
m_currentPyException.reset(val); \
|
|
52
|
+
\
|
|
53
|
+
Py_XDECREF(type); \
|
|
54
|
+
Py_XDECREF(traceback); \
|
|
55
|
+
\
|
|
56
|
+
return ReturnVal(nullptr, m_currentPyException.get()); \
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
namespace sf {
|
|
60
|
+
|
|
61
|
+
extern const char* const NANOARROW_TYPE_ENUM_STRING[];
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* A simple struct to contain return data back cython.
|
|
65
|
+
* PyObject would be nullptr if failed and cause string will be populated
|
|
66
|
+
*
|
|
67
|
+
* Note that `ReturnVal` does not own these pointers, so they should
|
|
68
|
+
* not be decref'ed by the receiver.
|
|
69
|
+
*/
|
|
70
|
+
class ReturnVal {
|
|
71
|
+
public:
|
|
72
|
+
ReturnVal() : successObj(nullptr), exception(nullptr) {}
|
|
73
|
+
|
|
74
|
+
ReturnVal(PyObject* obj, PyObject* except)
|
|
75
|
+
: successObj(obj), exception(except) {}
|
|
76
|
+
|
|
77
|
+
PyObject* successObj;
|
|
78
|
+
|
|
79
|
+
PyObject* exception;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Arrow base iterator implementation in C++.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
class CArrowIterator {
|
|
87
|
+
public:
|
|
88
|
+
CArrowIterator(char* arrow_bytes, int64_t arrow_bytes_size);
|
|
89
|
+
|
|
90
|
+
virtual ~CArrowIterator() = default;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @return a python object which might be current row or an Arrow Table
|
|
94
|
+
*/
|
|
95
|
+
virtual ReturnVal next() = 0;
|
|
96
|
+
virtual std::vector<uintptr_t> getArrowArrayPtrs() { return {}; };
|
|
97
|
+
virtual std::vector<uintptr_t> getArrowSchemaPtrs() { return {}; };
|
|
98
|
+
|
|
99
|
+
/** check whether initialization succeeded or encountered error */
|
|
100
|
+
ReturnVal checkInitializationStatus();
|
|
101
|
+
|
|
102
|
+
protected:
|
|
103
|
+
static Logger* logger;
|
|
104
|
+
|
|
105
|
+
/** nanoarrow data */
|
|
106
|
+
std::vector<nanoarrow::UniqueArray> m_ipcArrowArrayVec;
|
|
107
|
+
std::vector<nanoarrow::UniqueArrayView> m_ipcArrowArrayViewVec;
|
|
108
|
+
nanoarrow::UniqueSchema m_ipcArrowSchema;
|
|
109
|
+
|
|
110
|
+
/** pointer to the current python exception object */
|
|
111
|
+
py::UniqueRef m_currentPyException;
|
|
112
|
+
};
|
|
113
|
+
} // namespace sf
|
|
114
|
+
|
|
115
|
+
#endif // PC_ARROWITERATOR_HPP
|