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,260 @@
|
|
|
1
|
+
ClickHouse C++ client [](https://github.com/ClickHouse/clickhouse-cpp/actions/workflows/linux.yml) [](https://github.com/ClickHouse/clickhouse-cpp/actions/workflows/macos.yml) [](https://github.com/ClickHouse/clickhouse-cpp/actions/workflows/windows_msvc.yml) [](https://github.com/ClickHouse/clickhouse-cpp/actions/workflows/windows_mingw.yml)
|
|
2
|
+
=====
|
|
3
|
+
|
|
4
|
+
C++ client for [ClickHouse](https://clickhouse.com/).
|
|
5
|
+
|
|
6
|
+
## Supported data types
|
|
7
|
+
|
|
8
|
+
* Array(T)
|
|
9
|
+
* Date
|
|
10
|
+
* DateTime, DateTime64
|
|
11
|
+
* DateTime([timezone]), DateTime64(N, [timezone])
|
|
12
|
+
* Decimal32, Decimal64, Decimal128
|
|
13
|
+
* Enum8, Enum16
|
|
14
|
+
* FixedString(N)
|
|
15
|
+
* Float32, Float64
|
|
16
|
+
* IPv4, IPv6
|
|
17
|
+
* Nullable(T)
|
|
18
|
+
* String
|
|
19
|
+
* LowCardinality(String) or LowCardinality(FixedString(N))
|
|
20
|
+
* Tuple
|
|
21
|
+
* UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64
|
|
22
|
+
* UInt128, Int128
|
|
23
|
+
* UUID
|
|
24
|
+
* Map
|
|
25
|
+
* Point, Ring, Polygon, MultiPolygon
|
|
26
|
+
|
|
27
|
+
## Dependencies
|
|
28
|
+
In the most basic case one needs only:
|
|
29
|
+
- a C++-17-complaint compiler,
|
|
30
|
+
- `cmake` (3.12 or newer), and
|
|
31
|
+
- `ninja`
|
|
32
|
+
|
|
33
|
+
Optional dependencies:
|
|
34
|
+
- openssl
|
|
35
|
+
- liblz4
|
|
36
|
+
- libabsl
|
|
37
|
+
- libzstd
|
|
38
|
+
|
|
39
|
+
## Building
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
$ mkdir build .
|
|
43
|
+
$ cd build
|
|
44
|
+
$ cmake .. [-DBUILD_TESTS=ON]
|
|
45
|
+
$ make
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Please refer to the workflows for the reference on dependencies/build options
|
|
49
|
+
- https://github.com/ClickHouse/clickhouse-cpp/blob/master/.github/workflows/linux.yml
|
|
50
|
+
- https://github.com/ClickHouse/clickhouse-cpp/blob/master/.github/workflows/windows_msvc.yml
|
|
51
|
+
- https://github.com/ClickHouse/clickhouse-cpp/blob/master/.github/workflows/windows_mingw.yml
|
|
52
|
+
- https://github.com/ClickHouse/clickhouse-cpp/blob/master/.github/workflows/macos.yml
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## Example application build with clickhouse-cpp
|
|
56
|
+
|
|
57
|
+
There are various ways to integrate clickhouse-cpp with the build system of an application. Below example uses the simple approach based on
|
|
58
|
+
submodules presented in https://www.youtube.com/watch?v=ED-WUk440qc .
|
|
59
|
+
|
|
60
|
+
- `mkdir clickhouse-app && cd clickhouse-app && git init`
|
|
61
|
+
- `git submodule add https://github.com/ClickHouse/clickhouse-cpp.git contribs/clickhouse-cpp`
|
|
62
|
+
- `touch app.cpp`, then copy the following C++ code into that file
|
|
63
|
+
|
|
64
|
+
```cpp
|
|
65
|
+
#include <iostream>
|
|
66
|
+
#include <clickhouse/client.h>
|
|
67
|
+
|
|
68
|
+
using namespace clickhouse;
|
|
69
|
+
|
|
70
|
+
int main()
|
|
71
|
+
{
|
|
72
|
+
/// Initialize client connection.
|
|
73
|
+
Client client(ClientOptions().SetHost("localhost"));
|
|
74
|
+
|
|
75
|
+
/// Create a table.
|
|
76
|
+
client.Execute("CREATE TABLE IF NOT EXISTS default.numbers (id UInt64, name String) ENGINE = Memory");
|
|
77
|
+
|
|
78
|
+
/// Insert some values.
|
|
79
|
+
{
|
|
80
|
+
Block block;
|
|
81
|
+
|
|
82
|
+
auto id = std::make_shared<ColumnUInt64>();
|
|
83
|
+
id->Append(1);
|
|
84
|
+
id->Append(7);
|
|
85
|
+
|
|
86
|
+
auto name = std::make_shared<ColumnString>();
|
|
87
|
+
name->Append("one");
|
|
88
|
+
name->Append("seven");
|
|
89
|
+
|
|
90
|
+
block.AppendColumn("id" , id);
|
|
91
|
+
block.AppendColumn("name", name);
|
|
92
|
+
|
|
93
|
+
client.Insert("default.numbers", block);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/// Select values inserted in the previous step.
|
|
97
|
+
client.Select("SELECT id, name FROM default.numbers", [] (const Block& block)
|
|
98
|
+
{
|
|
99
|
+
for (size_t i = 0; i < block.GetRowCount(); ++i) {
|
|
100
|
+
std::cout << block[0]->As<ColumnUInt64>()->At(i) << " "
|
|
101
|
+
<< block[1]->As<ColumnString>()->At(i) << "\n";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
/// Select values inserted in the previous step using external data feature
|
|
107
|
+
/// See https://clickhouse.com/docs/engines/table-engines/special/external-data
|
|
108
|
+
{
|
|
109
|
+
Block block1, block2;
|
|
110
|
+
auto id = std::make_shared<ColumnUInt64>();
|
|
111
|
+
id->Append(1);
|
|
112
|
+
block1.AppendColumn("id" , id);
|
|
113
|
+
|
|
114
|
+
auto name = std::make_shared<ColumnString>();
|
|
115
|
+
name->Append("seven");
|
|
116
|
+
block2.AppendColumn("name", name);
|
|
117
|
+
|
|
118
|
+
const std::string _1 = "_1";
|
|
119
|
+
const std::string _2 = "_2";
|
|
120
|
+
|
|
121
|
+
const ExternalTables external = {{_1, block1}, {_2, block2}};
|
|
122
|
+
client.SelectWithExternalData("SELECT id, name FROM default.numbers where id in (_1) or name in (_2)",
|
|
123
|
+
external, [] (const Block& block)
|
|
124
|
+
{
|
|
125
|
+
for (size_t i = 0; i < block.GetRowCount(); ++i) {
|
|
126
|
+
std::cout << block[0]->As<ColumnUInt64>()->At(i) << " "
|
|
127
|
+
<< block[1]->As<ColumnString>()->At(i) << "\n";
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/// Delete table.
|
|
134
|
+
client.Execute("DROP TABLE default.numbers");
|
|
135
|
+
|
|
136
|
+
return 0;
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
- `touch CMakeLists.txt`, then copy the following CMake code into that file
|
|
141
|
+
|
|
142
|
+
```cmake
|
|
143
|
+
cmake_minimum_required(VERSION 3.12)
|
|
144
|
+
project(application-example)
|
|
145
|
+
|
|
146
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
147
|
+
|
|
148
|
+
add_subdirectory(contribs/clickhouse-cpp)
|
|
149
|
+
|
|
150
|
+
add_executable(${PROJECT_NAME} "app.cpp")
|
|
151
|
+
|
|
152
|
+
target_include_directories(${PROJECT_NAME} PRIVATE contribs/clickhouse-cpp/ contribs/clickhouse-cpp/contrib/absl)
|
|
153
|
+
|
|
154
|
+
target_link_libraries(${PROJECT_NAME} PRIVATE clickhouse-cpp-lib)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
- run `rm -rf build && cmake -B build -S . && cmake --build build -j32` to remove remainders of the previous builds, run CMake and build the
|
|
158
|
+
application. The generated binary is located in location `build/application-example`.
|
|
159
|
+
|
|
160
|
+
## Batch Insertion
|
|
161
|
+
|
|
162
|
+
In addition to the `Insert` method, which inserts all the data in a block in a
|
|
163
|
+
single call, you can use the `BeginInsert` / `InsertData` / `EndInsert`
|
|
164
|
+
pattern to insert batches of data. This can be useful for managing larger data
|
|
165
|
+
sets without inflating memory with the entire set.
|
|
166
|
+
|
|
167
|
+
To use it pass `BeginInsert` an `INSERT` statement ending in `VALUES` but with
|
|
168
|
+
no actual values. Use the resulting `Block` to append batches of data, sending
|
|
169
|
+
each to the sever with `InsertData`. Finally, call `EndInsert` (or let the
|
|
170
|
+
client go out of scope) to signal the server that insertion is complete.
|
|
171
|
+
Example:
|
|
172
|
+
|
|
173
|
+
```cpp
|
|
174
|
+
// Start the insertion.
|
|
175
|
+
auto block = client->BeginInsert("INSERT INTO foo (id, name) VALUES");
|
|
176
|
+
|
|
177
|
+
// Grab the columns from the block.
|
|
178
|
+
auto col1 = block[0]->As<ColumnUInt64>();
|
|
179
|
+
auto col2 = block[1]->As<ColumnString>();
|
|
180
|
+
|
|
181
|
+
// Add a couple of records to the block.
|
|
182
|
+
col1.Append(1);
|
|
183
|
+
col1.Append(2);
|
|
184
|
+
col2.Append("holden");
|
|
185
|
+
col2.Append("naomi");
|
|
186
|
+
|
|
187
|
+
// Send those records.
|
|
188
|
+
block.RefreshRowCount();
|
|
189
|
+
client->InsertData(block);
|
|
190
|
+
block.Clear();
|
|
191
|
+
|
|
192
|
+
// Add another record.
|
|
193
|
+
col1.Append(3);
|
|
194
|
+
col2.Append("amos");
|
|
195
|
+
|
|
196
|
+
// Send it and finish.
|
|
197
|
+
block.RefreshRowCount();
|
|
198
|
+
client->EndInsert(block);
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Thread-safety
|
|
202
|
+
⚠ Please note that `Client` instance is NOT thread-safe. I.e. you must create a separate `Client` for each thread or utilize some synchronization techniques. ⚠
|
|
203
|
+
|
|
204
|
+
## Retries
|
|
205
|
+
If you wish to implement some retry logic atop of `clickhouse::Client` there are few simple rules to make you life easier:
|
|
206
|
+
- If previous attempt threw an exception, then make sure to call `clickhouse::Client::ResetConnection()` before the next try.
|
|
207
|
+
- For `clickhouse::Client::Insert()` you can reuse a block from previous try, no need to rebuild it from scratch.
|
|
208
|
+
|
|
209
|
+
See https://github.com/ClickHouse/clickhouse-cpp/issues/184 for details.
|
|
210
|
+
|
|
211
|
+
## Asynchronous inserts
|
|
212
|
+
See https://clickhouse.com/docs/en/cloud/bestpractices/asynchronous-inserts for details.
|
|
213
|
+
|
|
214
|
+
⚠ The asynchronous setting is different according to the clickhouse-server version. The under example with clickhouse-server version 24.8.4.13. ⚠
|
|
215
|
+
|
|
216
|
+
> Our strong recommendation is to use async_insert=1,wait_for_async_insert=1 if using asynchronous inserts. Using wait_for_async_insert=0 is very risky because your INSERT client may not be aware if there are errors, and also can cause potential overload if your client continues to write quickly in a situation where the ClickHouse server needs to slow down the writes and create some backpressure in order to ensure reliability of the service.
|
|
217
|
+
|
|
218
|
+
- Only use the SDK, do not need to change the clickhouse-server config. Asynchronous inserts only work if the data is sent as SQL text format. Here is the example.
|
|
219
|
+
```cpp
|
|
220
|
+
// You can specify the asynchronous insert settings by using the SETTINGS clause of insert queries
|
|
221
|
+
clickhouse::Query query("INSERT INTO default.test SETTINGS async_insert=1,wait_for_async_insert=1,async_insert_busy_timeout_ms=5000,async_insert_use_adaptive_busy_timeout=0,async_insert_max_data_size=104857600 VALUES(10,10)");
|
|
222
|
+
client.Execute(query);
|
|
223
|
+
|
|
224
|
+
// Or by SetSetting
|
|
225
|
+
clickhouse::Query query("INSERT INTO default.test VALUES(10,10)");
|
|
226
|
+
query.SetSetting("async_insert", clickhouse::QuerySettingsField{ "1", 1 });
|
|
227
|
+
query.SetSetting("wait_for_async_insert", clickhouse::QuerySettingsField{ "1", 1 }); // strong recommendation
|
|
228
|
+
query.SetSetting("async_insert_busy_timeout_ms", clickhouse::QuerySettingsField{ "5000", 1 });
|
|
229
|
+
query.SetSetting("async_insert_max_data_size", clickhouse::QuerySettingsField{ "104857600", 1 });
|
|
230
|
+
query.SetSetting("async_insert_use_adaptive_busy_timeout", clickhouse::QuerySettingsField{ "0", 1 });
|
|
231
|
+
client.Execute(query);
|
|
232
|
+
|
|
233
|
+
// Not available case. The Insert interface actually use the native data format
|
|
234
|
+
clickhouse::Block block;
|
|
235
|
+
client.Insert("default.test", block);
|
|
236
|
+
```
|
|
237
|
+
- Change the clickhouse-server users.xml, enable asynchronous inserts (available for the native data format). Here is the example.
|
|
238
|
+
```xml
|
|
239
|
+
<profiles>
|
|
240
|
+
<!-- Default settings. -->
|
|
241
|
+
<default>
|
|
242
|
+
<async_insert>1</async_insert>
|
|
243
|
+
<wait_for_async_insert>1</wait_for_async_insert>
|
|
244
|
+
<async_insert_use_adaptive_busy_timeout>0</async_insert_use_adaptive_busy_timeout>
|
|
245
|
+
<async_insert_busy_timeout_ms>5000</async_insert_busy_timeout_ms>
|
|
246
|
+
<async_insert_max_data_size>104857600</async_insert_max_data_size>
|
|
247
|
+
</default>
|
|
248
|
+
|
|
249
|
+
<!-- Profile that allows only read queries. -->
|
|
250
|
+
<readonly>
|
|
251
|
+
<readonly>1</readonly>
|
|
252
|
+
</readonly>
|
|
253
|
+
</profiles>
|
|
254
|
+
```
|
|
255
|
+
- Enabling asynchronous inserts at the user level. Ensure your login account has the privileges about ALTER USER. Then you can use insert_account for asynchronous inserts.
|
|
256
|
+
```sql
|
|
257
|
+
ALTER USER insert_account SETTINGS async_insert=1,wait_for_async_insert=1,async_insert_use_adaptive_busy_timeout=0,async_insert_busy_timeout_ms=5000,async_insert_max_data_size=104857600
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
SET ( clickhouse-cpp-lib-src
|
|
2
|
+
base/compressed.cpp
|
|
3
|
+
base/input.cpp
|
|
4
|
+
base/output.cpp
|
|
5
|
+
base/platform.cpp
|
|
6
|
+
base/socket.cpp
|
|
7
|
+
base/wire_format.cpp
|
|
8
|
+
base/endpoints_iterator.cpp
|
|
9
|
+
|
|
10
|
+
columns/array.cpp
|
|
11
|
+
columns/column.cpp
|
|
12
|
+
columns/date.cpp
|
|
13
|
+
columns/decimal.cpp
|
|
14
|
+
columns/enum.cpp
|
|
15
|
+
columns/factory.cpp
|
|
16
|
+
columns/geo.cpp
|
|
17
|
+
columns/ip4.cpp
|
|
18
|
+
columns/ip6.cpp
|
|
19
|
+
columns/lowcardinality.cpp
|
|
20
|
+
columns/nullable.cpp
|
|
21
|
+
columns/numeric.cpp
|
|
22
|
+
columns/map.cpp
|
|
23
|
+
columns/string.cpp
|
|
24
|
+
columns/tuple.cpp
|
|
25
|
+
columns/time.cpp
|
|
26
|
+
columns/uuid.cpp
|
|
27
|
+
|
|
28
|
+
columns/itemview.cpp
|
|
29
|
+
|
|
30
|
+
types/type_parser.cpp
|
|
31
|
+
types/types.cpp
|
|
32
|
+
|
|
33
|
+
block.cpp
|
|
34
|
+
client.cpp
|
|
35
|
+
query.cpp
|
|
36
|
+
|
|
37
|
+
# Headers
|
|
38
|
+
base/buffer.h
|
|
39
|
+
base/compressed.h
|
|
40
|
+
base/endpoints_iterator.h
|
|
41
|
+
base/input.h
|
|
42
|
+
base/open_telemetry.h
|
|
43
|
+
base/output.h
|
|
44
|
+
base/platform.h
|
|
45
|
+
base/projected_iterator.h
|
|
46
|
+
base/singleton.h
|
|
47
|
+
base/socket.h
|
|
48
|
+
base/sslsocket.h
|
|
49
|
+
base/string_utils.h
|
|
50
|
+
base/string_view.h
|
|
51
|
+
base/uuid.h
|
|
52
|
+
base/wire_format.h
|
|
53
|
+
|
|
54
|
+
columns/array.h
|
|
55
|
+
columns/column.h
|
|
56
|
+
columns/date.h
|
|
57
|
+
columns/decimal.h
|
|
58
|
+
columns/enum.h
|
|
59
|
+
columns/factory.h
|
|
60
|
+
columns/geo.h
|
|
61
|
+
columns/ip4.h
|
|
62
|
+
columns/ip6.h
|
|
63
|
+
columns/itemview.h
|
|
64
|
+
columns/lowcardinality.h
|
|
65
|
+
columns/lowcardinalityadaptor.h
|
|
66
|
+
columns/map.h
|
|
67
|
+
columns/nothing.h
|
|
68
|
+
columns/nullable.h
|
|
69
|
+
columns/numeric.h
|
|
70
|
+
columns/string.h
|
|
71
|
+
columns/time.h
|
|
72
|
+
columns/tuple.h
|
|
73
|
+
columns/utils.h
|
|
74
|
+
columns/uuid.h
|
|
75
|
+
|
|
76
|
+
types/type_parser.h
|
|
77
|
+
types/types.h
|
|
78
|
+
|
|
79
|
+
block.h
|
|
80
|
+
client.h
|
|
81
|
+
error_codes.h
|
|
82
|
+
exceptions.h
|
|
83
|
+
protocol.h
|
|
84
|
+
query.h
|
|
85
|
+
server_exception.h
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
if (MSVC)
|
|
89
|
+
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
|
90
|
+
add_compile_options(/W4)
|
|
91
|
+
# remove in 3.0
|
|
92
|
+
add_compile_options(/wd4996)
|
|
93
|
+
else()
|
|
94
|
+
set(cxx_extra_wall "-Wempty-body -Wconversion -Wreturn-type -Wparentheses -Wuninitialized -Wunreachable-code -Wunused-function -Wunused-value -Wunused-variable")
|
|
95
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${cxx_extra_wall}")
|
|
96
|
+
|
|
97
|
+
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
|
98
|
+
# a little abnormal when clang check conversion
|
|
99
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${cxx_extra_wall} -Wno-conversion")
|
|
100
|
+
endif()
|
|
101
|
+
endif()
|
|
102
|
+
|
|
103
|
+
IF (WITH_OPENSSL)
|
|
104
|
+
LIST(APPEND clickhouse-cpp-lib-src base/sslsocket.cpp)
|
|
105
|
+
ENDIF ()
|
|
106
|
+
|
|
107
|
+
ADD_LIBRARY (clickhouse-cpp-lib ${clickhouse-cpp-lib-src}
|
|
108
|
+
version.h)
|
|
109
|
+
SET_TARGET_PROPERTIES (clickhouse-cpp-lib
|
|
110
|
+
PROPERTIES
|
|
111
|
+
LINKER_LANGUAGE CXX
|
|
112
|
+
VERSION ${CLICKHOUSE_CPP_VERSION}
|
|
113
|
+
)
|
|
114
|
+
TARGET_LINK_LIBRARIES (clickhouse-cpp-lib
|
|
115
|
+
absl::int128
|
|
116
|
+
cityhash::cityhash
|
|
117
|
+
lz4::lz4
|
|
118
|
+
zstd::zstd
|
|
119
|
+
)
|
|
120
|
+
TARGET_INCLUDE_DIRECTORIES (clickhouse-cpp-lib
|
|
121
|
+
PUBLIC ${PROJECT_SOURCE_DIR}
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
IF (NOT BUILD_SHARED_LIBS)
|
|
125
|
+
ADD_LIBRARY (clickhouse-cpp-lib-static ALIAS clickhouse-cpp-lib)
|
|
126
|
+
ELSE ()
|
|
127
|
+
SET_TARGET_PROPERTIES (clickhouse-cpp-lib
|
|
128
|
+
PROPERTIES
|
|
129
|
+
SO_VERSION ${CLICKHOUSE_CPP_VERSION}
|
|
130
|
+
SO_VERSION ${CLICKHOUSE_CPP_VERSION_MAJOR}
|
|
131
|
+
)
|
|
132
|
+
ENDIF ()
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
IF (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT DISABLE_CLANG_LIBC_WORKAROUND)
|
|
136
|
+
INCLUDE (CheckCXXSourceCompiles)
|
|
137
|
+
|
|
138
|
+
CHECK_CXX_SOURCE_COMPILES("#include <bits/c++config.h>\nint main() { return __GLIBCXX__ != 0; }"
|
|
139
|
+
BUILDING_WITH_LIB_STDCXX)
|
|
140
|
+
|
|
141
|
+
IF (BUILDING_WITH_LIB_STDCXX)
|
|
142
|
+
# there is a problem with __builtin_mul_overflow call at link time
|
|
143
|
+
# the error looks like: ... undefined reference to `__muloti4' ...
|
|
144
|
+
# caused by clang bug https://bugs.llvm.org/show_bug.cgi?id=16404
|
|
145
|
+
# explicit linking to compiler-rt allows to workaround the problem
|
|
146
|
+
SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --rtlib=compiler-rt")
|
|
147
|
+
|
|
148
|
+
# some workaround for linking issues on linux:
|
|
149
|
+
# /usr/bin/ld: CMakeFiles/simple-test.dir/main.cpp.o: undefined reference to symbol '_Unwind_Resume@@GCC_3.0'
|
|
150
|
+
# /usr/bin/ld: /lib/x86_64-linux-gnu/libgcc_s.so.1: error adding symbols: DSO missing from command line
|
|
151
|
+
# FIXME: that workaround breaks clang build on mingw
|
|
152
|
+
TARGET_LINK_LIBRARIES (clickhouse-cpp-lib gcc_s)
|
|
153
|
+
ENDIF ()
|
|
154
|
+
ENDIF ()
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
INSTALL (TARGETS clickhouse-cpp-lib
|
|
158
|
+
ARCHIVE DESTINATION lib
|
|
159
|
+
LIBRARY DESTINATION lib
|
|
160
|
+
)
|
|
161
|
+
IF (NOT BUILD_SHARED_LIBS)
|
|
162
|
+
IF (NOT WITH_SYSTEM_CITYHASH)
|
|
163
|
+
INSTALL (TARGETS cityhash
|
|
164
|
+
ARCHIVE DESTINATION lib
|
|
165
|
+
LIBRARY DESTINATION lib
|
|
166
|
+
)
|
|
167
|
+
ENDIF()
|
|
168
|
+
IF (NOT WITH_SYSTEM_LZ4)
|
|
169
|
+
INSTALL (TARGETS lz4
|
|
170
|
+
ARCHIVE DESTINATION lib
|
|
171
|
+
LIBRARY DESTINATION lib
|
|
172
|
+
)
|
|
173
|
+
ENDIF()
|
|
174
|
+
IF (NOT WITH_SYSTEM_ZSTD)
|
|
175
|
+
INSTALL (TARGETS zstdstatic
|
|
176
|
+
ARCHIVE DESTINATION lib
|
|
177
|
+
LIBRARY DESTINATION lib
|
|
178
|
+
)
|
|
179
|
+
ENDIF()
|
|
180
|
+
IF (NOT WITH_SYSTEM_ABSEIL)
|
|
181
|
+
INSTALL (TARGETS absl_int128
|
|
182
|
+
ARCHIVE DESTINATION lib
|
|
183
|
+
LIBRARY DESTINATION lib
|
|
184
|
+
)
|
|
185
|
+
ENDIF()
|
|
186
|
+
ENDIF()
|
|
187
|
+
|
|
188
|
+
# general
|
|
189
|
+
INSTALL(FILES block.h DESTINATION include/clickhouse/)
|
|
190
|
+
INSTALL(FILES client.h DESTINATION include/clickhouse/)
|
|
191
|
+
INSTALL(FILES error_codes.h DESTINATION include/clickhouse/)
|
|
192
|
+
INSTALL(FILES exceptions.h DESTINATION include/clickhouse/)
|
|
193
|
+
INSTALL(FILES server_exception.h DESTINATION include/clickhouse/)
|
|
194
|
+
INSTALL(FILES protocol.h DESTINATION include/clickhouse/)
|
|
195
|
+
INSTALL(FILES query.h DESTINATION include/clickhouse/)
|
|
196
|
+
INSTALL(FILES version.h DESTINATION include/clickhouse/)
|
|
197
|
+
|
|
198
|
+
# base
|
|
199
|
+
INSTALL(FILES base/buffer.h DESTINATION include/clickhouse/base/)
|
|
200
|
+
INSTALL(FILES base/compressed.h DESTINATION include/clickhouse/base/)
|
|
201
|
+
INSTALL(FILES base/input.h DESTINATION include/clickhouse/base/)
|
|
202
|
+
INSTALL(FILES base/open_telemetry.h DESTINATION include/clickhouse/base/)
|
|
203
|
+
INSTALL(FILES base/output.h DESTINATION include/clickhouse/base/)
|
|
204
|
+
INSTALL(FILES base/platform.h DESTINATION include/clickhouse/base/)
|
|
205
|
+
INSTALL(FILES base/projected_iterator.h DESTINATION include/clickhouse/base/)
|
|
206
|
+
INSTALL(FILES base/singleton.h DESTINATION include/clickhouse/base/)
|
|
207
|
+
INSTALL(FILES base/socket.h DESTINATION include/clickhouse/base/)
|
|
208
|
+
INSTALL(FILES base/string_utils.h DESTINATION include/clickhouse/base/)
|
|
209
|
+
INSTALL(FILES base/string_view.h DESTINATION include/clickhouse/base/)
|
|
210
|
+
INSTALL(FILES base/uuid.h DESTINATION include/clickhouse/base/)
|
|
211
|
+
INSTALL(FILES base/wire_format.h DESTINATION include/clickhouse/base/)
|
|
212
|
+
INSTALL(FILES base/endpoints_iterator.h DESTINATION include/clickhouse/base/)
|
|
213
|
+
|
|
214
|
+
# columns
|
|
215
|
+
INSTALL(FILES columns/array.h DESTINATION include/clickhouse/columns/)
|
|
216
|
+
INSTALL(FILES columns/column.h DESTINATION include/clickhouse/columns/)
|
|
217
|
+
INSTALL(FILES columns/date.h DESTINATION include/clickhouse/columns/)
|
|
218
|
+
INSTALL(FILES columns/decimal.h DESTINATION include/clickhouse/columns/)
|
|
219
|
+
INSTALL(FILES columns/enum.h DESTINATION include/clickhouse/columns/)
|
|
220
|
+
INSTALL(FILES columns/factory.h DESTINATION include/clickhouse/columns/)
|
|
221
|
+
INSTALL(FILES columns/geo.h DESTINATION include/clickhouse/columns/)
|
|
222
|
+
INSTALL(FILES columns/ip4.h DESTINATION include/clickhouse/columns/)
|
|
223
|
+
INSTALL(FILES columns/ip6.h DESTINATION include/clickhouse/columns/)
|
|
224
|
+
INSTALL(FILES columns/itemview.h DESTINATION include/clickhouse/columns/)
|
|
225
|
+
INSTALL(FILES columns/lowcardinality.h DESTINATION include/clickhouse/columns/)
|
|
226
|
+
INSTALL(FILES columns/nothing.h DESTINATION include/clickhouse/columns/)
|
|
227
|
+
INSTALL(FILES columns/nullable.h DESTINATION include/clickhouse/columns/)
|
|
228
|
+
INSTALL(FILES columns/numeric.h DESTINATION include/clickhouse/columns/)
|
|
229
|
+
INSTALL(FILES columns/map.h DESTINATION include/clickhouse/columns/)
|
|
230
|
+
INSTALL(FILES columns/string.h DESTINATION include/clickhouse/columns/)
|
|
231
|
+
INSTALL(FILES columns/time.h DESTINATION include/clickhouse/columns/)
|
|
232
|
+
INSTALL(FILES columns/tuple.h DESTINATION include/clickhouse/columns/)
|
|
233
|
+
INSTALL(FILES columns/utils.h DESTINATION include/clickhouse/columns/)
|
|
234
|
+
INSTALL(FILES columns/uuid.h DESTINATION include/clickhouse/columns/)
|
|
235
|
+
|
|
236
|
+
# types
|
|
237
|
+
INSTALL(FILES types/type_parser.h DESTINATION include/clickhouse/types/)
|
|
238
|
+
INSTALL(FILES types/types.h DESTINATION include/clickhouse/types/)
|
|
239
|
+
|
|
240
|
+
IF (WITH_OPENSSL)
|
|
241
|
+
TARGET_LINK_LIBRARIES (clickhouse-cpp-lib OpenSSL::SSL)
|
|
242
|
+
ENDIF ()
|
|
243
|
+
|
|
244
|
+
IF (WIN32 OR MINGW)
|
|
245
|
+
TARGET_LINK_LIBRARIES (clickhouse-cpp-lib wsock32 ws2_32)
|
|
246
|
+
ENDIF ()
|