clickhouse-native 0.0.1
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.
- checksums.yaml +7 -0
- data/ext/clickhouse_native/client.cpp +847 -0
- data/ext/clickhouse_native/extconf.rb +101 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/.clang-format +11 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/.git +1 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/.gitattributes +63 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/.github/CODEOWNERS +1 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/.github/workflows/linux.yml +139 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/.github/workflows/macos.yml +87 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/.github/workflows/windows_mingw.yml +102 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/.github/workflows/windows_msvc.yml +74 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/.gitignore +280 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/.travis.yml +62 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/CMakeLists.txt +157 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/LICENSE +206 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/README.md +260 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/CMakeLists.txt +246 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/buffer.h +10 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/compressed.cpp +258 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/compressed.h +48 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/endpoints_iterator.cpp +20 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/endpoints_iterator.h +34 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/input.cpp +96 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/input.h +103 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/open_telemetry.h +23 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/output.cpp +119 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/output.h +142 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/platform.cpp +1 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/platform.h +33 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/projected_iterator.h +55 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/singleton.h +11 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/socket.cpp +489 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/socket.h +177 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/sslsocket.cpp +307 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/sslsocket.h +111 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/string_utils.h +28 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/string_view.h +142 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/uuid.h +10 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/wire_format.cpp +177 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/wire_format.h +79 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/block.cpp +134 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/block.h +114 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/client.cpp +1269 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/client.h +320 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/array.cpp +175 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/array.h +321 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/column.cpp +24 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/column.h +107 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/date.cpp +365 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/date.h +245 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/decimal.cpp +255 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/decimal.h +50 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/enum.cpp +123 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/enum.h +65 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/factory.cpp +285 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/factory.h +14 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/geo.cpp +108 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/geo.h +79 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/ip4.cpp +117 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/ip4.h +71 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/ip6.cpp +108 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/ip6.h +66 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/itemview.cpp +101 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/itemview.h +86 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/lowcardinality.cpp +527 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/lowcardinality.h +221 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/lowcardinalityadaptor.h +63 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/map.cpp +87 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/map.h +257 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/nothing.h +87 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/nullable.cpp +109 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/nullable.h +153 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/numeric.cpp +126 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/numeric.h +88 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/string.cpp +333 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/string.h +145 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/time.cpp +155 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/time.h +118 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/tuple.cpp +106 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/tuple.h +178 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/utils.h +41 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/uuid.cpp +80 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/uuid.h +58 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/error_codes.h +595 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/exceptions.h +66 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/protocol.h +54 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/query.cpp +25 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/query.h +246 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/server_exception.h +16 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/types/type_parser.cpp +314 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/types/type_parser.h +89 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/types/types.cpp +484 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/types/types.h +397 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/version.h +14 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/Findcityhash.cmake +26 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/Findlz4.cmake +39 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/Findzstd.cmake +39 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/cpp17.cmake +8 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/openssl.cmake +8 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/subdirs.cmake +5 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/version.cmake +87 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/CMakeLists.txt +9 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/attributes.h +682 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/config.h +714 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/internal/bits.h +219 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/macros.h +147 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/optimization.h +241 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/options.h +238 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/policy_checks.h +111 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/port.h +26 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/numeric/int128.cc +390 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/numeric/int128.h +1092 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/numeric/int128_have_intrinsic.inc +302 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/numeric/int128_no_intrinsic.inc +308 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/BUCK +13 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/CMakeLists.txt +7 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/COPYING +19 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/city.cc +469 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/city.h +90 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/citycrc.h +43 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/config.h +118 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/BUCK +14 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/CMakeLists.txt +4 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/LICENSE +28 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/README.md +1 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-death-test.h +346 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-matchers.h +930 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-message.h +219 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-param-test.h +507 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-printers.h +1029 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-spi.h +238 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-test-part.h +184 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-typed-test.h +329 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest.h +2495 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest_pred_impl.h +359 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest_prod.h +61 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/custom/README.md +56 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/custom/gtest-port.h +37 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/custom/gtest-printers.h +42 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/custom/gtest.h +37 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-death-test-internal.h +304 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-filepath.h +211 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-internal.h +1560 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-param-util.h +947 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-port-arch.h +114 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-port.h +2389 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-string.h +175 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-type-util.h +183 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-all.cc +48 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-death-test.cc +1644 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-filepath.cc +369 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-internal-inl.h +1221 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-matchers.cc +97 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-port.cc +1433 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-printers.cc +533 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-test-part.cc +108 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-typed-test.cc +107 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest.cc +6746 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest_main.cc +54 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/BUCK +13 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/CMakeLists.txt +8 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/LICENSE +24 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/lz4.c +2402 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/lz4.h +764 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/lz4hc.c +1554 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/lz4hc.h +438 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/BUCK +232 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/CMakeLists.txt +115 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/LICENSE +30 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/allocations.h +55 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/bits.h +200 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/bitstream.h +437 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/compiler.h +358 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/cpu.h +213 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/debug.c +24 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/debug.h +107 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/entropy_common.c +340 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/error_private.c +63 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/error_private.h +159 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/fse.h +639 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/fse_decompress.c +311 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/huf.h +273 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/mem.h +435 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/pool.c +371 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/pool.h +90 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/portability_macros.h +156 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/threading.c +176 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/threading.h +150 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/xxhash.c +24 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/xxhash.h +5686 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/zstd_common.c +48 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/zstd_deps.h +111 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/zstd_internal.h +392 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/zstd_trace.h +163 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/clevels.h +134 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/fse_compress.c +624 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/hist.c +181 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/hist.h +75 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/huf_compress.c +1435 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress.c +7032 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_internal.h +1532 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_literals.c +235 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_literals.h +39 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_sequences.c +442 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_sequences.h +54 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_superblock.c +577 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_superblock.h +32 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_cwksp.h +742 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_double_fast.c +758 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_double_fast.h +39 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_fast.c +960 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_fast.h +38 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_lazy.c +2157 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_lazy.h +127 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_ldm.c +724 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_ldm.h +117 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_ldm_geartab.h +106 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_opt.c +1472 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_opt.h +56 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstdmt_compress.c +1867 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstdmt_compress.h +113 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/huf_decompress.c +1882 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/huf_decompress_amd64.S +576 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/zstd_ddict.c +244 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/zstd_ddict.h +44 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/zstd_decompress.c +2355 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/zstd_decompress_block.c +2192 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/zstd_decompress_block.h +73 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/zstd_decompress_internal.h +238 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/dictBuilder/cover.c +1257 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/dictBuilder/cover.h +158 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/dictBuilder/divsufsort.c +1913 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/dictBuilder/divsufsort.h +67 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/dictBuilder/fastcover.c +766 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/dictBuilder/zdict.c +1127 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_legacy.h +422 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v01.c +2125 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v01.h +94 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v02.c +3477 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v02.h +93 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v03.c +3117 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v03.h +93 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v04.c +3605 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v04.h +142 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v05.c +4004 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v05.h +162 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v06.c +4113 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v06.h +172 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v07.c +4498 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v07.h +187 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/zdict.h +474 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/zstd.h +3020 -0
- data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/zstd_errors.h +114 -0
- data/lib/clickhouse_native/clickhouse_native.bundle +0 -0
- data/lib/clickhouse_native/client.rb +50 -0
- data/lib/clickhouse_native/errors.rb +23 -0
- data/lib/clickhouse_native/pool.rb +49 -0
- data/lib/clickhouse_native/version.rb +3 -0
- data/lib/clickhouse_native.rb +8 -0
- metadata +369 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "absl/numeric/int128.h"
|
|
4
|
+
|
|
5
|
+
#include <atomic>
|
|
6
|
+
#include <map>
|
|
7
|
+
#include <memory>
|
|
8
|
+
#include <string>
|
|
9
|
+
#include <vector>
|
|
10
|
+
#include <stdexcept>
|
|
11
|
+
|
|
12
|
+
namespace clickhouse {
|
|
13
|
+
|
|
14
|
+
using Int128 = absl::int128;
|
|
15
|
+
using UInt128 = absl::uint128;
|
|
16
|
+
using Int64 = int64_t;
|
|
17
|
+
|
|
18
|
+
using TypeRef = std::shared_ptr<class Type>;
|
|
19
|
+
|
|
20
|
+
class Type {
|
|
21
|
+
public:
|
|
22
|
+
enum Code {
|
|
23
|
+
Void = 0,
|
|
24
|
+
Int8,
|
|
25
|
+
Int16,
|
|
26
|
+
Int32,
|
|
27
|
+
Int64,
|
|
28
|
+
UInt8,
|
|
29
|
+
UInt16,
|
|
30
|
+
UInt32,
|
|
31
|
+
UInt64,
|
|
32
|
+
Float32,
|
|
33
|
+
Float64,
|
|
34
|
+
String,
|
|
35
|
+
FixedString,
|
|
36
|
+
DateTime,
|
|
37
|
+
Date,
|
|
38
|
+
Array,
|
|
39
|
+
Nullable,
|
|
40
|
+
Tuple,
|
|
41
|
+
Enum8,
|
|
42
|
+
Enum16,
|
|
43
|
+
UUID,
|
|
44
|
+
IPv4,
|
|
45
|
+
IPv6,
|
|
46
|
+
Int128,
|
|
47
|
+
UInt128,
|
|
48
|
+
Decimal,
|
|
49
|
+
Decimal32,
|
|
50
|
+
Decimal64,
|
|
51
|
+
Decimal128,
|
|
52
|
+
LowCardinality,
|
|
53
|
+
DateTime64,
|
|
54
|
+
Date32,
|
|
55
|
+
Map,
|
|
56
|
+
Point,
|
|
57
|
+
Ring,
|
|
58
|
+
Polygon,
|
|
59
|
+
MultiPolygon,
|
|
60
|
+
Time,
|
|
61
|
+
Time64,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
using EnumItem = std::pair<std::string /* name */, int16_t /* value */>;
|
|
65
|
+
|
|
66
|
+
protected:
|
|
67
|
+
Type(const Code code);
|
|
68
|
+
|
|
69
|
+
public:
|
|
70
|
+
template <typename Derived>
|
|
71
|
+
auto* As() {
|
|
72
|
+
return static_cast<Derived*>(this);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
template <typename Derived>
|
|
76
|
+
const auto* As() const {
|
|
77
|
+
return static_cast<const Derived*>(this);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/// Type's code.
|
|
81
|
+
Code GetCode() const { return code_; }
|
|
82
|
+
|
|
83
|
+
/// String representation of the type.
|
|
84
|
+
std::string GetName() const;
|
|
85
|
+
|
|
86
|
+
/// Is given type same as current one.
|
|
87
|
+
bool IsEqual(const Type& other) const {
|
|
88
|
+
// Types are equal only if both code_ and type_unique_id_ are equal.
|
|
89
|
+
return this == &other
|
|
90
|
+
// GetTypeUniqueId() is relatively heavy, so avoid calling it when comparing obviously different types.
|
|
91
|
+
|| (this->GetCode() == other.GetCode() && this->GetTypeUniqueId() == other.GetTypeUniqueId());
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
bool IsEqual(const TypeRef& other) const { return IsEqual(*other); }
|
|
95
|
+
|
|
96
|
+
/// Simple name, doesn't depend on parameters and\or nested types, caller MUST NOT free returned value.
|
|
97
|
+
static const char* TypeName(Code);
|
|
98
|
+
|
|
99
|
+
public:
|
|
100
|
+
static TypeRef CreateArray(TypeRef item_type);
|
|
101
|
+
|
|
102
|
+
static TypeRef CreateDate();
|
|
103
|
+
|
|
104
|
+
static TypeRef CreateDate32();
|
|
105
|
+
|
|
106
|
+
static TypeRef CreateDateTime(std::string timezone = std::string());
|
|
107
|
+
|
|
108
|
+
static TypeRef CreateDateTime64(size_t precision, std::string timezone = std::string());
|
|
109
|
+
|
|
110
|
+
static TypeRef CreateDecimal(size_t precision, size_t scale);
|
|
111
|
+
|
|
112
|
+
static TypeRef CreateIPv4();
|
|
113
|
+
|
|
114
|
+
static TypeRef CreateIPv6();
|
|
115
|
+
|
|
116
|
+
static TypeRef CreateNothing();
|
|
117
|
+
|
|
118
|
+
static TypeRef CreateNullable(TypeRef nested_type);
|
|
119
|
+
|
|
120
|
+
template <typename T>
|
|
121
|
+
static TypeRef CreateSimple();
|
|
122
|
+
|
|
123
|
+
static TypeRef CreateString();
|
|
124
|
+
|
|
125
|
+
static TypeRef CreateString(size_t n);
|
|
126
|
+
|
|
127
|
+
static TypeRef CreateTuple(const std::vector<TypeRef>& item_types);
|
|
128
|
+
|
|
129
|
+
static TypeRef CreateEnum8(const std::vector<EnumItem>& enum_items);
|
|
130
|
+
|
|
131
|
+
static TypeRef CreateEnum16(const std::vector<EnumItem>& enum_items);
|
|
132
|
+
|
|
133
|
+
static TypeRef CreateUUID();
|
|
134
|
+
|
|
135
|
+
static TypeRef CreateLowCardinality(TypeRef item_type);
|
|
136
|
+
|
|
137
|
+
static TypeRef CreateMap(TypeRef key_type, TypeRef value_type);
|
|
138
|
+
|
|
139
|
+
static TypeRef CreatePoint();
|
|
140
|
+
|
|
141
|
+
static TypeRef CreateRing();
|
|
142
|
+
|
|
143
|
+
static TypeRef CreatePolygon();
|
|
144
|
+
|
|
145
|
+
static TypeRef CreateMultiPolygon();
|
|
146
|
+
|
|
147
|
+
static TypeRef CreateTime();
|
|
148
|
+
|
|
149
|
+
static TypeRef CreateTime64(size_t precision);
|
|
150
|
+
|
|
151
|
+
private:
|
|
152
|
+
uint64_t GetTypeUniqueId() const;
|
|
153
|
+
|
|
154
|
+
const Code code_;
|
|
155
|
+
mutable std::atomic<uint64_t> type_unique_id_;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
inline bool operator==(const Type & left, const Type & right) {
|
|
159
|
+
if (&left == &right)
|
|
160
|
+
return true;
|
|
161
|
+
if (typeid(left) == typeid(right))
|
|
162
|
+
return left.IsEqual(right);
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
inline bool operator==(const TypeRef & left, const TypeRef & right) {
|
|
167
|
+
return *left == *right;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
class ArrayType : public Type {
|
|
171
|
+
public:
|
|
172
|
+
explicit ArrayType(TypeRef item_type);
|
|
173
|
+
|
|
174
|
+
std::string GetName() const { return std::string("Array(") + item_type_->GetName() + ")"; }
|
|
175
|
+
|
|
176
|
+
/// Type of array's elements.
|
|
177
|
+
inline TypeRef GetItemType() const { return item_type_; }
|
|
178
|
+
|
|
179
|
+
private:
|
|
180
|
+
TypeRef item_type_;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
class DecimalType : public Type {
|
|
184
|
+
public:
|
|
185
|
+
DecimalType(size_t precision, size_t scale);
|
|
186
|
+
|
|
187
|
+
std::string GetName() const;
|
|
188
|
+
friend class EnumType;
|
|
189
|
+
friend class DateTimeType;
|
|
190
|
+
|
|
191
|
+
inline size_t GetScale() const { return scale_; }
|
|
192
|
+
inline size_t GetPrecision() const { return precision_; }
|
|
193
|
+
|
|
194
|
+
private:
|
|
195
|
+
const size_t precision_, scale_;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
namespace details
|
|
199
|
+
{
|
|
200
|
+
class TypeWithTimeZoneMixin
|
|
201
|
+
{
|
|
202
|
+
public:
|
|
203
|
+
TypeWithTimeZoneMixin(std::string timezone);
|
|
204
|
+
|
|
205
|
+
/// Timezone associated with a data column.
|
|
206
|
+
const std::string & Timezone() const;
|
|
207
|
+
|
|
208
|
+
private:
|
|
209
|
+
std::string timezone_;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
class Time64Type : public Type {
|
|
214
|
+
public:
|
|
215
|
+
explicit Time64Type(size_t precision);
|
|
216
|
+
|
|
217
|
+
std::string GetName() const;
|
|
218
|
+
|
|
219
|
+
inline size_t GetPrecision() const { return precision_; }
|
|
220
|
+
|
|
221
|
+
private:
|
|
222
|
+
size_t precision_;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
class DateTimeType : public Type, public details::TypeWithTimeZoneMixin {
|
|
226
|
+
public:
|
|
227
|
+
explicit DateTimeType(std::string timezone);
|
|
228
|
+
|
|
229
|
+
std::string GetName() const;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
class DateTime64Type: public Type, public details::TypeWithTimeZoneMixin {
|
|
233
|
+
public:
|
|
234
|
+
explicit DateTime64Type(size_t precision, std::string timezone_);
|
|
235
|
+
|
|
236
|
+
std::string GetName() const;
|
|
237
|
+
|
|
238
|
+
inline size_t GetPrecision() const { return precision_; }
|
|
239
|
+
private:
|
|
240
|
+
size_t precision_;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
class EnumType : public Type {
|
|
244
|
+
public:
|
|
245
|
+
EnumType(Type::Code type, const std::vector<EnumItem>& items);
|
|
246
|
+
|
|
247
|
+
std::string GetName() const;
|
|
248
|
+
|
|
249
|
+
/// Methods to work with enum types.
|
|
250
|
+
std::string_view GetEnumName(int16_t value) const;
|
|
251
|
+
int16_t GetEnumValue(const std::string& name) const;
|
|
252
|
+
bool HasEnumName(const std::string& name) const;
|
|
253
|
+
bool HasEnumValue(int16_t value) const;
|
|
254
|
+
|
|
255
|
+
private:
|
|
256
|
+
using ValueToNameType = std::map<int16_t, std::string_view>;
|
|
257
|
+
using NameToValueType = std::map<std::string, int16_t>;
|
|
258
|
+
using ValueToNameIterator = ValueToNameType::const_iterator;
|
|
259
|
+
|
|
260
|
+
ValueToNameType value_to_name_;
|
|
261
|
+
NameToValueType name_to_value_;
|
|
262
|
+
|
|
263
|
+
public:
|
|
264
|
+
ValueToNameIterator BeginValueToName() const;
|
|
265
|
+
ValueToNameIterator EndValueToName() const;
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
class FixedStringType : public Type {
|
|
269
|
+
public:
|
|
270
|
+
explicit FixedStringType(size_t n);
|
|
271
|
+
|
|
272
|
+
std::string GetName() const { return std::string("FixedString(") + std::to_string(size_) + ")"; }
|
|
273
|
+
|
|
274
|
+
inline size_t GetSize() const { return size_; }
|
|
275
|
+
|
|
276
|
+
private:
|
|
277
|
+
size_t size_;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
class NullableType : public Type {
|
|
281
|
+
public:
|
|
282
|
+
explicit NullableType(TypeRef nested_type);
|
|
283
|
+
|
|
284
|
+
std::string GetName() const { return std::string("Nullable(") + nested_type_->GetName() + ")"; }
|
|
285
|
+
|
|
286
|
+
/// Type of nested nullable element.
|
|
287
|
+
TypeRef GetNestedType() const { return nested_type_; }
|
|
288
|
+
|
|
289
|
+
private:
|
|
290
|
+
TypeRef nested_type_;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
class TupleType : public Type {
|
|
294
|
+
public:
|
|
295
|
+
explicit TupleType(const std::vector<TypeRef>& item_types);
|
|
296
|
+
|
|
297
|
+
std::string GetName() const;
|
|
298
|
+
|
|
299
|
+
/// Type of nested Tuple element type.
|
|
300
|
+
std::vector<TypeRef> GetTupleType() const { return item_types_; }
|
|
301
|
+
|
|
302
|
+
private:
|
|
303
|
+
std::vector<TypeRef> item_types_;
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
class LowCardinalityType : public Type {
|
|
307
|
+
public:
|
|
308
|
+
explicit LowCardinalityType(TypeRef nested_type);
|
|
309
|
+
~LowCardinalityType();
|
|
310
|
+
|
|
311
|
+
std::string GetName() const { return std::string("LowCardinality(") + nested_type_->GetName() + ")"; }
|
|
312
|
+
|
|
313
|
+
/// Type of nested nullable element.
|
|
314
|
+
TypeRef GetNestedType() const { return nested_type_; }
|
|
315
|
+
|
|
316
|
+
private:
|
|
317
|
+
TypeRef nested_type_;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
class MapType : public Type {
|
|
321
|
+
public:
|
|
322
|
+
explicit MapType(TypeRef key_type, TypeRef value_type);
|
|
323
|
+
|
|
324
|
+
std::string GetName() const;
|
|
325
|
+
|
|
326
|
+
/// Type of keys.
|
|
327
|
+
TypeRef GetKeyType() const { return key_type_; }
|
|
328
|
+
|
|
329
|
+
/// Type of values.
|
|
330
|
+
TypeRef GetValueType() const { return value_type_; }
|
|
331
|
+
|
|
332
|
+
private:
|
|
333
|
+
TypeRef key_type_;
|
|
334
|
+
TypeRef value_type_;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
template <>
|
|
338
|
+
inline TypeRef Type::CreateSimple<int8_t>() {
|
|
339
|
+
return TypeRef(new Type(Int8));
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
template <>
|
|
343
|
+
inline TypeRef Type::CreateSimple<int16_t>() {
|
|
344
|
+
return TypeRef(new Type(Int16));
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
template <>
|
|
348
|
+
inline TypeRef Type::CreateSimple<int32_t>() {
|
|
349
|
+
return TypeRef(new Type(Int32));
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
template <>
|
|
353
|
+
inline TypeRef Type::CreateSimple<int64_t>() {
|
|
354
|
+
return TypeRef(new Type(Int64));
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
template <>
|
|
358
|
+
inline TypeRef Type::CreateSimple<Int128>() {
|
|
359
|
+
return TypeRef(new Type(Int128));
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
template <>
|
|
363
|
+
inline TypeRef Type::CreateSimple<UInt128>() {
|
|
364
|
+
return TypeRef(new Type(UInt128));
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
template <>
|
|
368
|
+
inline TypeRef Type::CreateSimple<uint8_t>() {
|
|
369
|
+
return TypeRef(new Type(UInt8));
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
template <>
|
|
373
|
+
inline TypeRef Type::CreateSimple<uint16_t>() {
|
|
374
|
+
return TypeRef(new Type(UInt16));
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
template <>
|
|
378
|
+
inline TypeRef Type::CreateSimple<uint32_t>() {
|
|
379
|
+
return TypeRef(new Type(UInt32));
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
template <>
|
|
383
|
+
inline TypeRef Type::CreateSimple<uint64_t>() {
|
|
384
|
+
return TypeRef(new Type(UInt64));
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
template <>
|
|
388
|
+
inline TypeRef Type::CreateSimple<float>() {
|
|
389
|
+
return TypeRef(new Type(Float32));
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
template <>
|
|
393
|
+
inline TypeRef Type::CreateSimple<double>() {
|
|
394
|
+
return TypeRef(new Type(Float64));
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
} // namespace clickhouse
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#define CLICKHOUSE_CPP_VERSION_MAJOR 2
|
|
4
|
+
#define CLICKHOUSE_CPP_VERSION_MINOR 6
|
|
5
|
+
#define CLICKHOUSE_CPP_VERSION_PATCH 1
|
|
6
|
+
|
|
7
|
+
#define CLICKHOUSE_CPP_VERSION_BUILD 0
|
|
8
|
+
|
|
9
|
+
// Expecting each version component to be less than 99
|
|
10
|
+
#define CLICKHOUSE_CPP_VERSION \
|
|
11
|
+
CLICKHOUSE_CPP_VERSION_MAJOR * 100 * 100 * 100 \
|
|
12
|
+
+ CLICKHOUSE_CPP_VERSION_MINOR * 100 * 100 \
|
|
13
|
+
+ CLICKHOUSE_CPP_VERSION_PATCH * 100 \
|
|
14
|
+
+ CLICKHOUSE_CPP_VERSION_BUILD
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
find_path(cityhash_INCLUDE_DIR
|
|
2
|
+
NAMES city.h
|
|
3
|
+
DOC "cityhash include directory")
|
|
4
|
+
mark_as_advanced(cityhash_INCLUDE_DIR)
|
|
5
|
+
find_library(cityhash_LIBRARY
|
|
6
|
+
NAMES cityhash libcityhash
|
|
7
|
+
DOC "cityhash library")
|
|
8
|
+
mark_as_advanced(cityhash_LIBRARY)
|
|
9
|
+
|
|
10
|
+
# Unlike lz4, cityhash's version information does not seem to be available.
|
|
11
|
+
|
|
12
|
+
include(FindPackageHandleStandardArgs)
|
|
13
|
+
find_package_handle_standard_args(cityhash
|
|
14
|
+
REQUIRED_VARS cityhash_LIBRARY cityhash_INCLUDE_DIR)
|
|
15
|
+
|
|
16
|
+
if (cityhash_FOUND)
|
|
17
|
+
set(cityhash_INCLUDE_DIRS "${cityhash_INCLUDE_DIR}")
|
|
18
|
+
set(cityhash_LIBRARIES "${cityhash_LIBRARY}")
|
|
19
|
+
|
|
20
|
+
if (NOT TARGET cityhash::cityhash)
|
|
21
|
+
add_library(cityhash::cityhash UNKNOWN IMPORTED)
|
|
22
|
+
set_target_properties(cityhash::cityhash PROPERTIES
|
|
23
|
+
IMPORTED_LOCATION "${cityhash_LIBRARY}"
|
|
24
|
+
INTERFACE_INCLUDE_DIRECTORIES "${cityhash_INCLUDE_DIR}")
|
|
25
|
+
endif ()
|
|
26
|
+
endif ()
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
find_path(lz4_INCLUDE_DIR
|
|
2
|
+
NAMES lz4.h
|
|
3
|
+
DOC "lz4 include directory")
|
|
4
|
+
mark_as_advanced(lz4_INCLUDE_DIR)
|
|
5
|
+
find_library(lz4_LIBRARY
|
|
6
|
+
NAMES lz4 liblz4
|
|
7
|
+
DOC "lz4 library")
|
|
8
|
+
mark_as_advanced(lz4_LIBRARY)
|
|
9
|
+
|
|
10
|
+
if (lz4_INCLUDE_DIR)
|
|
11
|
+
file(STRINGS "${lz4_INCLUDE_DIR}/lz4.h" _lz4_version_lines
|
|
12
|
+
REGEX "#define[ \t]+LZ4_VERSION_(MAJOR|MINOR|RELEASE)")
|
|
13
|
+
string(REGEX REPLACE ".*LZ4_VERSION_MAJOR *\([0-9]*\).*" "\\1" _lz4_version_major "${_lz4_version_lines}")
|
|
14
|
+
string(REGEX REPLACE ".*LZ4_VERSION_MINOR *\([0-9]*\).*" "\\1" _lz4_version_minor "${_lz4_version_lines}")
|
|
15
|
+
string(REGEX REPLACE ".*LZ4_VERSION_RELEASE *\([0-9]*\).*" "\\1" _lz4_version_release "${_lz4_version_lines}")
|
|
16
|
+
set(lz4_VERSION "${_lz4_version_major}.${_lz4_version_minor}.${_lz4_version_release}")
|
|
17
|
+
unset(_lz4_version_major)
|
|
18
|
+
unset(_lz4_version_minor)
|
|
19
|
+
unset(_lz4_version_release)
|
|
20
|
+
unset(_lz4_version_lines)
|
|
21
|
+
endif ()
|
|
22
|
+
|
|
23
|
+
include(FindPackageHandleStandardArgs)
|
|
24
|
+
find_package_handle_standard_args(lz4
|
|
25
|
+
REQUIRED_VARS lz4_LIBRARY lz4_INCLUDE_DIR
|
|
26
|
+
VERSION_VAR lz4_VERSION)
|
|
27
|
+
|
|
28
|
+
if (lz4_FOUND)
|
|
29
|
+
set(lz4_INCLUDE_DIRS "${lz4_INCLUDE_DIR}")
|
|
30
|
+
set(lz4_LIBRARIES "${lz4_LIBRARY}")
|
|
31
|
+
|
|
32
|
+
if (NOT TARGET lz4::lz4)
|
|
33
|
+
add_library(lz4::lz4 UNKNOWN IMPORTED)
|
|
34
|
+
set_target_properties(lz4::lz4 PROPERTIES
|
|
35
|
+
INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIRS}
|
|
36
|
+
IMPORTED_LOCATION "${lz4_LIBRARY}"
|
|
37
|
+
INTERFACE_INCLUDE_DIRECTORIES "${lz4_INCLUDE_DIR}")
|
|
38
|
+
endif ()
|
|
39
|
+
endif ()
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
find_path(zstd_INCLUDE_DIR
|
|
2
|
+
NAMES zstd.h
|
|
3
|
+
DOC "zstd include directory")
|
|
4
|
+
mark_as_advanced(zstd_INCLUDE_DIR)
|
|
5
|
+
find_library(zstd_LIBRARY
|
|
6
|
+
NAMES zstd libzstd
|
|
7
|
+
DOC "zstd library")
|
|
8
|
+
mark_as_advanced(zstd_LIBRARY)
|
|
9
|
+
|
|
10
|
+
if (zstd_INCLUDE_DIR)
|
|
11
|
+
file(STRINGS "${zstd_INCLUDE_DIR}/zstd.h" _zstd_version_lines
|
|
12
|
+
REGEX "#define[ \t]+ZSTD_VERSION_(MAJOR|MINOR|RELEASE)")
|
|
13
|
+
string(REGEX REPLACE ".*ZSTD_VERSION_MAJOR *\([0-9]*\).*" "\\1" _zstd_version_major "${_zstd_version_lines}")
|
|
14
|
+
string(REGEX REPLACE ".*ZSTD_VERSION_MINOR *\([0-9]*\).*" "\\1" _zstd_version_minor "${_zstd_version_lines}")
|
|
15
|
+
string(REGEX REPLACE ".*ZSTD_VERSION_RELEASE *\([0-9]*\).*" "\\1" _zstd_version_release "${_zstd_version_lines}")
|
|
16
|
+
set(zstd_VERSION "${_zstd_version_major}.${_zstd_version_minor}.${_zstd_version_release}")
|
|
17
|
+
unset(_zstd_version_major)
|
|
18
|
+
unset(_zstd_version_minor)
|
|
19
|
+
unset(_zstd_version_release)
|
|
20
|
+
unset(_zstd_version_lines)
|
|
21
|
+
endif ()
|
|
22
|
+
|
|
23
|
+
include(FindPackageHandleStandardArgs)
|
|
24
|
+
find_package_handle_standard_args(zstd
|
|
25
|
+
REQUIRED_VARS zstd_LIBRARY zstd_INCLUDE_DIR
|
|
26
|
+
VERSION_VAR zstd_VERSION)
|
|
27
|
+
|
|
28
|
+
if (zstd_FOUND)
|
|
29
|
+
set(zstd_INCLUDE_DIRS "${zstd_INCLUDE_DIR}")
|
|
30
|
+
set(zstd_LIBRARIES "${zstd_LIBRARY}")
|
|
31
|
+
|
|
32
|
+
if (NOT TARGET zstd::zstd)
|
|
33
|
+
add_library(zstd::zstd UNKNOWN IMPORTED)
|
|
34
|
+
set_target_properties(zstd::zstd PROPERTIES
|
|
35
|
+
INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIRS}
|
|
36
|
+
IMPORTED_LOCATION "${zstd_LIBRARY}"
|
|
37
|
+
INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}")
|
|
38
|
+
endif ()
|
|
39
|
+
endif ()
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Set version value for the project and validate that it matches version reported by git.
|
|
2
|
+
|
|
3
|
+
# Reference values are taken from the version.h.
|
|
4
|
+
# So even if the library code is decoupled from the cmake-specific project,
|
|
5
|
+
# source files still have proper version information.
|
|
6
|
+
|
|
7
|
+
function (regex_extract_matching_groups INPUT REGEX_STR)
|
|
8
|
+
string (REGEX MATCHALL "${REGEX_STR}" _ "${INPUT}")
|
|
9
|
+
if (NOT CMAKE_MATCH_0)
|
|
10
|
+
return()
|
|
11
|
+
endif()
|
|
12
|
+
|
|
13
|
+
set (MATCH_GROUP_INDEX 0)
|
|
14
|
+
foreach (OUTPUT_VAR ${ARGN})
|
|
15
|
+
math (EXPR MATCH_GROUP_INDEX "${MATCH_GROUP_INDEX}+1")
|
|
16
|
+
set (MATCH_GROUP_VALUE "${CMAKE_MATCH_${MATCH_GROUP_INDEX}}")
|
|
17
|
+
set ("${OUTPUT_VAR}" "${MATCH_GROUP_VALUE}" PARENT_SCOPE)
|
|
18
|
+
endforeach ()
|
|
19
|
+
endfunction ()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
function(clickhouse_cpp_get_version)
|
|
23
|
+
# Extract all components of the version from the clickhouse/version.h
|
|
24
|
+
|
|
25
|
+
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/clickhouse/version.h VERSION_FILE_DATA)
|
|
26
|
+
|
|
27
|
+
foreach (VERSION_COMPONENT
|
|
28
|
+
IN ITEMS
|
|
29
|
+
CLICKHOUSE_CPP_VERSION_MAJOR
|
|
30
|
+
CLICKHOUSE_CPP_VERSION_MINOR
|
|
31
|
+
CLICKHOUSE_CPP_VERSION_PATCH
|
|
32
|
+
CLICKHOUSE_CPP_VERSION_BUILD)
|
|
33
|
+
|
|
34
|
+
regex_extract_matching_groups(
|
|
35
|
+
"${VERSION_FILE_DATA}"
|
|
36
|
+
"#define ${VERSION_COMPONENT} ([0-9]+)"
|
|
37
|
+
"${VERSION_COMPONENT}")
|
|
38
|
+
|
|
39
|
+
set ("${VERSION_COMPONENT}" "${${VERSION_COMPONENT}}" PARENT_SCOPE)
|
|
40
|
+
endforeach ()
|
|
41
|
+
|
|
42
|
+
set(CLICKHOUSE_CPP_VERSION "${CLICKHOUSE_CPP_VERSION_MAJOR}.${CLICKHOUSE_CPP_VERSION_MINOR}.${CLICKHOUSE_CPP_VERSION_PATCH}" PARENT_SCOPE)
|
|
43
|
+
endfunction()
|
|
44
|
+
|
|
45
|
+
clickhouse_cpp_get_version()
|
|
46
|
+
|
|
47
|
+
function(clickhouse_cpp_check_library_version CHECK_MODE)
|
|
48
|
+
## Verify that current tag matches the version
|
|
49
|
+
|
|
50
|
+
find_program (GIT git)
|
|
51
|
+
if (GIT)
|
|
52
|
+
execute_process(
|
|
53
|
+
COMMAND ${GIT} describe --tags
|
|
54
|
+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
55
|
+
OUTPUT_VARIABLE GIT_DESCRIBE_DATA
|
|
56
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
regex_extract_matching_groups(
|
|
60
|
+
"${GIT_DESCRIBE_DATA}"
|
|
61
|
+
"^v([0-9]+)\\.([0-9]+)\\.([0-9]+)(\\-([0-9]+).*)?"
|
|
62
|
+
VERSION_FROM_GIT_DESCRIBE_MAJOR
|
|
63
|
+
VERSION_FROM_GIT_DESCRIBE_MINOR
|
|
64
|
+
VERSION_FROM_GIT_DESCRIBE_PATCH
|
|
65
|
+
CLICKHOUSE_CPP_VERSION_COMMIT
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
if (NOT (VERSION_FROM_GIT_DESCRIBE_MAJOR AND VERSION_FROM_GIT_DESCRIBE_MINOR AND VERSION_FROM_GIT_DESCRIBE_PATCH))
|
|
69
|
+
message (${CHECK_MODE} "version obtained from `git describe` doesn't look like a valid version: \"${GIT_DESCRIBE_DATA}\"")
|
|
70
|
+
return ()
|
|
71
|
+
endif ()
|
|
72
|
+
|
|
73
|
+
set (EXPECTED_CLICKHOUSE_CPP_VERSION "${VERSION_FROM_GIT_DESCRIBE_MAJOR}.${VERSION_FROM_GIT_DESCRIBE_MINOR}.${VERSION_FROM_GIT_DESCRIBE_PATCH}")
|
|
74
|
+
if (NOT "${EXPECTED_CLICKHOUSE_CPP_VERSION}" STREQUAL ${CLICKHOUSE_CPP_VERSION})
|
|
75
|
+
message(${CHECK_MODE} "update CLICKHOUSE_CPP_VERSION_ values in version.h.\n"
|
|
76
|
+
"git reports version as \"${GIT_DESCRIBE_DATA}\","
|
|
77
|
+
" hence expecting version to be ${EXPECTED_CLICKHOUSE_CPP_VERSION}, "
|
|
78
|
+
" instead got ${CLICKHOUSE_CPP_VERSION}")
|
|
79
|
+
endif ()
|
|
80
|
+
else ()
|
|
81
|
+
message (${CHECK_MODE} "git is not found, can't verify library version")
|
|
82
|
+
endif ()
|
|
83
|
+
|
|
84
|
+
message("Version check passed: ${CLICKHOUSE_CPP_VERSION}")
|
|
85
|
+
endfunction()
|
|
86
|
+
|
|
87
|
+
# clickhouse_cpp_check_library_version()
|