From 2809f797188135259a403203d670a4ceee9a5abf Mon Sep 17 00:00:00 2001 From: mzitnik Date: Wed, 17 Jul 2024 15:25:13 +0300 Subject: [PATCH 1/3] Change package from xenon.clickhouse to com.clickhouse --- build.gradle | 2 +- .../src/test/resources/log4j.properties | 2 +- .../{xenon => com}/clickhouse/HashSuite.scala | 9 ++++---- .../clickhouse/UtilsClickHouseSuite.scala | 5 ++--- .../ClickHouseSQL.g4 | 0 .../exception/ClickHouseErrCode.java | 2 +- .../hash/cityhash/CityHash_v1_0_2.java | 2 +- .../clickhouse/hash/cityhash/UInt128.java | 2 +- .../clickhouse/JsonProtocol.scala | 2 +- .../{xenon => com}/clickhouse/Logging.scala | 2 +- .../{xenon => com}/clickhouse/Utils.scala | 2 +- .../clickhouse/client/ClusterClient.scala | 8 +++---- .../clickhouse/client/NodeClient.scala | 11 +++++----- .../clickhouse/client/NodesClient.scala | 9 ++++---- .../clickhouse/exception/CHException.scala | 4 ++-- .../clickhouse/expr/Expressions.scala | 2 +- .../clickhouse/format/InputFormat.scala | 2 +- .../clickhouse/format/JSONOutputFormat.scala | 6 +++--- .../clickhouse/format/OutputFormat.scala | 2 +- .../clickhouse/hash/CityHash64.scala | 4 ++-- .../clickhouse/hash/HashFunc.scala | 2 +- .../clickhouse/hash/HashUtils.scala | 2 +- .../clickhouse/hash/Murmurhash2_32.scala | 2 +- .../clickhouse/hash/Murmurhash2_64.scala | 2 +- .../clickhouse/hash/Murmurhash3_32.scala | 2 +- .../clickhouse/hash/Murmurhash3_64.scala | 2 +- .../io/ForwardingOutputStream.scala | 2 +- .../clickhouse/io/ForwardingWriter.scala | 2 +- .../io/ObservableOutputStream.scala | 5 ++--- .../clickhouse/parse/AstVisitor.scala | 15 +++++++------ .../clickhouse/parse/ParseUtils.scala | 2 +- .../clickhouse/parse/SQLParser.scala | 9 ++++---- .../clickhouse/spec/DatabaseSpec.scala | 7 +++---- .../clickhouse/spec/NodeSpec.scala | 6 +++--- .../clickhouse/spec/PartitionSpec.scala | 4 ++-- .../clickhouse/spec/ShardUtils.scala | 2 +- .../clickhouse/spec/TableEngineSpec.scala | 5 +++-- .../clickhouse/spec/TableEngineUtils.scala | 8 +++---- .../clickhouse/spec/TableSpec.scala | 7 +++---- .../src/test/resources/log4j.properties | 2 +- .../clickhouse/UtilsSuite.scala | 4 ++-- .../clickhouse/parse/SQLParserSuite.scala | 8 ++++--- .../clickhouse/spec/NodeSpecHelper.scala | 2 +- .../clickhouse/spec/NodeSpecSuite.scala | 2 +- .../clickhouse/spec/ShardUtilsSuite.scala | 2 +- .../base/ClickHouseClusterMixIn.scala | 6 +++--- .../base/ClickHouseSingleMixIn.scala | 9 ++++---- docker/conf/spark-defaults.conf | 8 +++---- docs/best_practices/01_deployment.md | 4 ++-- .../01_catalog_configurations.md | 6 +++--- docs/quick_start/02_play_with_spark_sql.md | 2 +- docs/quick_start/03_play_with_spark_shell.md | 4 ++-- .../src/test/resources/log4j2.xml | 2 +- .../spark/sql/clickhouse/SparkTest.scala | 2 +- .../cluster/SparkClickHouseClusterTest.scala | 10 ++++----- .../single/SparkClickHouseSingleTest.scala | 4 ++-- .../clickhouse/ClickHouseCatalog.scala | 14 ++++++------- .../clickhouse/ClickHouseCommandRunner.scala | 4 ++-- .../clickhouse/ClickHouseHelper.scala | 12 +++++------ .../clickhouse/ClickHouseTable.scala | 14 ++++++------- .../scala/com}/clickhouse/CommitMessage.scala | 2 +- .../scala/com}/clickhouse/Constants.scala | 2 +- .../main/scala/com}/clickhouse/Metrics.scala | 4 ++-- .../{xenon => com}/clickhouse/SQLHelper.scala | 4 ++-- .../clickhouse/func/ClickHouseXxHash64.scala | 4 ++-- .../clickhouse/func/FunctionRegistry.scala | 2 +- .../read/ClickHouseMetadataColumn.scala | 2 +- .../com}/clickhouse/read/ClickHouseRead.scala | 12 +++++------ .../clickhouse/read/ClickHouseReader.scala | 10 ++++----- .../clickhouse/read/InputPartitions.scala | 4 ++-- .../clickhouse/read/ScanJobDescription.scala | 4 ++-- .../read/format/ClickHouseBinaryReader.scala | 6 +++--- .../read/format/ClickHouseJsonReader.scala | 10 ++++----- .../clickhouse/write/ClickHouseWrite.scala | 8 +++---- .../clickhouse/write/ClickHouseWriter.scala | 14 ++++++------- .../write/WriteJobDescription.scala | 6 +++--- .../format/ClickHouseArrowStreamWriter.scala | 4 ++-- .../format/ClickHouseJsonEachRowWriter.scala | 4 ++-- .../sql/clickhouse/ClickHouseSQLConf.scala | 2 +- .../spark/sql/clickhouse/ExprUtils.scala | 4 ++-- .../spark/sql/clickhouse/SchemaUtils.scala | 2 +- .../src/test/resources/log4j2.xml | 2 +- .../clickhouse/ClickHouseHelperSuite.scala | 2 +- .../src/test/resources/log4j2.xml | 2 +- .../spark/sql/clickhouse/SparkTest.scala | 2 +- .../ClickHouseClusterHashUDFSuite.scala | 2 +- .../cluster/SparkClickHouseClusterTest.scala | 10 ++++----- .../single/SparkClickHouseSingleTest.scala | 4 ++-- .../com}/clickhouse/ClickHouseCatalog.scala | 14 ++++++------- .../clickhouse/ClickHouseCommandRunner.scala | 4 ++-- .../clickhouse/ClickHouseHelper.scala | 12 +++++------ .../clickhouse/ClickHouseTable.scala | 16 +++++++------- .../scala/com}/clickhouse/CommitMessage.scala | 2 +- .../scala/com}/clickhouse/Constants.scala | 2 +- .../main/scala/com}/clickhouse/Metrics.scala | 4 ++-- .../scala/com}/clickhouse/SQLHelper.scala | 4 ++-- .../com}/clickhouse/func/CityHash64.scala | 4 ++-- .../clickhouse/func/FunctionRegistry.scala | 2 +- .../clickhouse/func/MultiStringArgsHash.scala | 2 +- .../com}/clickhouse/func/MurmurHash2.scala | 6 +++--- .../com}/clickhouse/func/MurmurHash3.scala | 6 +++--- .../scala/com}/clickhouse/func/XxHash64.scala | 4 ++-- .../read/ClickHouseMetadataColumn.scala | 2 +- .../com}/clickhouse/read/ClickHouseRead.scala | 12 +++++------ .../clickhouse/read/ClickHouseReader.scala | 10 ++++----- .../clickhouse/read/InputPartitions.scala | 4 ++-- .../clickhouse/read/ScanJobDescription.scala | 4 ++-- .../read/format/ClickHouseBinaryReader.scala | 6 +++--- .../read/format/ClickHouseJsonReader.scala | 10 ++++----- .../clickhouse/write/ClickHouseWrite.scala | 8 +++---- .../clickhouse/write/ClickHouseWriter.scala | 14 ++++++------- .../write/WriteJobDescription.scala | 8 +++---- .../format/ClickHouseArrowStreamWriter.scala | 4 ++-- .../format/ClickHouseJsonEachRowWriter.scala | 4 ++-- .../sql/clickhouse/ClickHouseSQLConf.scala | 2 +- .../spark/sql/clickhouse/ExprUtils.scala | 8 +++---- .../spark/sql/clickhouse/SchemaUtils.scala | 2 +- .../src/test/resources/log4j2.xml | 2 +- .../clickhouse/ClickHouseHelperSuite.scala | 2 +- .../sql/clickhouse/ConfigurationSuite.scala | 2 +- .../clickhouse/FunctionRegistrySuite.scala | 2 +- .../src/test/resources/log4j2.xml | 2 +- .../spark/sql/clickhouse/SparkTest.scala | 2 +- .../ClickHouseClusterHashUDFSuite.scala | 2 +- .../cluster/SparkClickHouseClusterTest.scala | 10 ++++----- .../single/SparkClickHouseSingleTest.scala | 4 ++-- .../com}/clickhouse/ClickHouseCatalog.scala | 20 ++++++++++-------- .../clickhouse/ClickHouseCommandRunner.scala | 6 +++--- .../clickhouse/ClickHouseHelper.scala | 14 ++++++------- .../clickhouse/ClickHouseTable.scala | 21 ++++++++++--------- .../scala/com}/clickhouse/CommitMessage.scala | 2 +- .../{xenon => com}/clickhouse/Constants.scala | 2 +- .../main/scala/com}/clickhouse/Metrics.scala | 4 ++-- .../scala/com}/clickhouse/SQLHelper.scala | 4 ++-- .../com}/clickhouse/func/CityHash64.scala | 4 ++-- .../clickhouse/func/FunctionRegistry.scala | 2 +- .../clickhouse/func/MultiStringArgsHash.scala | 2 +- .../com}/clickhouse/func/MurmurHash2.scala | 10 ++++----- .../com}/clickhouse/func/MurmurHash3.scala | 10 ++++----- .../scala/com}/clickhouse/func/XxHash64.scala | 4 ++-- .../read/ClickHouseMetadataColumn.scala | 2 +- .../com}/clickhouse/read/ClickHouseRead.scala | 14 +++++++------ .../clickhouse/read/ClickHouseReader.scala | 11 +++++----- .../clickhouse/read/InputPartitions.scala | 5 +++-- .../clickhouse/read/ScanJobDescription.scala | 5 +++-- .../read/format/ClickHouseBinaryReader.scala | 6 +++--- .../read/format/ClickHouseJsonReader.scala | 10 ++++----- .../clickhouse/write/ClickHouseWrite.scala | 9 ++++---- .../clickhouse/write/ClickHouseWriter.scala | 19 +++++++++-------- .../write/WriteJobDescription.scala | 10 +++++---- .../format/ClickHouseArrowStreamWriter.scala | 4 ++-- .../format/ClickHouseJsonEachRowWriter.scala | 4 ++-- .../sql/clickhouse/ClickHouseSQLConf.scala | 2 +- .../spark/sql/clickhouse/ExprUtils.scala | 11 +++++----- .../spark/sql/clickhouse/SchemaUtils.scala | 2 +- .../src/test/resources/log4j2.xml | 2 +- .../clickhouse/ClickHouseHelperSuite.scala | 2 +- .../sql/clickhouse/ConfigurationSuite.scala | 2 +- .../clickhouse/FunctionRegistrySuite.scala | 3 ++- 159 files changed, 435 insertions(+), 420 deletions(-) rename clickhouse-core-it/src/test/scala/{xenon => com}/clickhouse/HashSuite.scala (93%) rename clickhouse-core-it/src/test/scala/{xenon => com}/clickhouse/UtilsClickHouseSuite.scala (94%) rename clickhouse-core/src/main/antlr/{xenon.clickhouse => com.clickhouse}/ClickHouseSQL.g4 (100%) rename clickhouse-core/src/main/java/{xenon => com}/clickhouse/exception/ClickHouseErrCode.java (99%) rename clickhouse-core/src/main/java/{xenon => com}/clickhouse/hash/cityhash/CityHash_v1_0_2.java (99%) rename clickhouse-core/src/main/java/{xenon => com}/clickhouse/hash/cityhash/UInt128.java (96%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/JsonProtocol.scala (98%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/Logging.scala (96%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/Utils.scala (99%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/client/ClusterClient.scala (92%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/client/NodeClient.scala (95%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/client/NodesClient.scala (91%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/exception/CHException.scala (95%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/expr/Expressions.scala (98%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/format/InputFormat.scala (94%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/format/JSONOutputFormat.scala (97%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/format/OutputFormat.scala (96%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/hash/CityHash64.scala (90%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/hash/HashFunc.scala (98%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/hash/HashUtils.scala (98%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/hash/Murmurhash2_32.scala (97%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/hash/Murmurhash2_64.scala (96%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/hash/Murmurhash3_32.scala (97%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/hash/Murmurhash3_64.scala (97%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/io/ForwardingOutputStream.scala (97%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/io/ForwardingWriter.scala (97%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/io/ObservableOutputStream.scala (97%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/parse/AstVisitor.scala (91%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/parse/ParseUtils.scala (98%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/parse/SQLParser.scala (93%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/spec/DatabaseSpec.scala (94%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/spec/NodeSpec.scala (97%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/spec/PartitionSpec.scala (92%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/spec/ShardUtils.scala (97%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/spec/TableEngineSpec.scala (97%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/spec/TableEngineUtils.scala (87%) rename clickhouse-core/src/main/scala/{xenon => com}/clickhouse/spec/TableSpec.scala (97%) rename clickhouse-core/src/test/scala/{xenon => com}/clickhouse/UtilsSuite.scala (97%) rename clickhouse-core/src/test/scala/{xenon => com}/clickhouse/parse/SQLParserSuite.scala (96%) rename clickhouse-core/src/test/scala/{xenon => com}/clickhouse/spec/NodeSpecHelper.scala (97%) rename clickhouse-core/src/test/scala/{xenon => com}/clickhouse/spec/NodeSpecSuite.scala (97%) rename clickhouse-core/src/test/scala/{xenon => com}/clickhouse/spec/ShardUtilsSuite.scala (97%) rename clickhouse-core/src/testFixtures/scala/{xenon => com}/clickhouse/base/ClickHouseClusterMixIn.scala (98%) rename clickhouse-core/src/testFixtures/scala/{xenon => com}/clickhouse/base/ClickHouseSingleMixIn.scala (95%) rename spark-3.3/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/ClickHouseCatalog.scala (98%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.3/clickhouse-spark/src/main/scala/com}/clickhouse/ClickHouseCommandRunner.scala (93%) rename spark-3.3/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/ClickHouseHelper.scala (98%) rename spark-3.3/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/ClickHouseTable.scala (97%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.3/clickhouse-spark/src/main/scala/com}/clickhouse/CommitMessage.scala (96%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.3/clickhouse-spark/src/main/scala/com}/clickhouse/Constants.scala (98%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.3/clickhouse-spark/src/main/scala/com}/clickhouse/Metrics.scala (97%) rename spark-3.3/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/SQLHelper.scala (98%) rename spark-3.3/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/func/ClickHouseXxHash64.scala (97%) rename spark-3.3/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/func/FunctionRegistry.scala (98%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.3/clickhouse-spark/src/main/scala/com}/clickhouse/read/ClickHouseMetadataColumn.scala (98%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.3/clickhouse-spark/src/main/scala/com}/clickhouse/read/ClickHouseRead.scala (96%) rename spark-3.3/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/read/ClickHouseReader.scala (92%) rename spark-3.3/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/read/InputPartitions.scala (97%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.3/clickhouse-spark/src/main/scala/com}/clickhouse/read/ScanJobDescription.scala (96%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.3/clickhouse-spark/src/main/scala/com}/clickhouse/read/format/ClickHouseBinaryReader.scala (94%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.3/clickhouse-spark/src/main/scala/com}/clickhouse/read/format/ClickHouseJsonReader.scala (93%) rename spark-3.3/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/write/ClickHouseWrite.scala (93%) rename spark-3.3/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/write/ClickHouseWriter.scala (97%) rename spark-3.3/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/write/WriteJobDescription.scala (95%) rename spark-3.3/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/write/format/ClickHouseArrowStreamWriter.scala (94%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.3/clickhouse-spark/src/main/scala/com}/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala (91%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/ClickHouseCatalog.scala (97%) rename {spark-3.3/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/ClickHouseCommandRunner.scala (93%) rename spark-3.4/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/ClickHouseHelper.scala (98%) rename spark-3.4/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/ClickHouseTable.scala (96%) rename {spark-3.3/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/CommitMessage.scala (96%) rename {spark-3.3/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/Constants.scala (98%) rename {spark-3.3/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/Metrics.scala (97%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/SQLHelper.scala (98%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/func/CityHash64.scala (94%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/func/FunctionRegistry.scala (99%) rename spark-3.4/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/func/MultiStringArgsHash.scala (98%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/func/MurmurHash2.scala (93%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/func/MurmurHash3.scala (93%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/func/XxHash64.scala (97%) rename {spark-3.3/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/read/ClickHouseMetadataColumn.scala (98%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/read/ClickHouseRead.scala (96%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/read/ClickHouseReader.scala (92%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/read/InputPartitions.scala (97%) rename {spark-3.3/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/read/ScanJobDescription.scala (96%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/read/format/ClickHouseBinaryReader.scala (94%) rename {spark-3.3/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/read/format/ClickHouseJsonReader.scala (93%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/write/ClickHouseWrite.scala (92%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/write/ClickHouseWriter.scala (97%) rename {spark-3.5/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/write/WriteJobDescription.scala (94%) rename spark-3.4/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/write/format/ClickHouseArrowStreamWriter.scala (94%) rename {spark-3.3/clickhouse-spark/src/main/scala/xenon => spark-3.4/clickhouse-spark/src/main/scala/com}/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala (91%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/ClickHouseCatalog.scala (96%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/ClickHouseCommandRunner.scala (86%) rename spark-3.5/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/ClickHouseHelper.scala (97%) rename spark-3.5/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/ClickHouseTable.scala (94%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/CommitMessage.scala (96%) rename spark-3.5/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/Constants.scala (98%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/Metrics.scala (97%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/SQLHelper.scala (98%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/func/CityHash64.scala (94%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/func/FunctionRegistry.scala (99%) rename spark-3.5/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/func/MultiStringArgsHash.scala (98%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/func/MurmurHash2.scala (84%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/func/MurmurHash3.scala (84%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/func/XxHash64.scala (97%) rename spark-3.5/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/read/ClickHouseMetadataColumn.scala (98%) rename {spark-3.3/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/read/ClickHouseRead.scala (94%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/read/ClickHouseReader.scala (90%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/read/InputPartitions.scala (93%) rename spark-3.5/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/read/ScanJobDescription.scala (91%) rename {spark-3.3/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/read/format/ClickHouseBinaryReader.scala (94%) rename spark-3.5/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/read/format/ClickHouseJsonReader.scala (93%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/write/ClickHouseWrite.scala (90%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/write/ClickHouseWriter.scala (95%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/write/WriteJobDescription.scala (91%) rename spark-3.5/clickhouse-spark/src/main/scala/{xenon => com}/clickhouse/write/format/ClickHouseArrowStreamWriter.scala (94%) rename {spark-3.4/clickhouse-spark/src/main/scala/xenon => spark-3.5/clickhouse-spark/src/main/scala/com}/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala (91%) diff --git a/build.gradle b/build.gradle index 643b406a..e521c58d 100644 --- a/build.gradle +++ b/build.gradle @@ -164,7 +164,7 @@ project(':clickhouse-core') { generateGrammarSource { maxHeapSize = "64m" - arguments += ["-visitor", "-package", "xenon.clickhouse"] + arguments += ["-visitor", "-package", "com.clickhouse"] } test { diff --git a/clickhouse-core-it/src/test/resources/log4j.properties b/clickhouse-core-it/src/test/resources/log4j.properties index 84b0e246..fd3d701c 100644 --- a/clickhouse-core-it/src/test/resources/log4j.properties +++ b/clickhouse-core-it/src/test/resources/log4j.properties @@ -27,4 +27,4 @@ log4j.appender.file.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss.SSS} %t %p %c{ log4j.logger.org.apache.hadoop.util.Shell=ERROR log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR -log4j.logger.xenon.clickhouse=DEBUG +log4j.logger.com.clickhouse=DEBUG diff --git a/clickhouse-core-it/src/test/scala/xenon/clickhouse/HashSuite.scala b/clickhouse-core-it/src/test/scala/com/clickhouse/HashSuite.scala similarity index 93% rename from clickhouse-core-it/src/test/scala/xenon/clickhouse/HashSuite.scala rename to clickhouse-core-it/src/test/scala/com/clickhouse/HashSuite.scala index 5441dcb8..82109016 100644 --- a/clickhouse-core-it/src/test/scala/xenon/clickhouse/HashSuite.scala +++ b/clickhouse-core-it/src/test/scala/com/clickhouse/HashSuite.scala @@ -12,11 +12,12 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse -import xenon.clickhouse.base.ClickHouseSingleMixIn -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.hash._ +import com.clickhouse.base.ClickHouseSingleMixIn +import com.clickhouse.client.NodeClient +import com.clickhouse.hash.{CityHash64, HashUtils, Murmurhash2_32, Murmurhash2_64, Murmurhash3_32, Murmurhash3_64} +import com.clickhouse.hash._ class HashSuite extends ClickHouseSingleMixIn with Logging { diff --git a/clickhouse-core-it/src/test/scala/xenon/clickhouse/UtilsClickHouseSuite.scala b/clickhouse-core-it/src/test/scala/com/clickhouse/UtilsClickHouseSuite.scala similarity index 94% rename from clickhouse-core-it/src/test/scala/xenon/clickhouse/UtilsClickHouseSuite.scala rename to clickhouse-core-it/src/test/scala/com/clickhouse/UtilsClickHouseSuite.scala index 074c44a3..e8000935 100644 --- a/clickhouse-core-it/src/test/scala/xenon/clickhouse/UtilsClickHouseSuite.scala +++ b/clickhouse-core-it/src/test/scala/com/clickhouse/UtilsClickHouseSuite.scala @@ -12,10 +12,9 @@ * limitations under the License. */ -package xenon.clickhouse - -import xenon.clickhouse.base.ClickHouseSingleMixIn +package com.clickhouse +import com.clickhouse.base.ClickHouseSingleMixIn import java.time.{LocalDateTime, ZoneId} class UtilsClickHouseSuite extends ClickHouseSingleMixIn with Logging { diff --git a/clickhouse-core/src/main/antlr/xenon.clickhouse/ClickHouseSQL.g4 b/clickhouse-core/src/main/antlr/com.clickhouse/ClickHouseSQL.g4 similarity index 100% rename from clickhouse-core/src/main/antlr/xenon.clickhouse/ClickHouseSQL.g4 rename to clickhouse-core/src/main/antlr/com.clickhouse/ClickHouseSQL.g4 diff --git a/clickhouse-core/src/main/java/xenon/clickhouse/exception/ClickHouseErrCode.java b/clickhouse-core/src/main/java/com/clickhouse/exception/ClickHouseErrCode.java similarity index 99% rename from clickhouse-core/src/main/java/xenon/clickhouse/exception/ClickHouseErrCode.java rename to clickhouse-core/src/main/java/com/clickhouse/exception/ClickHouseErrCode.java index a718a4fe..7d1af3e9 100644 --- a/clickhouse-core/src/main/java/xenon/clickhouse/exception/ClickHouseErrCode.java +++ b/clickhouse-core/src/main/java/com/clickhouse/exception/ClickHouseErrCode.java @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.exception; +package com.clickhouse.exception; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/clickhouse-core/src/main/java/xenon/clickhouse/hash/cityhash/CityHash_v1_0_2.java b/clickhouse-core/src/main/java/com/clickhouse/hash/cityhash/CityHash_v1_0_2.java similarity index 99% rename from clickhouse-core/src/main/java/xenon/clickhouse/hash/cityhash/CityHash_v1_0_2.java rename to clickhouse-core/src/main/java/com/clickhouse/hash/cityhash/CityHash_v1_0_2.java index 87419471..ff68fa03 100644 --- a/clickhouse-core/src/main/java/xenon/clickhouse/hash/cityhash/CityHash_v1_0_2.java +++ b/clickhouse-core/src/main/java/com/clickhouse/hash/cityhash/CityHash_v1_0_2.java @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.hash.cityhash; +package com.clickhouse.hash.cityhash; // modified from https://github.com/dpoluyanov/achord/blob/master/src/main/java/com/github/mangelion/achord/CityHash_v1_0_2.java diff --git a/clickhouse-core/src/main/java/xenon/clickhouse/hash/cityhash/UInt128.java b/clickhouse-core/src/main/java/com/clickhouse/hash/cityhash/UInt128.java similarity index 96% rename from clickhouse-core/src/main/java/xenon/clickhouse/hash/cityhash/UInt128.java rename to clickhouse-core/src/main/java/com/clickhouse/hash/cityhash/UInt128.java index 0b393115..69ef8e35 100644 --- a/clickhouse-core/src/main/java/xenon/clickhouse/hash/cityhash/UInt128.java +++ b/clickhouse-core/src/main/java/com/clickhouse/hash/cityhash/UInt128.java @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.hash.cityhash; +package com.clickhouse.hash.cityhash; /** * copied from https://github.com/dpoluyanov/achord/blob/master/src/main/java/com/github/mangelion/achord/UInt128.java diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/JsonProtocol.scala b/clickhouse-core/src/main/scala/com/clickhouse/JsonProtocol.scala similarity index 98% rename from clickhouse-core/src/main/scala/xenon/clickhouse/JsonProtocol.scala rename to clickhouse-core/src/main/scala/com/clickhouse/JsonProtocol.scala index c9128696..a7159c8d 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/JsonProtocol.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/JsonProtocol.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import com.fasterxml.jackson.databind.{DeserializationFeature, ObjectMapper, SerializationFeature} import com.fasterxml.jackson.module.scala.ClassTagExtensions diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/Logging.scala b/clickhouse-core/src/main/scala/com/clickhouse/Logging.scala similarity index 96% rename from clickhouse-core/src/main/scala/xenon/clickhouse/Logging.scala rename to clickhouse-core/src/main/scala/com/clickhouse/Logging.scala index 6dc95b3a..c9675a9f 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/Logging.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/Logging.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import org.slf4j.{Logger, LoggerFactory} diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/Utils.scala b/clickhouse-core/src/main/scala/com/clickhouse/Utils.scala similarity index 99% rename from clickhouse-core/src/main/scala/xenon/clickhouse/Utils.scala rename to clickhouse-core/src/main/scala/com/clickhouse/Utils.scala index 3addc209..b91fe959 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/Utils.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/Utils.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import org.apache.commons.lang3.time.FastDateFormat diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/client/ClusterClient.scala b/clickhouse-core/src/main/scala/com/clickhouse/client/ClusterClient.scala similarity index 92% rename from clickhouse-core/src/main/scala/xenon/clickhouse/client/ClusterClient.scala rename to clickhouse-core/src/main/scala/com/clickhouse/client/ClusterClient.scala index 00171737..264cfb8a 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/client/ClusterClient.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/client/ClusterClient.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package xenon.clickhouse.client +package com.clickhouse.client -import xenon.clickhouse.Logging -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.spec.ClusterSpec +import com.clickhouse.Logging +import com.clickhouse.exception.CHClientException +import com.clickhouse.spec.ClusterSpec import java.util.concurrent.ConcurrentHashMap import scala.collection.JavaConverters._ diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/client/NodeClient.scala b/clickhouse-core/src/main/scala/com/clickhouse/client/NodeClient.scala similarity index 95% rename from clickhouse-core/src/main/scala/xenon/clickhouse/client/NodeClient.scala rename to clickhouse-core/src/main/scala/com/clickhouse/client/NodeClient.scala index 1a2517b2..460bf420 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/client/NodeClient.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/client/NodeClient.scala @@ -12,17 +12,18 @@ * limitations under the License. */ -package xenon.clickhouse.client +package com.clickhouse.client +import com.clickhouse.Logging import com.clickhouse.client._ import com.clickhouse.client.config.ClickHouseClientOption import com.clickhouse.data.{ClickHouseCompression, ClickHouseFormat} +import com.clickhouse.exception.{CHClientException, CHException, CHServerException} +import com.clickhouse.format.{JSONCompactEachRowWithNamesAndTypesSimpleOutput, JSONEachRowSimpleOutput, NamesAndTypes, SimpleOutput} +import com.clickhouse.spec.NodeSpec import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.ObjectNode -import xenon.clickhouse.Logging -import xenon.clickhouse.exception.{CHClientException, CHException, CHServerException} -import xenon.clickhouse.format._ -import xenon.clickhouse.spec.NodeSpec +import com.clickhouse.format._ import java.io.InputStream import java.util.UUID diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/client/NodesClient.scala b/clickhouse-core/src/main/scala/com/clickhouse/client/NodesClient.scala similarity index 91% rename from clickhouse-core/src/main/scala/xenon/clickhouse/client/NodesClient.scala rename to clickhouse-core/src/main/scala/com/clickhouse/client/NodesClient.scala index c87c44c2..d39c2995 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/client/NodesClient.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/client/NodesClient.scala @@ -12,16 +12,15 @@ * limitations under the License. */ -package xenon.clickhouse.client +package com.clickhouse.client -import java.util.concurrent.ConcurrentHashMap +import com.clickhouse.Logging +import com.clickhouse.spec.{NodeSpec, Nodes} +import java.util.concurrent.ConcurrentHashMap import scala.collection.JavaConverters._ import scala.util.Random.shuffle -import xenon.clickhouse.spec.{NodeSpec, Nodes} -import xenon.clickhouse.Logging - object NodesClient { def apply(nodes: Nodes) = new NodesClient(nodes) } diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/exception/CHException.scala b/clickhouse-core/src/main/scala/com/clickhouse/exception/CHException.scala similarity index 95% rename from clickhouse-core/src/main/scala/xenon/clickhouse/exception/CHException.scala rename to clickhouse-core/src/main/scala/com/clickhouse/exception/CHException.scala index c367b8ce..abd11214 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/exception/CHException.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/exception/CHException.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package xenon.clickhouse.exception +package com.clickhouse.exception -import xenon.clickhouse.spec.NodeSpec +import com.clickhouse.spec.NodeSpec abstract class CHException( val code: Int, diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/expr/Expressions.scala b/clickhouse-core/src/main/scala/com/clickhouse/expr/Expressions.scala similarity index 98% rename from clickhouse-core/src/main/scala/xenon/clickhouse/expr/Expressions.scala rename to clickhouse-core/src/main/scala/com/clickhouse/expr/Expressions.scala index 62f4f95a..d4fe0bb0 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/expr/Expressions.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/expr/Expressions.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.expr +package com.clickhouse.expr trait Expr extends Serializable { def sql: String // ClickHouse dialect diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/format/InputFormat.scala b/clickhouse-core/src/main/scala/com/clickhouse/format/InputFormat.scala similarity index 94% rename from clickhouse-core/src/main/scala/xenon/clickhouse/format/InputFormat.scala rename to clickhouse-core/src/main/scala/com/clickhouse/format/InputFormat.scala index aa350fec..ee6d4720 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/format/InputFormat.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/format/InputFormat.scala @@ -12,6 +12,6 @@ * limitations under the License. */ -package xenon.clickhouse.format +package com.clickhouse.format trait InputFormat diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/format/JSONOutputFormat.scala b/clickhouse-core/src/main/scala/com/clickhouse/format/JSONOutputFormat.scala similarity index 97% rename from clickhouse-core/src/main/scala/xenon/clickhouse/format/JSONOutputFormat.scala rename to clickhouse-core/src/main/scala/com/clickhouse/format/JSONOutputFormat.scala index deae8c0f..f89b0e7d 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/format/JSONOutputFormat.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/format/JSONOutputFormat.scala @@ -12,8 +12,9 @@ * limitations under the License. */ -package xenon.clickhouse.format +package com.clickhouse.format +import com.clickhouse.exception.CHClientException import java.io.InputStream import scala.collection.immutable.ListMap @@ -21,8 +22,7 @@ import scala.collection.JavaConverters._ import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.ObjectNode -import xenon.clickhouse.JsonProtocol.om -import xenon.clickhouse.exception.CHClientException +import com.clickhouse.JsonProtocol.om /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////// Simple //////////////////////////////////// diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/format/OutputFormat.scala b/clickhouse-core/src/main/scala/com/clickhouse/format/OutputFormat.scala similarity index 96% rename from clickhouse-core/src/main/scala/xenon/clickhouse/format/OutputFormat.scala rename to clickhouse-core/src/main/scala/com/clickhouse/format/OutputFormat.scala index ff3ed690..a232406c 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/format/OutputFormat.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/format/OutputFormat.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.format +package com.clickhouse.format import scala.collection.immutable.ListMap diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/CityHash64.scala b/clickhouse-core/src/main/scala/com/clickhouse/hash/CityHash64.scala similarity index 90% rename from clickhouse-core/src/main/scala/xenon/clickhouse/hash/CityHash64.scala rename to clickhouse-core/src/main/scala/com/clickhouse/hash/CityHash64.scala index 326466c0..a4b3a0bf 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/CityHash64.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/hash/CityHash64.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package xenon.clickhouse.hash +package com.clickhouse.hash -import xenon.clickhouse.hash.cityhash.{CityHash_v1_0_2, UInt128} +import com.clickhouse.hash.cityhash.{CityHash_v1_0_2, UInt128} // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L694 object CityHash64 extends HashFunc[Long] { diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/HashFunc.scala b/clickhouse-core/src/main/scala/com/clickhouse/hash/HashFunc.scala similarity index 98% rename from clickhouse-core/src/main/scala/xenon/clickhouse/hash/HashFunc.scala rename to clickhouse-core/src/main/scala/com/clickhouse/hash/HashFunc.scala index fc227536..643c240c 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/HashFunc.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/hash/HashFunc.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.hash +package com.clickhouse.hash import java.nio.charset.StandardCharsets import scala.reflect.ClassTag diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/HashUtils.scala b/clickhouse-core/src/main/scala/com/clickhouse/hash/HashUtils.scala similarity index 98% rename from clickhouse-core/src/main/scala/xenon/clickhouse/hash/HashUtils.scala rename to clickhouse-core/src/main/scala/com/clickhouse/hash/HashUtils.scala index 5ff277a6..bb97be18 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/HashUtils.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/hash/HashUtils.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.hash +package com.clickhouse.hash object HashUtils { def intHash64Impl(x: Long): Long = diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/Murmurhash2_32.scala b/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash2_32.scala similarity index 97% rename from clickhouse-core/src/main/scala/xenon/clickhouse/hash/Murmurhash2_32.scala rename to clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash2_32.scala index 30f48b67..7d69f65b 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/Murmurhash2_32.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash2_32.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.hash +package com.clickhouse.hash import org.apache.commons.codec.digest.MurmurHash2 diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/Murmurhash2_64.scala b/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash2_64.scala similarity index 96% rename from clickhouse-core/src/main/scala/xenon/clickhouse/hash/Murmurhash2_64.scala rename to clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash2_64.scala index 1ae54ba6..cb848688 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/Murmurhash2_64.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash2_64.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.hash +package com.clickhouse.hash import org.apache.commons.codec.digest.MurmurHash2 diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/Murmurhash3_32.scala b/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash3_32.scala similarity index 97% rename from clickhouse-core/src/main/scala/xenon/clickhouse/hash/Murmurhash3_32.scala rename to clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash3_32.scala index 43a00c36..14d273d9 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/Murmurhash3_32.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash3_32.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.hash +package com.clickhouse.hash import org.apache.commons.codec.digest.MurmurHash3 diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/Murmurhash3_64.scala b/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash3_64.scala similarity index 97% rename from clickhouse-core/src/main/scala/xenon/clickhouse/hash/Murmurhash3_64.scala rename to clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash3_64.scala index 233a06b3..475d8e73 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/hash/Murmurhash3_64.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash3_64.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.hash +package com.clickhouse.hash import org.apache.commons.codec.digest.MurmurHash3 diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/io/ForwardingOutputStream.scala b/clickhouse-core/src/main/scala/com/clickhouse/io/ForwardingOutputStream.scala similarity index 97% rename from clickhouse-core/src/main/scala/xenon/clickhouse/io/ForwardingOutputStream.scala rename to clickhouse-core/src/main/scala/com/clickhouse/io/ForwardingOutputStream.scala index 862c0a53..7602cc7f 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/io/ForwardingOutputStream.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/io/ForwardingOutputStream.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.io +package com.clickhouse.io import java.io.OutputStream diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/io/ForwardingWriter.scala b/clickhouse-core/src/main/scala/com/clickhouse/io/ForwardingWriter.scala similarity index 97% rename from clickhouse-core/src/main/scala/xenon/clickhouse/io/ForwardingWriter.scala rename to clickhouse-core/src/main/scala/com/clickhouse/io/ForwardingWriter.scala index 574db477..7ef59174 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/io/ForwardingWriter.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/io/ForwardingWriter.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.io +package com.clickhouse.io import java.io.Writer diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/io/ObservableOutputStream.scala b/clickhouse-core/src/main/scala/com/clickhouse/io/ObservableOutputStream.scala similarity index 97% rename from clickhouse-core/src/main/scala/xenon/clickhouse/io/ObservableOutputStream.scala rename to clickhouse-core/src/main/scala/com/clickhouse/io/ObservableOutputStream.scala index d2168904..cb3a7b6d 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/io/ObservableOutputStream.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/io/ObservableOutputStream.scala @@ -12,10 +12,9 @@ * limitations under the License. */ -package xenon.clickhouse.io - -import xenon.clickhouse.Utils +package com.clickhouse.io +import com.clickhouse.Utils import java.io.OutputStream import java.util.concurrent.atomic.LongAdder diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/parse/AstVisitor.scala b/clickhouse-core/src/main/scala/com/clickhouse/parse/AstVisitor.scala similarity index 91% rename from clickhouse-core/src/main/scala/xenon/clickhouse/parse/AstVisitor.scala rename to clickhouse-core/src/main/scala/com/clickhouse/parse/AstVisitor.scala index feb1f256..bf1bb802 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/parse/AstVisitor.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/parse/AstVisitor.scala @@ -12,15 +12,18 @@ * limitations under the License. */ -package xenon.clickhouse.parse +package com.clickhouse.parse -import scala.collection.JavaConverters._ +import com.clickhouse.ClickHouseSQLParser.{ColumnExprContext, ColumnExprFunctionContext, ColumnExprIdentifierContext, ColumnExprListContext, ColumnExprLiteralContext, ColumnExprParensContext, ColumnExprPrecedence1Context, ColumnExprPrecedence2Context, ColumnExprTupleContext, ColumnsExprColumnContext, ColumnsExprContext, EngineClauseContext, OrderByClauseContext, OrderExprContext, SettingsClauseContext} +import com.clickhouse.expr.{Expr, FieldRef, FuncExpr, OrderExpr, StringLiteral, TupleExpr} +import com.clickhouse.spec.{DistributedEngineSpec, MergeTreeEngineSpec, ReplacingMergeTreeEngineSpec, ReplicatedMergeTreeEngineSpec, ReplicatedReplacingMergeTreeEngineSpec, TableEngineSpec, UnknownTableEngineSpec} +import com.clickhouse.{ClickHouseSQLBaseVisitor, Logging, Utils} +import scala.collection.JavaConverters._ import org.antlr.v4.runtime.tree.ParseTree -import xenon.clickhouse.{ClickHouseSQLBaseVisitor, Logging, Utils} -import xenon.clickhouse.expr._ -import xenon.clickhouse.spec._ -import xenon.clickhouse.ClickHouseSQLParser._ +import com.clickhouse.expr._ +import com.clickhouse.spec._ +import com.clickhouse.ClickHouseSQLParser._ class AstVisitor extends ClickHouseSQLBaseVisitor[AnyRef] with Logging { import ParseUtils._ diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/parse/ParseUtils.scala b/clickhouse-core/src/main/scala/com/clickhouse/parse/ParseUtils.scala similarity index 98% rename from clickhouse-core/src/main/scala/xenon/clickhouse/parse/ParseUtils.scala rename to clickhouse-core/src/main/scala/com/clickhouse/parse/ParseUtils.scala index 69a7beac..0c00e5ef 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/parse/ParseUtils.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/parse/ParseUtils.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.parse +package com.clickhouse.parse import java.util import org.antlr.v4.runtime.{ParserRuleContext, Token} diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/parse/SQLParser.scala b/clickhouse-core/src/main/scala/com/clickhouse/parse/SQLParser.scala similarity index 93% rename from clickhouse-core/src/main/scala/xenon/clickhouse/parse/SQLParser.scala rename to clickhouse-core/src/main/scala/com/clickhouse/parse/SQLParser.scala index a11ba742..08bedd76 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/parse/SQLParser.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/parse/SQLParser.scala @@ -12,14 +12,15 @@ * limitations under the License. */ -package xenon.clickhouse.parse +package com.clickhouse.parse +import com.clickhouse.{ClickHouseSQLLexer, ClickHouseSQLParser, Logging} +import com.clickhouse.expr.Expr +import com.clickhouse.spec.TableEngineSpec import org.antlr.v4.runtime._ import org.antlr.v4.runtime.atn.PredictionMode import org.antlr.v4.runtime.misc.ParseCancellationException -import xenon.clickhouse._ -import xenon.clickhouse.expr.Expr -import xenon.clickhouse.spec.TableEngineSpec +import com.clickhouse._ class SQLParser(astVisitor: AstVisitor) extends Logging { diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/DatabaseSpec.scala b/clickhouse-core/src/main/scala/com/clickhouse/spec/DatabaseSpec.scala similarity index 94% rename from clickhouse-core/src/main/scala/xenon/clickhouse/spec/DatabaseSpec.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spec/DatabaseSpec.scala index 166827c3..62437da1 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/DatabaseSpec.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spec/DatabaseSpec.scala @@ -12,14 +12,13 @@ * limitations under the License. */ -package xenon.clickhouse.spec +package com.clickhouse.spec -import java.util +import com.clickhouse.ToJson +import java.util import scala.collection.JavaConverters._ -import xenon.clickhouse.ToJson - case class DatabaseSpec( name: String, engine: String, diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/NodeSpec.scala b/clickhouse-core/src/main/scala/com/clickhouse/spec/NodeSpec.scala similarity index 97% rename from clickhouse-core/src/main/scala/xenon/clickhouse/spec/NodeSpec.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spec/NodeSpec.scala index 454312df..87c53f30 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/NodeSpec.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spec/NodeSpec.scala @@ -12,13 +12,13 @@ * limitations under the License. */ -package xenon.clickhouse.spec +package com.clickhouse.spec +import com.clickhouse.ToJson import com.clickhouse.client.ClickHouseProtocol import com.clickhouse.client.ClickHouseProtocol._ import com.fasterxml.jackson.annotation.{JsonIgnore, JsonProperty} -import xenon.clickhouse.ToJson -import xenon.clickhouse.Utils._ +import com.clickhouse.Utils._ import java.util import java.util.Collections diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/PartitionSpec.scala b/clickhouse-core/src/main/scala/com/clickhouse/spec/PartitionSpec.scala similarity index 92% rename from clickhouse-core/src/main/scala/xenon/clickhouse/spec/PartitionSpec.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spec/PartitionSpec.scala index fa7999b0..16b88487 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/PartitionSpec.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spec/PartitionSpec.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package xenon.clickhouse.spec +package com.clickhouse.spec -import xenon.clickhouse.ToJson +import com.clickhouse.ToJson case class PartitionSpec( partition_value: String, diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/ShardUtils.scala b/clickhouse-core/src/main/scala/com/clickhouse/spec/ShardUtils.scala similarity index 97% rename from clickhouse-core/src/main/scala/xenon/clickhouse/spec/ShardUtils.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spec/ShardUtils.scala index 7d0799a8..ed4ace61 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/ShardUtils.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spec/ShardUtils.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.spec +package com.clickhouse.spec import java.lang.{Long => JLong} diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/TableEngineSpec.scala b/clickhouse-core/src/main/scala/com/clickhouse/spec/TableEngineSpec.scala similarity index 97% rename from clickhouse-core/src/main/scala/xenon/clickhouse/spec/TableEngineSpec.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spec/TableEngineSpec.scala index 620b8fec..1a44a7d2 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/TableEngineSpec.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spec/TableEngineSpec.scala @@ -12,9 +12,10 @@ * limitations under the License. */ -package xenon.clickhouse.spec +package com.clickhouse.spec -import xenon.clickhouse.expr._ +import com.clickhouse.expr.{Expr, FieldRef, OrderExpr, TupleExpr} +import com.clickhouse.expr._ sealed trait TableEngineSpec extends Serializable { def engine_clause: String diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/TableEngineUtils.scala b/clickhouse-core/src/main/scala/com/clickhouse/spec/TableEngineUtils.scala similarity index 87% rename from clickhouse-core/src/main/scala/xenon/clickhouse/spec/TableEngineUtils.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spec/TableEngineUtils.scala index 033e6f41..c206d4ad 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/TableEngineUtils.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spec/TableEngineUtils.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package xenon.clickhouse.spec +package com.clickhouse.spec -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.parse.{ParseException, ParseUtils} -import xenon.clickhouse.Logging +import com.clickhouse.Logging +import com.clickhouse.exception.CHClientException +import com.clickhouse.parse.{ParseException, ParseUtils} object TableEngineUtils extends Logging { diff --git a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/TableSpec.scala b/clickhouse-core/src/main/scala/com/clickhouse/spec/TableSpec.scala similarity index 97% rename from clickhouse-core/src/main/scala/xenon/clickhouse/spec/TableSpec.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spec/TableSpec.scala index 9b3168be..1f5daae5 100644 --- a/clickhouse-core/src/main/scala/xenon/clickhouse/spec/TableSpec.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spec/TableSpec.scala @@ -12,15 +12,14 @@ * limitations under the License. */ -package xenon.clickhouse.spec +package com.clickhouse.spec + +import com.clickhouse.ToJson import java.time.LocalDateTime import java.util - import scala.collection.JavaConverters._ -import xenon.clickhouse.ToJson - case class TableSpec( database: String, name: String, diff --git a/clickhouse-core/src/test/resources/log4j.properties b/clickhouse-core/src/test/resources/log4j.properties index 84b0e246..fd3d701c 100644 --- a/clickhouse-core/src/test/resources/log4j.properties +++ b/clickhouse-core/src/test/resources/log4j.properties @@ -27,4 +27,4 @@ log4j.appender.file.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss.SSS} %t %p %c{ log4j.logger.org.apache.hadoop.util.Shell=ERROR log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR -log4j.logger.xenon.clickhouse=DEBUG +log4j.logger.com.clickhouse=DEBUG diff --git a/clickhouse-core/src/test/scala/xenon/clickhouse/UtilsSuite.scala b/clickhouse-core/src/test/scala/com/clickhouse/UtilsSuite.scala similarity index 97% rename from clickhouse-core/src/test/scala/xenon/clickhouse/UtilsSuite.scala rename to clickhouse-core/src/test/scala/com/clickhouse/UtilsSuite.scala index 18c36a4d..8a677234 100644 --- a/clickhouse-core/src/test/scala/xenon/clickhouse/UtilsSuite.scala +++ b/clickhouse-core/src/test/scala/com/clickhouse/UtilsSuite.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import org.scalatest.funsuite.AnyFunSuite -import xenon.clickhouse.Utils._ +import Utils._ import java.time.{Duration, LocalDateTime} diff --git a/clickhouse-core/src/test/scala/xenon/clickhouse/parse/SQLParserSuite.scala b/clickhouse-core/src/test/scala/com/clickhouse/parse/SQLParserSuite.scala similarity index 96% rename from clickhouse-core/src/test/scala/xenon/clickhouse/parse/SQLParserSuite.scala rename to clickhouse-core/src/test/scala/com/clickhouse/parse/SQLParserSuite.scala index 5c25189e..83133b4b 100644 --- a/clickhouse-core/src/test/scala/xenon/clickhouse/parse/SQLParserSuite.scala +++ b/clickhouse-core/src/test/scala/com/clickhouse/parse/SQLParserSuite.scala @@ -12,11 +12,13 @@ * limitations under the License. */ -package xenon.clickhouse.parse +package com.clickhouse.parse +import com.clickhouse.expr.{FieldRef, FuncExpr, StringLiteral, TupleExpr} +import com.clickhouse.spec.{DistributedEngineSpec, MergeTreeEngineSpec, ReplacingMergeTreeEngineSpec, ReplicatedMergeTreeEngineSpec, ReplicatedReplacingMergeTreeEngineSpec} import org.scalatest.funsuite.AnyFunSuite -import xenon.clickhouse.expr._ -import xenon.clickhouse.spec._ +import com.clickhouse.expr._ +import com.clickhouse.spec._ class SQLParserSuite extends AnyFunSuite { diff --git a/clickhouse-core/src/test/scala/xenon/clickhouse/spec/NodeSpecHelper.scala b/clickhouse-core/src/test/scala/com/clickhouse/spec/NodeSpecHelper.scala similarity index 97% rename from clickhouse-core/src/test/scala/xenon/clickhouse/spec/NodeSpecHelper.scala rename to clickhouse-core/src/test/scala/com/clickhouse/spec/NodeSpecHelper.scala index 26ef2da7..3ac357db 100644 --- a/clickhouse-core/src/test/scala/xenon/clickhouse/spec/NodeSpecHelper.scala +++ b/clickhouse-core/src/test/scala/com/clickhouse/spec/NodeSpecHelper.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.spec +package com.clickhouse.spec trait NodeSpecHelper { diff --git a/clickhouse-core/src/test/scala/xenon/clickhouse/spec/NodeSpecSuite.scala b/clickhouse-core/src/test/scala/com/clickhouse/spec/NodeSpecSuite.scala similarity index 97% rename from clickhouse-core/src/test/scala/xenon/clickhouse/spec/NodeSpecSuite.scala rename to clickhouse-core/src/test/scala/com/clickhouse/spec/NodeSpecSuite.scala index fa0afdce..14c94631 100644 --- a/clickhouse-core/src/test/scala/xenon/clickhouse/spec/NodeSpecSuite.scala +++ b/clickhouse-core/src/test/scala/com/clickhouse/spec/NodeSpecSuite.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.spec +package com.clickhouse.spec import org.scalatest.funsuite.AnyFunSuite diff --git a/clickhouse-core/src/test/scala/xenon/clickhouse/spec/ShardUtilsSuite.scala b/clickhouse-core/src/test/scala/com/clickhouse/spec/ShardUtilsSuite.scala similarity index 97% rename from clickhouse-core/src/test/scala/xenon/clickhouse/spec/ShardUtilsSuite.scala rename to clickhouse-core/src/test/scala/com/clickhouse/spec/ShardUtilsSuite.scala index 096c417c..cf511b7b 100644 --- a/clickhouse-core/src/test/scala/xenon/clickhouse/spec/ShardUtilsSuite.scala +++ b/clickhouse-core/src/test/scala/com/clickhouse/spec/ShardUtilsSuite.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.spec +package com.clickhouse.spec import org.scalatest.funsuite.AnyFunSuite diff --git a/clickhouse-core/src/testFixtures/scala/xenon/clickhouse/base/ClickHouseClusterMixIn.scala b/clickhouse-core/src/testFixtures/scala/com/clickhouse/base/ClickHouseClusterMixIn.scala similarity index 98% rename from clickhouse-core/src/testFixtures/scala/xenon/clickhouse/base/ClickHouseClusterMixIn.scala rename to clickhouse-core/src/testFixtures/scala/com/clickhouse/base/ClickHouseClusterMixIn.scala index 7357a29b..865df638 100644 --- a/clickhouse-core/src/testFixtures/scala/xenon/clickhouse/base/ClickHouseClusterMixIn.scala +++ b/clickhouse-core/src/testFixtures/scala/com/clickhouse/base/ClickHouseClusterMixIn.scala @@ -12,13 +12,13 @@ * limitations under the License. */ -package xenon.clickhouse.base +package com.clickhouse.base +import com.clickhouse.Utils import com.clickhouse.data.ClickHouseVersion import com.dimafeng.testcontainers.{DockerComposeContainer, ExposedService, ForAllTestContainer} import org.scalatest.funsuite.AnyFunSuite -import xenon.clickhouse.Utils -import xenon.clickhouse.Utils.PREFIX +import Utils.PREFIX import java.io.File diff --git a/clickhouse-core/src/testFixtures/scala/xenon/clickhouse/base/ClickHouseSingleMixIn.scala b/clickhouse-core/src/testFixtures/scala/com/clickhouse/base/ClickHouseSingleMixIn.scala similarity index 95% rename from clickhouse-core/src/testFixtures/scala/xenon/clickhouse/base/ClickHouseSingleMixIn.scala rename to clickhouse-core/src/testFixtures/scala/com/clickhouse/base/ClickHouseSingleMixIn.scala index 58a08860..6a06ea2c 100644 --- a/clickhouse-core/src/testFixtures/scala/xenon/clickhouse/base/ClickHouseSingleMixIn.scala +++ b/clickhouse-core/src/testFixtures/scala/com/clickhouse/base/ClickHouseSingleMixIn.scala @@ -12,18 +12,17 @@ * limitations under the License. */ -package xenon.clickhouse.base +package com.clickhouse.base -import com.clickhouse.client.ClickHouseProtocol +import com.clickhouse.Utils +import com.clickhouse.client.{ClickHouseProtocol, NodeClient} import com.clickhouse.client.ClickHouseProtocol._ import com.clickhouse.data.ClickHouseVersion +import com.clickhouse.spec.NodeSpec import com.dimafeng.testcontainers.{ForAllTestContainer, JdbcDatabaseContainer, SingleContainer} import org.scalatest.funsuite.AnyFunSuite import org.testcontainers.containers.ClickHouseContainer import org.testcontainers.utility.{DockerImageName, MountableFile} -import xenon.clickhouse.Utils -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.spec.NodeSpec import java.nio.file.{Path, Paths} diff --git a/docker/conf/spark-defaults.conf b/docker/conf/spark-defaults.conf index ed962b6e..25ccdc8d 100644 --- a/docker/conf/spark-defaults.conf +++ b/docker/conf/spark-defaults.conf @@ -43,7 +43,7 @@ spark.sql.catalog.iceberg=org.apache.iceberg.spark.SparkCatalog spark.sql.catalog.iceberg.type=hadoop spark.sql.catalog.iceberg.warehouse=s3a://iceberg-bucket/iceberg-warehouse -spark.sql.catalog.clickhouse_s1r1=xenon.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse_s1r1=com.clickhouse.ClickHouseCatalog spark.sql.catalog.clickhouse_s1r1.host=clickhouse-s1r1 spark.sql.catalog.clickhouse_s1r1.protocol=http spark.sql.catalog.clickhouse_s1r1.http_port=8123 @@ -52,7 +52,7 @@ spark.sql.catalog.clickhouse_s1r1.password= spark.sql.catalog.clickhouse_s1r1.database=default spark.sql.catalog.clickhouse_s1r1.option.custom_http_params=async_insert=1,wait_for_async_insert=1 -spark.sql.catalog.clickhouse_s1r2=xenon.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse_s1r2=com.clickhouse.ClickHouseCatalog spark.sql.catalog.clickhouse_s1r2.host=clickhouse-s1r2 spark.sql.catalog.clickhouse_s1r2.protocol=http spark.sql.catalog.clickhouse_s1r2.http_port=8123 @@ -61,7 +61,7 @@ spark.sql.catalog.clickhouse_s1r2.password= spark.sql.catalog.clickhouse_s1r2.database=default spark.sql.catalog.clickhouse_s1r2.option.custom_http_params=async_insert=1,wait_for_async_insert=1 -spark.sql.catalog.clickhouse_s2r1=xenon.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse_s2r1=com.clickhouse.ClickHouseCatalog spark.sql.catalog.clickhouse_s2r1.host=clickhouse-s2r1 spark.sql.catalog.clickhouse_s2r1.protocol=http spark.sql.catalog.clickhouse_s2r1.http_port=8123 @@ -70,7 +70,7 @@ spark.sql.catalog.clickhouse_s2r1.password= spark.sql.catalog.clickhouse_s2r1.database=default spark.sql.catalog.clickhouse_s2r1.option.custom_http_params=async_insert=1,wait_for_async_insert=1 -spark.sql.catalog.clickhouse_s2r2=xenon.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse_s2r2=com.clickhouse.ClickHouseCatalog spark.sql.catalog.clickhouse_s2r2.host=clickhouse-s2r2 spark.sql.catalog.clickhouse_s2r2.protocol=http spark.sql.catalog.clickhouse_s2r2.http_port=8123 diff --git a/docs/best_practices/01_deployment.md b/docs/best_practices/01_deployment.md index 0ed16c2e..cabf213e 100644 --- a/docs/best_practices/01_deployment.md +++ b/docs/best_practices/01_deployment.md @@ -29,7 +29,7 @@ Persist catalog configurations into `$SPARK_HOME/conf/spark-defaults.conf`, then `spark-shell` or `spark-sql`. ``` -spark.sql.catalog.ck_01=xenon.clickhouse.ClickHouseCatalog +spark.sql.catalog.ck_01=com.clickhouse.ClickHouseCatalog spark.sql.catalog.ck_01.host=10.0.0.1 spark.sql.catalog.ck_01.protocol=http spark.sql.catalog.ck_01.http_port=8123 @@ -37,7 +37,7 @@ spark.sql.catalog.ck_01.user=app spark.sql.catalog.ck_01.password=pwd spark.sql.catalog.ck_01.database=default -spark.sql.catalog.ck_02=xenon.clickhouse.ClickHouseCatalog +spark.sql.catalog.ck_02=com.clickhouse.ClickHouseCatalog spark.sql.catalog.ck_02.host=10.0.0.2 spark.sql.catalog.ck_02.protocol=http spark.sql.catalog.ck_02.http_port=8123 diff --git a/docs/configurations/01_catalog_configurations.md b/docs/configurations/01_catalog_configurations.md index 5c0ad222..a8899cee 100644 --- a/docs/configurations/01_catalog_configurations.md +++ b/docs/configurations/01_catalog_configurations.md @@ -24,7 +24,7 @@ Edit `$SPARK_HOME/conf/spark-defaults.conf`. #################################################################################### ## register a catalog named "clickhouse" #################################################################################### -spark.sql.catalog.clickhouse xenon.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse com.clickhouse.ClickHouseCatalog #################################################################################### ## basic configurations for "clickhouse" catalog @@ -57,7 +57,7 @@ named clickhouse1, and another installed on `10.0.0.2` and exposes HTTPS endpoin Edit `$SPARK_HOME/conf/spark-defaults.conf`. ``` -spark.sql.catalog.clickhouse1 xenon.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse1 com.clickhouse.ClickHouseCatalog spark.sql.catalog.clickhouse1.host 10.0.0.1 spark.sql.catalog.clickhouse1.protocol https spark.sql.catalog.clickhouse1.http_port 8443 @@ -66,7 +66,7 @@ spark.sql.catalog.clickhouse1.password spark.sql.catalog.clickhouse1.database default spark.sql.catalog.clickhouse1.option.ssl true -spark.sql.catalog.clickhouse2 xenon.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse2 com.clickhouse.ClickHouseCatalog spark.sql.catalog.clickhouse2.host 10.0.0.2 spark.sql.catalog.clickhouse2.protocol https spark.sql.catalog.clickhouse2.http_port 8443 diff --git a/docs/quick_start/02_play_with_spark_sql.md b/docs/quick_start/02_play_with_spark_sql.md index f8c14905..a56bd2cc 100644 --- a/docs/quick_start/02_play_with_spark_sql.md +++ b/docs/quick_start/02_play_with_spark_sql.md @@ -23,7 +23,7 @@ for Production. ```shell $SPARK_HOME/bin/spark-sql \ - --conf spark.sql.catalog.clickhouse=xenon.clickhouse.ClickHouseCatalog \ + --conf spark.sql.catalog.clickhouse=com.clickhouse.ClickHouseCatalog \ --conf spark.sql.catalog.clickhouse.host=${CLICKHOUSE_HOST:-127.0.0.1} \ --conf spark.sql.catalog.clickhouse.protocol=http \ --conf spark.sql.catalog.clickhouse.http_port=${CLICKHOUSE_HTTP_PORT:-8123} \ diff --git a/docs/quick_start/03_play_with_spark_shell.md b/docs/quick_start/03_play_with_spark_shell.md index 7dcbf189..604c2573 100644 --- a/docs/quick_start/03_play_with_spark_shell.md +++ b/docs/quick_start/03_play_with_spark_shell.md @@ -20,7 +20,7 @@ Play with Spark Shell ```shell $SPARK_HOME/bin/spark-shell \ - --conf spark.sql.catalog.clickhouse=xenon.clickhouse.ClickHouseCatalog \ + --conf spark.sql.catalog.clickhouse=com.clickhouse.ClickHouseCatalog \ --conf spark.sql.catalog.clickhouse.host=${CLICKHOUSE_HOST:-127.0.0.1} \ --conf spark.sql.catalog.clickhouse.protocol=http \ --conf spark.sql.catalog.clickhouse.http_port=${CLICKHOUSE_HTTP_PORT:-8123} \ @@ -130,7 +130,7 @@ scala> val sql = """ | |ORDER BY id | """.stripMargin -scala> spark.executeCommand("xenon.clickhouse.ClickHouseCommandRunner", sql, options) +scala> spark.executeCommand("com.clickhouse.ClickHouseCommandRunner", sql, options) scala> spark.sql("show tables in clickhouse_s1r1.test_db").show +---------+---------+-----------+ diff --git a/spark-3.3/clickhouse-spark-it/src/test/resources/log4j2.xml b/spark-3.3/clickhouse-spark-it/src/test/resources/log4j2.xml index ecacca09..31e7b6a1 100644 --- a/spark-3.3/clickhouse-spark-it/src/test/resources/log4j2.xml +++ b/spark-3.3/clickhouse-spark-it/src/test/resources/log4j2.xml @@ -31,7 +31,7 @@ - + diff --git a/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala b/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala index 97eadc5f..709bce71 100644 --- a/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala +++ b/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.SparkConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.{DataFrame, QueryTest} -import xenon.clickhouse.ClickHouseCommandRunner +import com.clickhouse.ClickHouseCommandRunner import java.sql.{Date, Timestamp} import java.time.Instant diff --git a/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala b/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala index eff583ed..9655da33 100644 --- a/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala +++ b/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse.cluster import org.apache.spark.SparkConf import org.apache.spark.sql.clickhouse.SparkTest import org.apache.spark.sql.functions.{month, year} -import xenon.clickhouse.base.ClickHouseClusterMixIn +import com.clickhouse.base.ClickHouseClusterMixIn trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { @@ -29,7 +29,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.shuffle.partitions", "4") // catalog .set("spark.sql.defaultCatalog", "clickhouse_s1r1") - .set("spark.sql.catalog.clickhouse_s1r1", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s1r1", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s1r1.host", clickhouse_s1r1_host) .set("spark.sql.catalog.clickhouse_s1r1.http_port", clickhouse_s1r1_http_port.toString) .set("spark.sql.catalog.clickhouse_s1r1.protocol", "http") @@ -37,7 +37,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s1r1.password", "") .set("spark.sql.catalog.clickhouse_s1r1.database", "default") .set("spark.sql.catalog.clickhouse_s1r1.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s1r2", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s1r2", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s1r2.host", clickhouse_s1r2_host) .set("spark.sql.catalog.clickhouse_s1r2.http_port", clickhouse_s1r2_http_port.toString) .set("spark.sql.catalog.clickhouse_s1r2.protocol", "http") @@ -45,7 +45,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s1r2.password", "") .set("spark.sql.catalog.clickhouse_s1r2.database", "default") .set("spark.sql.catalog.clickhouse_s1r2.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s2r1", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s2r1", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s2r1.host", clickhouse_s2r1_host) .set("spark.sql.catalog.clickhouse_s2r1.http_port", clickhouse_s2r1_http_port.toString) .set("spark.sql.catalog.clickhouse_s2r1.protocol", "http") @@ -53,7 +53,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s2r1.password", "") .set("spark.sql.catalog.clickhouse_s2r1.database", "default") .set("spark.sql.catalog.clickhouse_s2r1.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s2r2", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s2r2", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s2r2.host", clickhouse_s2r2_host) .set("spark.sql.catalog.clickhouse_s2r2.http_port", clickhouse_s2r2_http_port.toString) .set("spark.sql.catalog.clickhouse_s2r2.protocol", "http") diff --git a/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala b/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala index 2c44f872..9654d11a 100644 --- a/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala +++ b/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala @@ -18,7 +18,7 @@ import org.apache.spark.SparkConf import org.apache.spark.sql.clickhouse.SparkTest import org.apache.spark.sql.functions.month import org.apache.spark.sql.types.StructType -import xenon.clickhouse.base.ClickHouseSingleMixIn +import com.clickhouse.base.ClickHouseSingleMixIn trait SparkClickHouseSingleTest extends SparkTest with ClickHouseSingleMixIn { @@ -30,7 +30,7 @@ trait SparkClickHouseSingleTest extends SparkTest with ClickHouseSingleMixIn { .set("spark.sql.shuffle.partitions", "2") // catalog .set("spark.sql.defaultCatalog", "clickhouse") - .set("spark.sql.catalog.clickhouse", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse.host", clickhouseHost) .set("spark.sql.catalog.clickhouse.http_port", clickhouseHttpPort.toString) .set("spark.sql.catalog.clickhouse.protocol", "http") diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCatalog.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala similarity index 98% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCatalog.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala index 5ff1bb68..3a823ffb 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCatalog.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import com.clickhouse.client.ClickHouseProtocol import org.apache.spark.sql.catalyst.analysis._ @@ -22,12 +22,12 @@ import org.apache.spark.sql.connector.catalog.functions.UnboundFunction import org.apache.spark.sql.connector.expressions.Transform import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap -import xenon.clickhouse.Constants._ -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.exception.ClickHouseErrCode._ -import xenon.clickhouse.func.{FunctionRegistry, _} -import xenon.clickhouse.spec._ +import com.clickhouse.Constants._ +import com.clickhouse.client.NodeClient +import com.clickhouse.exception.CHClientException +import com.clickhouse.exception.ClickHouseErrCode._ +import com.clickhouse.func.{FunctionRegistry, _} +import com.clickhouse.spec._ import java.time.ZoneId import java.util diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCommandRunner.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala similarity index 93% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCommandRunner.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala index cbdcebe6..f7da6bc4 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCommandRunner.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import org.apache.spark.sql.connector.ExternalCommandRunner import org.apache.spark.sql.util.CaseInsensitiveStringMap -import xenon.clickhouse.client.NodeClient +import com.clickhouse.client.NodeClient class ClickHouseCommandRunner extends ExternalCommandRunner with ClickHouseHelper { diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseHelper.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala similarity index 98% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseHelper.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala index d6ab35ef..46b62aee 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseHelper.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import com.clickhouse.client.ClickHouseProtocol import com.fasterxml.jackson.databind.JsonNode @@ -22,11 +22,11 @@ import org.apache.spark.sql.clickhouse.SchemaUtils import org.apache.spark.sql.connector.catalog.Identifier import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap -import xenon.clickhouse.Constants._ -import xenon.clickhouse.Utils.dateTimeFmt -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.exception.CHException -import xenon.clickhouse.spec._ +import com.clickhouse.Constants._ +import com.clickhouse.Utils.dateTimeFmt +import com.clickhouse.client.NodeClient +import com.clickhouse.exception.CHException +import com.clickhouse.spec._ import java.time.{LocalDateTime, ZoneId} import java.util.{HashMap => JHashMap} diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseTable.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala similarity index 97% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseTable.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala index 31113b82..484f07a7 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseTable.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import java.lang.{Integer => JInt, Long => JLong} import java.time.{LocalDate, ZoneId} @@ -33,12 +33,12 @@ import org.apache.spark.sql.sources.{AlwaysTrue, Filter} import org.apache.spark.sql.types._ import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.Utils._ -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.expr.{Expr, OrderExpr} -import xenon.clickhouse.read.{ClickHouseMetadataColumn, ClickHouseScanBuilder, ScanJobDescription} -import xenon.clickhouse.spec._ -import xenon.clickhouse.write.{ClickHouseWriteBuilder, WriteJobDescription} +import com.clickhouse.Utils._ +import com.clickhouse.client.NodeClient +import com.clickhouse.expr.{Expr, OrderExpr} +import com.clickhouse.read.{ClickHouseMetadataColumn, ClickHouseScanBuilder, ScanJobDescription} +import com.clickhouse.spec._ +import com.clickhouse.write.{ClickHouseWriteBuilder, WriteJobDescription} case class ClickHouseTable( node: NodeSpec, diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/CommitMessage.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala similarity index 96% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/CommitMessage.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala index 789ee1c4..75a93f0b 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/CommitMessage.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import org.apache.spark.sql.connector.write.WriterCommitMessage diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/Constants.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala similarity index 98% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/Constants.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala index 384fba2c..7facf6e7 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/Constants.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import com.clickhouse.client.config.ClickHouseClientOption._ diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/Metrics.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala similarity index 97% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/Metrics.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala index 9ec3da5e..944759f0 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/Metrics.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import org.apache.spark.sql.connector.metric.{CustomMetric, CustomSumMetric, CustomTaskMetric} -import xenon.clickhouse.Metrics._ +import com.clickhouse.Metrics._ case class TaskMetric(override val name: String, override val value: Long) extends CustomTaskMetric diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/SQLHelper.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala similarity index 98% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/SQLHelper.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala index cd84abfd..43b9146e 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/SQLHelper.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import java.sql.{Date, Timestamp} import java.time.{Instant, LocalDate, LocalDateTime, ZoneId} @@ -21,7 +21,7 @@ import org.apache.spark.sql.connector.expressions.aggregate._ import org.apache.spark.sql.connector.expressions.NamedReference import org.apache.spark.sql.sources._ import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.Utils._ +import com.clickhouse.Utils._ trait SQLHelper { diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/func/ClickHouseXxHash64.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/func/ClickHouseXxHash64.scala similarity index 97% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/func/ClickHouseXxHash64.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/func/ClickHouseXxHash64.scala index e7f223b0..2c08c164 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/func/ClickHouseXxHash64.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/func/ClickHouseXxHash64.scala @@ -12,13 +12,13 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func import org.apache.spark.sql.catalyst.expressions.XxHash64Function import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFunction, UnboundFunction} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.spec.{ClusterSpec, ShardUtils} +import com.clickhouse.spec.{ClusterSpec, ShardUtils} /** * ClickHouse equivalent function: diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/func/FunctionRegistry.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala similarity index 98% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/func/FunctionRegistry.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala index b41a7d1a..aa8d5858 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/func/FunctionRegistry.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func import org.apache.spark.sql.connector.catalog.functions.UnboundFunction diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseMetadataColumn.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala similarity index 98% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseMetadataColumn.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala index 2c5d0991..6e95401e 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseMetadataColumn.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read import org.apache.spark.sql.connector.catalog.MetadataColumn import org.apache.spark.sql.types.{DataType, DoubleType, IntegerType, LongType, StringType, StructField} diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseRead.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala similarity index 96% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseRead.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala index b8df3613..704fa1b3 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseRead.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ @@ -23,11 +23,11 @@ import org.apache.spark.sql.connector.read._ import org.apache.spark.sql.connector.read.partitioning.{Partitioning, UnknownPartitioning} import org.apache.spark.sql.sources.{AlwaysTrue, Filter} import org.apache.spark.sql.types.StructType -import xenon.clickhouse._ -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.read.format.{ClickHouseBinaryReader, ClickHouseJsonReader} -import xenon.clickhouse.spec._ +import com.clickhouse._ +import com.clickhouse.client.NodeClient +import com.clickhouse.exception.CHClientException +import com.clickhouse.read.format.{ClickHouseBinaryReader, ClickHouseJsonReader} +import com.clickhouse.spec._ import java.time.ZoneId import scala.util.control.NonFatal diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseReader.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala similarity index 92% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseReader.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala index 53f82485..629eb3c1 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseReader.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read import com.clickhouse.client.ClickHouseResponse import com.clickhouse.data.ClickHouseCompression @@ -21,10 +21,10 @@ import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ import org.apache.spark.sql.connector.metric.CustomTaskMetric import org.apache.spark.sql.connector.read.PartitionReader import org.apache.spark.sql.types._ -import xenon.clickhouse.Metrics.{BLOCKS_READ, BYTES_READ} -import xenon.clickhouse.client.{NodeClient, NodesClient} -import xenon.clickhouse.format.StreamOutput -import xenon.clickhouse.{ClickHouseHelper, Logging, TaskMetric} +import com.clickhouse.Metrics.{BLOCKS_READ, BYTES_READ} +import com.clickhouse.client.{NodeClient, NodesClient} +import com.clickhouse.format.StreamOutput +import com.clickhouse.{ClickHouseHelper, Logging, TaskMetric} abstract class ClickHouseReader[Record]( scanJob: ScanJobDescription, diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/InputPartitions.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala similarity index 97% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/InputPartitions.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala index bcfde4fb..5a2a4c62 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/InputPartitions.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read import org.apache.spark.sql.connector.read.InputPartition import org.apache.spark.sql.connector.read.partitioning.Partitioning -import xenon.clickhouse.spec._ +import com.clickhouse.spec._ case class ClickHousePartitioning(inputParts: Array[ClickHouseInputPartition]) extends Partitioning { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ScanJobDescription.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala similarity index 96% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ScanJobDescription.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala index f73f7c08..ddc8335a 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ScanJobDescription.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read import org.apache.spark.sql.clickhouse.ReadOptions import org.apache.spark.sql.types.StructType -import xenon.clickhouse.spec._ +import com.clickhouse.spec._ import java.time.ZoneId diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseBinaryReader.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala similarity index 94% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseBinaryReader.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala index 7c36cbef..bfa1c191 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseBinaryReader.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.read.format +package com.clickhouse.read.format import com.clickhouse.data.value.ClickHouseStringValue import com.clickhouse.data.{ClickHouseRecord, ClickHouseValue} @@ -21,8 +21,8 @@ import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, GenericArrayData} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} +import com.clickhouse.exception.CHClientException +import com.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import java.time.ZoneOffset import java.util.concurrent.TimeUnit diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseJsonReader.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala similarity index 93% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseJsonReader.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala index 0e703857..96b3e05a 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseJsonReader.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.read.format +package com.clickhouse.read.format import com.fasterxml.jackson.databind.JsonNode import org.apache.spark.sql.catalyst.InternalRow @@ -20,10 +20,10 @@ import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, GenericArrayData} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.Utils.{dateFmt, dateTimeFmt} -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.format.{JSONCompactEachRowWithNamesAndTypesStreamOutput, StreamOutput} -import xenon.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} +import com.clickhouse.Utils.{dateFmt, dateTimeFmt} +import com.clickhouse.exception.CHClientException +import com.clickhouse.format.{JSONCompactEachRowWithNamesAndTypesStreamOutput, StreamOutput} +import com.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import java.math.{MathContext, RoundingMode => RM} import java.time.{LocalDate, ZoneOffset, ZonedDateTime} diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWrite.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala similarity index 93% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWrite.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala index 8c06fa91..25f971e4 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWrite.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.write +package com.clickhouse.write import org.apache.spark.sql.catalyst.{InternalRow, SQLConfHelper} import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ @@ -20,9 +20,9 @@ import org.apache.spark.sql.connector.distributions.{Distribution, Distributions import org.apache.spark.sql.connector.expressions.SortOrder import org.apache.spark.sql.connector.metric.CustomMetric import org.apache.spark.sql.connector.write._ -import xenon.clickhouse._ -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.write.format.{ClickHouseArrowStreamWriter, ClickHouseJsonEachRowWriter} +import com.clickhouse._ +import com.clickhouse.exception.CHClientException +import com.clickhouse.write.format.{ClickHouseArrowStreamWriter, ClickHouseJsonEachRowWriter} class ClickHouseWriteBuilder(writeJob: WriteJobDescription) extends WriteBuilder { diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWriter.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala similarity index 97% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWriter.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala index d18319e5..a339da2d 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWriter.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.write +package com.clickhouse.write import com.clickhouse.client.ClickHouseProtocol import com.clickhouse.data.ClickHouseCompression @@ -23,12 +23,12 @@ import org.apache.spark.sql.clickhouse.ExprUtils import org.apache.spark.sql.connector.metric.CustomTaskMetric import org.apache.spark.sql.connector.write.{DataWriter, WriterCommitMessage} import org.apache.spark.sql.types._ -import xenon.clickhouse.Metrics._ -import xenon.clickhouse._ -import xenon.clickhouse.client.{ClusterClient, NodeClient} -import xenon.clickhouse.exception._ -import xenon.clickhouse.io.{ForwardingOutputStream, ObservableOutputStream} -import xenon.clickhouse.spec.{DistributedEngineSpec, ShardUtils} +import com.clickhouse.Metrics._ +import com.clickhouse._ +import com.clickhouse.client.{ClusterClient, NodeClient} +import com.clickhouse.exception._ +import com.clickhouse.io.{ForwardingOutputStream, ObservableOutputStream} +import com.clickhouse.spec.{DistributedEngineSpec, ShardUtils} import java.io.{ByteArrayInputStream, ByteArrayOutputStream, OutputStream} import java.util.concurrent.atomic.LongAdder diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/WriteJobDescription.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala similarity index 95% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/WriteJobDescription.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala index 9cd8262f..03100ed8 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/WriteJobDescription.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala @@ -12,15 +12,15 @@ * limitations under the License. */ -package xenon.clickhouse.write +package com.clickhouse.write import java.time.ZoneId import org.apache.spark.sql.clickhouse.{ExprUtils, WriteOptions} import org.apache.spark.sql.connector.expressions.{Expression, SortOrder, Transform} import org.apache.spark.sql.types.StructType -import xenon.clickhouse.expr.{Expr, FuncExpr, OrderExpr} -import xenon.clickhouse.spec._ +import com.clickhouse.expr.{Expr, FuncExpr, OrderExpr} +import com.clickhouse.spec._ case class WriteJobDescription( queryId: String, diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseArrowStreamWriter.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala similarity index 94% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseArrowStreamWriter.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala index 158ef987..a97e7d89 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseArrowStreamWriter.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.write.format +package com.clickhouse.write.format import org.apache.arrow.memory.BufferAllocator import org.apache.arrow.vector.VectorSchemaRoot @@ -21,7 +21,7 @@ import org.apache.arrow.vector.types.pojo.Schema import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.SparkUtils import org.apache.spark.sql.execution.arrow.ArrowWriter -import xenon.clickhouse.write.{ClickHouseWriter, WriteJobDescription} +import com.clickhouse.write.{ClickHouseWriter, WriteJobDescription} class ClickHouseArrowStreamWriter(writeJob: WriteJobDescription) extends ClickHouseWriter(writeJob) { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala similarity index 91% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala index 150ef225..64c0dafe 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala @@ -12,12 +12,12 @@ * limitations under the License. */ -package xenon.clickhouse.write.format +package com.clickhouse.write.format import org.apache.commons.io.IOUtils import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.JsonWriter -import xenon.clickhouse.write.{ClickHouseWriter, WriteJobDescription} +import com.clickhouse.write.{ClickHouseWriter, WriteJobDescription} class ClickHouseJsonEachRowWriter(writeJob: WriteJobDescription) extends ClickHouseWriter(writeJob) { diff --git a/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala b/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala index a7a7f9c8..c041ee7b 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala @@ -16,7 +16,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.internal.config.ConfigEntry import org.apache.spark.sql.internal.SQLConf._ -import xenon.clickhouse.exception.ClickHouseErrCode._ +import com.clickhouse.exception.ClickHouseErrCode._ import java.util.concurrent.TimeUnit diff --git a/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala b/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala index 314c65f3..05b8bc6b 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala @@ -21,8 +21,8 @@ import org.apache.spark.sql.clickhouse.ClickHouseSQLConf.IGNORE_UNSUPPORTED_TRAN import org.apache.spark.sql.connector.expressions.Expressions._ import org.apache.spark.sql.connector.expressions.{Expression => V2Expression, _} import org.apache.spark.sql.types.{IntegerType, LongType, StructField, StructType} -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.expr._ +import com.clickhouse.exception.CHClientException +import com.clickhouse.expr._ import scala.annotation.tailrec import scala.util.{Failure, Success, Try} diff --git a/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala b/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala index f0b564a4..6bb11760 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse import com.clickhouse.data.ClickHouseDataType._ import com.clickhouse.data.{ClickHouseColumn, ClickHouseDataType} import org.apache.spark.sql.types._ -import xenon.clickhouse.exception.CHClientException +import com.clickhouse.exception.CHClientException import org.apache.spark.sql.catalyst.SQLConfHelper import org.apache.spark.sql.clickhouse.ClickHouseSQLConf.READ_FIXED_STRING_AS diff --git a/spark-3.3/clickhouse-spark/src/test/resources/log4j2.xml b/spark-3.3/clickhouse-spark/src/test/resources/log4j2.xml index ecacca09..31e7b6a1 100644 --- a/spark-3.3/clickhouse-spark/src/test/resources/log4j2.xml +++ b/spark-3.3/clickhouse-spark/src/test/resources/log4j2.xml @@ -31,7 +31,7 @@ - + diff --git a/spark-3.3/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala b/spark-3.3/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala index 1eb6a09c..898240e6 100644 --- a/spark-3.3/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala +++ b/spark-3.3/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala @@ -16,7 +16,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.scalatest.funsuite.AnyFunSuite -import xenon.clickhouse.ClickHouseHelper +import com.clickhouse.ClickHouseHelper import scala.collection.JavaConverters._ diff --git a/spark-3.4/clickhouse-spark-it/src/test/resources/log4j2.xml b/spark-3.4/clickhouse-spark-it/src/test/resources/log4j2.xml index ecacca09..31e7b6a1 100644 --- a/spark-3.4/clickhouse-spark-it/src/test/resources/log4j2.xml +++ b/spark-3.4/clickhouse-spark-it/src/test/resources/log4j2.xml @@ -31,7 +31,7 @@ - + diff --git a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala index 97eadc5f..709bce71 100644 --- a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala +++ b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.SparkConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.{DataFrame, QueryTest} -import xenon.clickhouse.ClickHouseCommandRunner +import com.clickhouse.ClickHouseCommandRunner import java.sql.{Date, Timestamp} import java.time.Instant diff --git a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala index d6bab146..257494fd 100644 --- a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala +++ b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala @@ -15,7 +15,7 @@ package org.apache.spark.sql.clickhouse.cluster import org.apache.spark.sql.clickhouse.TestUtils.om -import xenon.clickhouse.func._ +import com.clickhouse.func._ import java.lang.{Long => JLong} class ClickHouseClusterHashUDFSuite extends SparkClickHouseClusterTest { diff --git a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala index eff583ed..9655da33 100644 --- a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala +++ b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse.cluster import org.apache.spark.SparkConf import org.apache.spark.sql.clickhouse.SparkTest import org.apache.spark.sql.functions.{month, year} -import xenon.clickhouse.base.ClickHouseClusterMixIn +import com.clickhouse.base.ClickHouseClusterMixIn trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { @@ -29,7 +29,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.shuffle.partitions", "4") // catalog .set("spark.sql.defaultCatalog", "clickhouse_s1r1") - .set("spark.sql.catalog.clickhouse_s1r1", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s1r1", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s1r1.host", clickhouse_s1r1_host) .set("spark.sql.catalog.clickhouse_s1r1.http_port", clickhouse_s1r1_http_port.toString) .set("spark.sql.catalog.clickhouse_s1r1.protocol", "http") @@ -37,7 +37,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s1r1.password", "") .set("spark.sql.catalog.clickhouse_s1r1.database", "default") .set("spark.sql.catalog.clickhouse_s1r1.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s1r2", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s1r2", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s1r2.host", clickhouse_s1r2_host) .set("spark.sql.catalog.clickhouse_s1r2.http_port", clickhouse_s1r2_http_port.toString) .set("spark.sql.catalog.clickhouse_s1r2.protocol", "http") @@ -45,7 +45,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s1r2.password", "") .set("spark.sql.catalog.clickhouse_s1r2.database", "default") .set("spark.sql.catalog.clickhouse_s1r2.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s2r1", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s2r1", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s2r1.host", clickhouse_s2r1_host) .set("spark.sql.catalog.clickhouse_s2r1.http_port", clickhouse_s2r1_http_port.toString) .set("spark.sql.catalog.clickhouse_s2r1.protocol", "http") @@ -53,7 +53,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s2r1.password", "") .set("spark.sql.catalog.clickhouse_s2r1.database", "default") .set("spark.sql.catalog.clickhouse_s2r1.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s2r2", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s2r2", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s2r2.host", clickhouse_s2r2_host) .set("spark.sql.catalog.clickhouse_s2r2.http_port", clickhouse_s2r2_http_port.toString) .set("spark.sql.catalog.clickhouse_s2r2.protocol", "http") diff --git a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala index 2c44f872..9654d11a 100644 --- a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala +++ b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala @@ -18,7 +18,7 @@ import org.apache.spark.SparkConf import org.apache.spark.sql.clickhouse.SparkTest import org.apache.spark.sql.functions.month import org.apache.spark.sql.types.StructType -import xenon.clickhouse.base.ClickHouseSingleMixIn +import com.clickhouse.base.ClickHouseSingleMixIn trait SparkClickHouseSingleTest extends SparkTest with ClickHouseSingleMixIn { @@ -30,7 +30,7 @@ trait SparkClickHouseSingleTest extends SparkTest with ClickHouseSingleMixIn { .set("spark.sql.shuffle.partitions", "2") // catalog .set("spark.sql.defaultCatalog", "clickhouse") - .set("spark.sql.catalog.clickhouse", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse.host", clickhouseHost) .set("spark.sql.catalog.clickhouse.http_port", clickhouseHttpPort.toString) .set("spark.sql.catalog.clickhouse.protocol", "http") diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCatalog.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala similarity index 97% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCatalog.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala index 9698e823..6da0392e 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCatalog.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import com.clickhouse.client.ClickHouseProtocol import org.apache.spark.sql.catalyst.analysis._ @@ -22,12 +22,12 @@ import org.apache.spark.sql.connector.catalog.functions.UnboundFunction import org.apache.spark.sql.connector.expressions.Transform import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap -import xenon.clickhouse.Constants._ -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.exception.ClickHouseErrCode._ -import xenon.clickhouse.func.{ClickHouseXxHash64Shard, FunctionRegistry, _} -import xenon.clickhouse.spec._ +import com.clickhouse.Constants._ +import com.clickhouse.client.NodeClient +import com.clickhouse.exception.CHClientException +import com.clickhouse.exception.ClickHouseErrCode._ +import com.clickhouse.func.{ClickHouseXxHash64Shard, FunctionRegistry, _} +import com.clickhouse.spec._ import java.time.ZoneId import java.util diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCommandRunner.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala similarity index 93% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCommandRunner.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala index cbdcebe6..f7da6bc4 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCommandRunner.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import org.apache.spark.sql.connector.ExternalCommandRunner import org.apache.spark.sql.util.CaseInsensitiveStringMap -import xenon.clickhouse.client.NodeClient +import com.clickhouse.client.NodeClient class ClickHouseCommandRunner extends ExternalCommandRunner with ClickHouseHelper { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseHelper.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala similarity index 98% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseHelper.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala index 850c4b2f..9f648d4f 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseHelper.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import com.clickhouse.client.ClickHouseProtocol import com.fasterxml.jackson.databind.JsonNode @@ -22,11 +22,11 @@ import org.apache.spark.sql.clickhouse.SchemaUtils import org.apache.spark.sql.connector.catalog.Identifier import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap -import xenon.clickhouse.Constants._ -import xenon.clickhouse.Utils.dateTimeFmt -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.exception.CHException -import xenon.clickhouse.spec._ +import com.clickhouse.Constants._ +import com.clickhouse.Utils.dateTimeFmt +import com.clickhouse.client.NodeClient +import com.clickhouse.exception.CHException +import com.clickhouse.spec._ import java.time.{LocalDateTime, ZoneId} import java.util.{HashMap => JHashMap} diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseTable.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala similarity index 96% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseTable.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala index 83846c34..9b3a44be 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseTable.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.{InternalRow, SQLConfHelper} @@ -27,13 +27,13 @@ import org.apache.spark.sql.sources.{AlwaysTrue, Filter} import org.apache.spark.sql.types._ import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.Utils._ -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.expr.{Expr, OrderExpr} -import xenon.clickhouse.func.FunctionRegistry -import xenon.clickhouse.read.{ClickHouseMetadataColumn, ClickHouseScanBuilder, ScanJobDescription} -import xenon.clickhouse.spec._ -import xenon.clickhouse.write.{ClickHouseWriteBuilder, WriteJobDescription} +import com.clickhouse.Utils._ +import com.clickhouse.client.NodeClient +import com.clickhouse.expr.{Expr, OrderExpr} +import com.clickhouse.func.FunctionRegistry +import com.clickhouse.read.{ClickHouseMetadataColumn, ClickHouseScanBuilder, ScanJobDescription} +import com.clickhouse.spec._ +import com.clickhouse.write.{ClickHouseWriteBuilder, WriteJobDescription} import java.lang.{Integer => JInt, Long => JLong} import java.time.{LocalDate, ZoneId} diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/CommitMessage.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala similarity index 96% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/CommitMessage.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala index 789ee1c4..75a93f0b 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/CommitMessage.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import org.apache.spark.sql.connector.write.WriterCommitMessage diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/Constants.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala similarity index 98% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/Constants.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala index 384fba2c..7facf6e7 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/Constants.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import com.clickhouse.client.config.ClickHouseClientOption._ diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/Metrics.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala similarity index 97% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/Metrics.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala index 9ec3da5e..944759f0 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/Metrics.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import org.apache.spark.sql.connector.metric.{CustomMetric, CustomSumMetric, CustomTaskMetric} -import xenon.clickhouse.Metrics._ +import com.clickhouse.Metrics._ case class TaskMetric(override val name: String, override val value: Long) extends CustomTaskMetric diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/SQLHelper.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala similarity index 98% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/SQLHelper.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala index cd84abfd..43b9146e 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/SQLHelper.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import java.sql.{Date, Timestamp} import java.time.{Instant, LocalDate, LocalDateTime, ZoneId} @@ -21,7 +21,7 @@ import org.apache.spark.sql.connector.expressions.aggregate._ import org.apache.spark.sql.connector.expressions.NamedReference import org.apache.spark.sql.sources._ import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.Utils._ +import com.clickhouse.Utils._ trait SQLHelper { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/CityHash64.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/CityHash64.scala similarity index 94% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/CityHash64.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/CityHash64.scala index d9efa705..6dd26a5c 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/CityHash64.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/CityHash64.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func -import xenon.clickhouse.hash +import com.clickhouse.hash // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L694 object CityHash64 extends MultiStringArgsHash { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/FunctionRegistry.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala similarity index 99% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/FunctionRegistry.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala index 8faf6564..d43ae2ec 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/FunctionRegistry.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func import org.apache.spark.sql.connector.catalog.functions.UnboundFunction diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MultiStringArgsHash.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MultiStringArgsHash.scala similarity index 98% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MultiStringArgsHash.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MultiStringArgsHash.scala index c99bf247..4b212561 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MultiStringArgsHash.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MultiStringArgsHash.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFunction, UnboundFunction} diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MurmurHash2.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash2.scala similarity index 93% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MurmurHash2.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash2.scala index 82332e32..90d6bb63 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MurmurHash2.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash2.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func -import xenon.clickhouse.hash -import xenon.clickhouse.hash.HashUtils +import com.clickhouse.hash +import com.clickhouse.hash.HashUtils // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L460 object MurmurHash2_64 extends MultiStringArgsHash { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MurmurHash3.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash3.scala similarity index 93% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MurmurHash3.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash3.scala index 3a53c952..7c328218 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MurmurHash3.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash3.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func -import xenon.clickhouse.hash -import xenon.clickhouse.hash.HashUtils +import com.clickhouse.hash +import com.clickhouse.hash.HashUtils // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L543 object MurmurHash3_64 extends MultiStringArgsHash { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/XxHash64.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/XxHash64.scala similarity index 97% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/XxHash64.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/XxHash64.scala index 3c4a5b1a..6c0b0593 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/XxHash64.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/XxHash64.scala @@ -12,13 +12,13 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func import org.apache.spark.sql.catalyst.expressions.XxHash64Function import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFunction, UnboundFunction} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.spec.{ClusterSpec, ShardUtils} +import com.clickhouse.spec.{ClusterSpec, ShardUtils} /** * ClickHouse equivalent function: diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseMetadataColumn.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala similarity index 98% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseMetadataColumn.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala index 2c5d0991..6e95401e 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseMetadataColumn.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read import org.apache.spark.sql.connector.catalog.MetadataColumn import org.apache.spark.sql.types.{DataType, DoubleType, IntegerType, LongType, StringType, StructField} diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseRead.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala similarity index 96% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseRead.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala index b8df3613..704fa1b3 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseRead.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ @@ -23,11 +23,11 @@ import org.apache.spark.sql.connector.read._ import org.apache.spark.sql.connector.read.partitioning.{Partitioning, UnknownPartitioning} import org.apache.spark.sql.sources.{AlwaysTrue, Filter} import org.apache.spark.sql.types.StructType -import xenon.clickhouse._ -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.read.format.{ClickHouseBinaryReader, ClickHouseJsonReader} -import xenon.clickhouse.spec._ +import com.clickhouse._ +import com.clickhouse.client.NodeClient +import com.clickhouse.exception.CHClientException +import com.clickhouse.read.format.{ClickHouseBinaryReader, ClickHouseJsonReader} +import com.clickhouse.spec._ import java.time.ZoneId import scala.util.control.NonFatal diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseReader.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala similarity index 92% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseReader.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala index 53f82485..629eb3c1 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseReader.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read import com.clickhouse.client.ClickHouseResponse import com.clickhouse.data.ClickHouseCompression @@ -21,10 +21,10 @@ import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ import org.apache.spark.sql.connector.metric.CustomTaskMetric import org.apache.spark.sql.connector.read.PartitionReader import org.apache.spark.sql.types._ -import xenon.clickhouse.Metrics.{BLOCKS_READ, BYTES_READ} -import xenon.clickhouse.client.{NodeClient, NodesClient} -import xenon.clickhouse.format.StreamOutput -import xenon.clickhouse.{ClickHouseHelper, Logging, TaskMetric} +import com.clickhouse.Metrics.{BLOCKS_READ, BYTES_READ} +import com.clickhouse.client.{NodeClient, NodesClient} +import com.clickhouse.format.StreamOutput +import com.clickhouse.{ClickHouseHelper, Logging, TaskMetric} abstract class ClickHouseReader[Record]( scanJob: ScanJobDescription, diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/InputPartitions.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala similarity index 97% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/InputPartitions.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala index bcfde4fb..5a2a4c62 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/InputPartitions.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read import org.apache.spark.sql.connector.read.InputPartition import org.apache.spark.sql.connector.read.partitioning.Partitioning -import xenon.clickhouse.spec._ +import com.clickhouse.spec._ case class ClickHousePartitioning(inputParts: Array[ClickHouseInputPartition]) extends Partitioning { diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ScanJobDescription.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala similarity index 96% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ScanJobDescription.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala index f73f7c08..ddc8335a 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ScanJobDescription.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read import org.apache.spark.sql.clickhouse.ReadOptions import org.apache.spark.sql.types.StructType -import xenon.clickhouse.spec._ +import com.clickhouse.spec._ import java.time.ZoneId diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseBinaryReader.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala similarity index 94% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseBinaryReader.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala index 7c36cbef..bfa1c191 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseBinaryReader.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.read.format +package com.clickhouse.read.format import com.clickhouse.data.value.ClickHouseStringValue import com.clickhouse.data.{ClickHouseRecord, ClickHouseValue} @@ -21,8 +21,8 @@ import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, GenericArrayData} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} +import com.clickhouse.exception.CHClientException +import com.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import java.time.ZoneOffset import java.util.concurrent.TimeUnit diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseJsonReader.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala similarity index 93% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseJsonReader.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala index 0e703857..96b3e05a 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseJsonReader.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.read.format +package com.clickhouse.read.format import com.fasterxml.jackson.databind.JsonNode import org.apache.spark.sql.catalyst.InternalRow @@ -20,10 +20,10 @@ import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, GenericArrayData} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.Utils.{dateFmt, dateTimeFmt} -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.format.{JSONCompactEachRowWithNamesAndTypesStreamOutput, StreamOutput} -import xenon.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} +import com.clickhouse.Utils.{dateFmt, dateTimeFmt} +import com.clickhouse.exception.CHClientException +import com.clickhouse.format.{JSONCompactEachRowWithNamesAndTypesStreamOutput, StreamOutput} +import com.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import java.math.{MathContext, RoundingMode => RM} import java.time.{LocalDate, ZoneOffset, ZonedDateTime} diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWrite.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala similarity index 92% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWrite.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala index ddb9967d..504f69ae 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWrite.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.write +package com.clickhouse.write import org.apache.spark.sql.catalyst.{InternalRow, SQLConfHelper} import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ @@ -20,9 +20,9 @@ import org.apache.spark.sql.connector.distributions.{Distribution, Distributions import org.apache.spark.sql.connector.expressions.SortOrder import org.apache.spark.sql.connector.metric.CustomMetric import org.apache.spark.sql.connector.write._ -import xenon.clickhouse._ -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.write.format.{ClickHouseArrowStreamWriter, ClickHouseJsonEachRowWriter} +import com.clickhouse._ +import com.clickhouse.exception.CHClientException +import com.clickhouse.write.format.{ClickHouseArrowStreamWriter, ClickHouseJsonEachRowWriter} class ClickHouseWriteBuilder(writeJob: WriteJobDescription) extends WriteBuilder { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWriter.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala similarity index 97% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWriter.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala index 56e1b457..ccb29d18 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWriter.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.write +package com.clickhouse.write import com.clickhouse.client.ClickHouseProtocol import com.clickhouse.data.ClickHouseCompression @@ -24,12 +24,12 @@ import org.apache.spark.sql.clickhouse.ExprUtils import org.apache.spark.sql.connector.metric.CustomTaskMetric import org.apache.spark.sql.connector.write.{DataWriter, WriterCommitMessage} import org.apache.spark.sql.types._ -import xenon.clickhouse.Metrics._ -import xenon.clickhouse._ -import xenon.clickhouse.client.{ClusterClient, NodeClient} -import xenon.clickhouse.exception._ -import xenon.clickhouse.io.{ForwardingOutputStream, ObservableOutputStream} -import xenon.clickhouse.spec.{DistributedEngineSpec, ShardUtils} +import com.clickhouse.Metrics._ +import com.clickhouse._ +import com.clickhouse.client.{ClusterClient, NodeClient} +import com.clickhouse.exception._ +import com.clickhouse.io.{ForwardingOutputStream, ObservableOutputStream} +import com.clickhouse.spec.{DistributedEngineSpec, ShardUtils} import java.io.{ByteArrayInputStream, ByteArrayOutputStream, OutputStream} import java.util.concurrent.atomic.LongAdder diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/WriteJobDescription.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala similarity index 94% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/WriteJobDescription.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala index 411f08a4..e1ba1e5e 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/WriteJobDescription.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala @@ -12,15 +12,15 @@ * limitations under the License. */ -package xenon.clickhouse.write +package com.clickhouse.write import java.time.ZoneId import org.apache.spark.sql.clickhouse.{ExprUtils, WriteOptions} import org.apache.spark.sql.connector.expressions.{Expression, SortOrder, Transform} import org.apache.spark.sql.types.StructType -import xenon.clickhouse.expr.{Expr, FuncExpr, OrderExpr} -import xenon.clickhouse.func.FunctionRegistry -import xenon.clickhouse.spec._ +import com.clickhouse.expr.{Expr, FuncExpr, OrderExpr} +import com.clickhouse.func.FunctionRegistry +import com.clickhouse.spec._ case class WriteJobDescription( queryId: String, diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseArrowStreamWriter.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala similarity index 94% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseArrowStreamWriter.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala index 158ef987..a97e7d89 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseArrowStreamWriter.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.write.format +package com.clickhouse.write.format import org.apache.arrow.memory.BufferAllocator import org.apache.arrow.vector.VectorSchemaRoot @@ -21,7 +21,7 @@ import org.apache.arrow.vector.types.pojo.Schema import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.SparkUtils import org.apache.spark.sql.execution.arrow.ArrowWriter -import xenon.clickhouse.write.{ClickHouseWriter, WriteJobDescription} +import com.clickhouse.write.{ClickHouseWriter, WriteJobDescription} class ClickHouseArrowStreamWriter(writeJob: WriteJobDescription) extends ClickHouseWriter(writeJob) { diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala similarity index 91% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala index 150ef225..64c0dafe 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala @@ -12,12 +12,12 @@ * limitations under the License. */ -package xenon.clickhouse.write.format +package com.clickhouse.write.format import org.apache.commons.io.IOUtils import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.JsonWriter -import xenon.clickhouse.write.{ClickHouseWriter, WriteJobDescription} +import com.clickhouse.write.{ClickHouseWriter, WriteJobDescription} class ClickHouseJsonEachRowWriter(writeJob: WriteJobDescription) extends ClickHouseWriter(writeJob) { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala b/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala index a7a7f9c8..c041ee7b 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala @@ -16,7 +16,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.internal.config.ConfigEntry import org.apache.spark.sql.internal.SQLConf._ -import xenon.clickhouse.exception.ClickHouseErrCode._ +import com.clickhouse.exception.ClickHouseErrCode._ import java.util.concurrent.TimeUnit diff --git a/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala b/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala index 3aaa3a69..ea8dd36f 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala @@ -28,10 +28,10 @@ import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFu import org.apache.spark.sql.connector.expressions.Expressions._ import org.apache.spark.sql.connector.expressions.{Expression => V2Expression, SortOrder => V2SortOrder, _} import org.apache.spark.sql.types.{StructField, StructType} -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.expr._ -import xenon.clickhouse.func.FunctionRegistry -import xenon.clickhouse.spec.ClusterSpec +import com.clickhouse.exception.CHClientException +import com.clickhouse.expr._ +import com.clickhouse.func.FunctionRegistry +import com.clickhouse.spec.ClusterSpec import scala.util.{Failure, Success, Try} diff --git a/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala b/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala index f0b564a4..6bb11760 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse import com.clickhouse.data.ClickHouseDataType._ import com.clickhouse.data.{ClickHouseColumn, ClickHouseDataType} import org.apache.spark.sql.types._ -import xenon.clickhouse.exception.CHClientException +import com.clickhouse.exception.CHClientException import org.apache.spark.sql.catalyst.SQLConfHelper import org.apache.spark.sql.clickhouse.ClickHouseSQLConf.READ_FIXED_STRING_AS diff --git a/spark-3.4/clickhouse-spark/src/test/resources/log4j2.xml b/spark-3.4/clickhouse-spark/src/test/resources/log4j2.xml index ecacca09..31e7b6a1 100644 --- a/spark-3.4/clickhouse-spark/src/test/resources/log4j2.xml +++ b/spark-3.4/clickhouse-spark/src/test/resources/log4j2.xml @@ -31,7 +31,7 @@ - + diff --git a/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala b/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala index 1eb6a09c..898240e6 100644 --- a/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala +++ b/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala @@ -16,7 +16,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.scalatest.funsuite.AnyFunSuite -import xenon.clickhouse.ClickHouseHelper +import com.clickhouse.ClickHouseHelper import scala.collection.JavaConverters._ diff --git a/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala b/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala index 2fd17e94..597659b6 100644 --- a/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala +++ b/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.internal.config.ConfigEntry import org.apache.spark.sql.internal.SQLConf import org.scalatest.funsuite.AnyFunSuite -import xenon.clickhouse.Utils +import com.clickhouse.Utils import java.nio.charset.StandardCharsets import java.nio.file.{Files, Path, Paths, StandardOpenOption} diff --git a/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala b/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala index 0f3422fd..45188209 100644 --- a/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala +++ b/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala @@ -15,7 +15,7 @@ package org.apache.spark.sql.clickhouse import org.scalatest.funsuite.AnyFunSuite -import xenon.clickhouse.func._ +import com.clickhouse.func._ class FunctionRegistrySuite extends AnyFunSuite { diff --git a/spark-3.5/clickhouse-spark-it/src/test/resources/log4j2.xml b/spark-3.5/clickhouse-spark-it/src/test/resources/log4j2.xml index ecacca09..31e7b6a1 100644 --- a/spark-3.5/clickhouse-spark-it/src/test/resources/log4j2.xml +++ b/spark-3.5/clickhouse-spark-it/src/test/resources/log4j2.xml @@ -31,7 +31,7 @@ - + diff --git a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala index 97eadc5f..709bce71 100644 --- a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala +++ b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.SparkConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.{DataFrame, QueryTest} -import xenon.clickhouse.ClickHouseCommandRunner +import com.clickhouse.ClickHouseCommandRunner import java.sql.{Date, Timestamp} import java.time.Instant diff --git a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala index d6bab146..257494fd 100644 --- a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala +++ b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala @@ -15,7 +15,7 @@ package org.apache.spark.sql.clickhouse.cluster import org.apache.spark.sql.clickhouse.TestUtils.om -import xenon.clickhouse.func._ +import com.clickhouse.func._ import java.lang.{Long => JLong} class ClickHouseClusterHashUDFSuite extends SparkClickHouseClusterTest { diff --git a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala index eff583ed..aa7446f6 100644 --- a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala +++ b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala @@ -14,10 +14,10 @@ package org.apache.spark.sql.clickhouse.cluster +import com.clickhouse.base.ClickHouseClusterMixIn import org.apache.spark.SparkConf import org.apache.spark.sql.clickhouse.SparkTest import org.apache.spark.sql.functions.{month, year} -import xenon.clickhouse.base.ClickHouseClusterMixIn trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { @@ -29,7 +29,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.shuffle.partitions", "4") // catalog .set("spark.sql.defaultCatalog", "clickhouse_s1r1") - .set("spark.sql.catalog.clickhouse_s1r1", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s1r1", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s1r1.host", clickhouse_s1r1_host) .set("spark.sql.catalog.clickhouse_s1r1.http_port", clickhouse_s1r1_http_port.toString) .set("spark.sql.catalog.clickhouse_s1r1.protocol", "http") @@ -37,7 +37,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s1r1.password", "") .set("spark.sql.catalog.clickhouse_s1r1.database", "default") .set("spark.sql.catalog.clickhouse_s1r1.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s1r2", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s1r2", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s1r2.host", clickhouse_s1r2_host) .set("spark.sql.catalog.clickhouse_s1r2.http_port", clickhouse_s1r2_http_port.toString) .set("spark.sql.catalog.clickhouse_s1r2.protocol", "http") @@ -45,7 +45,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s1r2.password", "") .set("spark.sql.catalog.clickhouse_s1r2.database", "default") .set("spark.sql.catalog.clickhouse_s1r2.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s2r1", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s2r1", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s2r1.host", clickhouse_s2r1_host) .set("spark.sql.catalog.clickhouse_s2r1.http_port", clickhouse_s2r1_http_port.toString) .set("spark.sql.catalog.clickhouse_s2r1.protocol", "http") @@ -53,7 +53,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s2r1.password", "") .set("spark.sql.catalog.clickhouse_s2r1.database", "default") .set("spark.sql.catalog.clickhouse_s2r1.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s2r2", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s2r2", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s2r2.host", clickhouse_s2r2_host) .set("spark.sql.catalog.clickhouse_s2r2.http_port", clickhouse_s2r2_http_port.toString) .set("spark.sql.catalog.clickhouse_s2r2.protocol", "http") diff --git a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala index 2c44f872..ee14dd20 100644 --- a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala +++ b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala @@ -14,11 +14,11 @@ package org.apache.spark.sql.clickhouse.single +import com.clickhouse.base.ClickHouseSingleMixIn import org.apache.spark.SparkConf import org.apache.spark.sql.clickhouse.SparkTest import org.apache.spark.sql.functions.month import org.apache.spark.sql.types.StructType -import xenon.clickhouse.base.ClickHouseSingleMixIn trait SparkClickHouseSingleTest extends SparkTest with ClickHouseSingleMixIn { @@ -30,7 +30,7 @@ trait SparkClickHouseSingleTest extends SparkTest with ClickHouseSingleMixIn { .set("spark.sql.shuffle.partitions", "2") // catalog .set("spark.sql.defaultCatalog", "clickhouse") - .set("spark.sql.catalog.clickhouse", "xenon.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse", "com.clickhouse.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse.host", clickhouseHost) .set("spark.sql.catalog.clickhouse.http_port", clickhouseHttpPort.toString) .set("spark.sql.catalog.clickhouse.protocol", "http") diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCatalog.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala similarity index 96% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCatalog.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala index 9698e823..e4081c2d 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCatalog.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala @@ -12,9 +12,10 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse -import com.clickhouse.client.ClickHouseProtocol +import com.clickhouse.client.{ClickHouseProtocol, NodeClient} +import com.clickhouse.exception.CHClientException import org.apache.spark.sql.catalyst.analysis._ import org.apache.spark.sql.clickhouse.{ExprUtils, SchemaUtils} import org.apache.spark.sql.connector.catalog._ @@ -22,12 +23,13 @@ import org.apache.spark.sql.connector.catalog.functions.UnboundFunction import org.apache.spark.sql.connector.expressions.Transform import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap -import xenon.clickhouse.Constants._ -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.exception.ClickHouseErrCode._ -import xenon.clickhouse.func.{ClickHouseXxHash64Shard, FunctionRegistry, _} -import xenon.clickhouse.spec._ +import Constants._ +import com.clickhouse +import com.clickhouse.exception.ClickHouseErrCode._ +import com.clickhouse.func.{ClickHouseXxHash64Shard, CompositeFunctionRegistry, DynamicFunctionRegistry, FunctionRegistry, StaticFunctionRegistry} +import com.clickhouse.spec.{ClusterSpec, DistributedEngineSpec, NodeSpec, TableEngineUtils} +import com.clickhouse.func._ +import com.clickhouse.spec._ import java.time.ZoneId import java.util @@ -137,7 +139,7 @@ class ClickHouseCatalog extends TableCatalog Some(TableEngineUtils.resolveTableCluster(distributeSpec, clusterSpecs)) case _ => None } - ClickHouseTable( + clickhouse.ClickHouseTable( nodeSpec, tableClusterSpec, _tz, diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCommandRunner.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala similarity index 86% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCommandRunner.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala index cbdcebe6..285b5bad 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCommandRunner.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala @@ -12,16 +12,16 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse +import com.clickhouse.client.NodeClient import org.apache.spark.sql.connector.ExternalCommandRunner import org.apache.spark.sql.util.CaseInsensitiveStringMap -import xenon.clickhouse.client.NodeClient class ClickHouseCommandRunner extends ExternalCommandRunner with ClickHouseHelper { override def executeCommand(sql: String, options: CaseInsensitiveStringMap): Array[String] = - Utils.tryWithResource(NodeClient(buildNodeSpec(options))) { nodeClient => + Utils.tryWithResource(client.NodeClient(buildNodeSpec(options))) { nodeClient => nodeClient.syncQueryAndCheckOutputJSONEachRow(sql).records.map(_.toString).toArray } } diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseHelper.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala similarity index 97% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseHelper.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala index 850c4b2f..8541801c 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseHelper.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala @@ -12,9 +12,10 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse -import com.clickhouse.client.ClickHouseProtocol +import com.clickhouse.client.{ClickHouseProtocol, NodeClient} +import com.clickhouse.exception.CHException import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.NullNode import org.apache.spark.sql.catalyst.analysis.{NoSuchNamespaceException, NoSuchTableException} @@ -22,11 +23,10 @@ import org.apache.spark.sql.clickhouse.SchemaUtils import org.apache.spark.sql.connector.catalog.Identifier import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap -import xenon.clickhouse.Constants._ -import xenon.clickhouse.Utils.dateTimeFmt -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.exception.CHException -import xenon.clickhouse.spec._ +import Constants._ +import Utils.dateTimeFmt +import com.clickhouse.spec.{ClusterSpec, DatabaseSpec, NoPartitionSpec, NodeSpec, PartitionSpec, ReplicaSpec, ShardSpec, TableSpec} +import com.clickhouse.spec._ import java.time.{LocalDateTime, ZoneId} import java.util.{HashMap => JHashMap} diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseTable.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala similarity index 94% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseTable.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala index 83846c34..de9f1264 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseTable.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala @@ -12,8 +12,11 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse +import com.clickhouse.client.NodeClient +import com.clickhouse.expr.{Expr, OrderExpr} +import com.clickhouse.func.FunctionRegistry import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.{InternalRow, SQLConfHelper} import org.apache.spark.sql.clickhouse.ClickHouseSQLConf.{READ_DISTRIBUTED_CONVERT_LOCAL, USE_NULLABLE_QUERY_SCHEMA} @@ -27,13 +30,11 @@ import org.apache.spark.sql.sources.{AlwaysTrue, Filter} import org.apache.spark.sql.types._ import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.Utils._ -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.expr.{Expr, OrderExpr} -import xenon.clickhouse.func.FunctionRegistry -import xenon.clickhouse.read.{ClickHouseMetadataColumn, ClickHouseScanBuilder, ScanJobDescription} -import xenon.clickhouse.spec._ -import xenon.clickhouse.write.{ClickHouseWriteBuilder, WriteJobDescription} +import Utils._ +import com.clickhouse.read.{ClickHouseMetadataColumn, ClickHouseScanBuilder, ScanJobDescription} +import com.clickhouse.spec.{ClusterSpec, DistributedEngineSpec, MergeTreeFamilyEngineSpec, NodeSpec, PartitionSpec, TableEngineSpec, TableEngineUtils, TableSpec} +import com.clickhouse.write.{ClickHouseWriteBuilder, WriteJobDescription} +import com.clickhouse.spec._ import java.lang.{Integer => JInt, Long => JLong} import java.time.{LocalDate, ZoneId} @@ -144,7 +145,7 @@ case class ClickHouseTable( override lazy val properties: util.Map[String, String] = spec.toJavaMap override def newScanBuilder(options: CaseInsensitiveStringMap): ScanBuilder = { - val scanJob = ScanJobDescription( + val scanJob = read.ScanJobDescription( node = node, tz = tz, tableSpec = spec, @@ -160,7 +161,7 @@ case class ClickHouseTable( } override def newWriteBuilder(info: LogicalWriteInfo): ClickHouseWriteBuilder = { - val writeJob = WriteJobDescription( + val writeJob = write.WriteJobDescription( queryId = info.queryId, tableSchema = schema, metadataSchema = metadataSchema, diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/CommitMessage.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala similarity index 96% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/CommitMessage.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala index 789ee1c4..75a93f0b 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/CommitMessage.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import org.apache.spark.sql.connector.write.WriterCommitMessage diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/Constants.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala similarity index 98% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/Constants.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala index 384fba2c..7facf6e7 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/Constants.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import com.clickhouse.client.config.ClickHouseClientOption._ diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/Metrics.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala similarity index 97% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/Metrics.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala index 9ec3da5e..22e61dce 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/Metrics.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import org.apache.spark.sql.connector.metric.{CustomMetric, CustomSumMetric, CustomTaskMetric} -import xenon.clickhouse.Metrics._ +import Metrics._ case class TaskMetric(override val name: String, override val value: Long) extends CustomTaskMetric diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/SQLHelper.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala similarity index 98% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/SQLHelper.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala index cd84abfd..44c1b56e 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/SQLHelper.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse +package com.clickhouse import java.sql.{Date, Timestamp} import java.time.{Instant, LocalDate, LocalDateTime, ZoneId} @@ -21,7 +21,7 @@ import org.apache.spark.sql.connector.expressions.aggregate._ import org.apache.spark.sql.connector.expressions.NamedReference import org.apache.spark.sql.sources._ import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.Utils._ +import Utils._ trait SQLHelper { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/CityHash64.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/CityHash64.scala similarity index 94% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/CityHash64.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/CityHash64.scala index d9efa705..6dd26a5c 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/CityHash64.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/CityHash64.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func -import xenon.clickhouse.hash +import com.clickhouse.hash // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L694 object CityHash64 extends MultiStringArgsHash { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/FunctionRegistry.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala similarity index 99% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/FunctionRegistry.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala index 8faf6564..d43ae2ec 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/FunctionRegistry.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func import org.apache.spark.sql.connector.catalog.functions.UnboundFunction diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MultiStringArgsHash.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MultiStringArgsHash.scala similarity index 98% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MultiStringArgsHash.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MultiStringArgsHash.scala index c99bf247..4b212561 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MultiStringArgsHash.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MultiStringArgsHash.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFunction, UnboundFunction} diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MurmurHash2.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash2.scala similarity index 84% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MurmurHash2.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash2.scala index 82332e32..39bd54dd 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MurmurHash2.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash2.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func -import xenon.clickhouse.hash -import xenon.clickhouse.hash.HashUtils +import com.clickhouse.hash.{HashUtils, Murmurhash2_32, Murmurhash2_64} +import com.clickhouse.hash // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L460 object MurmurHash2_64 extends MultiStringArgsHash { @@ -24,7 +24,7 @@ object MurmurHash2_64 extends MultiStringArgsHash { override val ckFuncNames: Array[String] = Array("murmurHash2_64") - override def applyHash(input: Array[Any]): Long = hash.Murmurhash2_64(input) + override def applyHash(input: Array[Any]): Long = Murmurhash2_64(input) } // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L519 @@ -34,5 +34,5 @@ object MurmurHash2_32 extends MultiStringArgsHash { override val ckFuncNames: Array[String] = Array("murmurHash2_32") - override def applyHash(input: Array[Any]): Long = HashUtils.toUInt32(hash.Murmurhash2_32(input)) + override def applyHash(input: Array[Any]): Long = HashUtils.toUInt32(Murmurhash2_32(input)) } diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MurmurHash3.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash3.scala similarity index 84% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MurmurHash3.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash3.scala index 3a53c952..d906379c 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/MurmurHash3.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash3.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func -import xenon.clickhouse.hash -import xenon.clickhouse.hash.HashUtils +import com.clickhouse.hash.{HashUtils, Murmurhash3_32, Murmurhash3_64} +import com.clickhouse.hash // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L543 object MurmurHash3_64 extends MultiStringArgsHash { @@ -24,7 +24,7 @@ object MurmurHash3_64 extends MultiStringArgsHash { override val ckFuncNames: Array[String] = Array("murmurHash3_64") - override def applyHash(input: Array[Any]): Long = hash.Murmurhash3_64(input) + override def applyHash(input: Array[Any]): Long = Murmurhash3_64(input) } // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L519 @@ -34,5 +34,5 @@ object MurmurHash3_32 extends MultiStringArgsHash { override val ckFuncNames: Array[String] = Array("murmurHash3_32") - override def applyHash(input: Array[Any]): Long = HashUtils.toUInt32(hash.Murmurhash3_32(input)) + override def applyHash(input: Array[Any]): Long = HashUtils.toUInt32(Murmurhash3_32(input)) } diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/XxHash64.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/XxHash64.scala similarity index 97% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/XxHash64.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/XxHash64.scala index 3c4a5b1a..6175f5d7 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/func/XxHash64.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/XxHash64.scala @@ -12,13 +12,13 @@ * limitations under the License. */ -package xenon.clickhouse.func +package com.clickhouse.func +import com.clickhouse.spec.{ClusterSpec, ShardUtils} import org.apache.spark.sql.catalyst.expressions.XxHash64Function import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFunction, UnboundFunction} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.spec.{ClusterSpec, ShardUtils} /** * ClickHouse equivalent function: diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseMetadataColumn.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala similarity index 98% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseMetadataColumn.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala index 2c5d0991..6e95401e 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseMetadataColumn.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read import org.apache.spark.sql.connector.catalog.MetadataColumn import org.apache.spark.sql.types.{DataType, DoubleType, IntegerType, LongType, StringType, StructField} diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseRead.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala similarity index 94% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseRead.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala index b8df3613..cb31f7ca 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseRead.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala @@ -12,8 +12,13 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read +import com.clickhouse.client.NodeClient +import com.clickhouse.exception.CHClientException +import com.clickhouse.read.format.{ClickHouseBinaryReader, ClickHouseJsonReader} +import com.clickhouse.spec.{DistributedEngineSpec, NoPartitionSpec, TableEngineSpec} +import com.clickhouse.{BlocksReadMetric, BytesReadMetric, ClickHouseHelper, Logging, SQLHelper, Utils} import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ import org.apache.spark.sql.connector.expressions.{Expressions, NamedReference, Transform} @@ -23,11 +28,8 @@ import org.apache.spark.sql.connector.read._ import org.apache.spark.sql.connector.read.partitioning.{Partitioning, UnknownPartitioning} import org.apache.spark.sql.sources.{AlwaysTrue, Filter} import org.apache.spark.sql.types.StructType -import xenon.clickhouse._ -import xenon.clickhouse.client.NodeClient -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.read.format.{ClickHouseBinaryReader, ClickHouseJsonReader} -import xenon.clickhouse.spec._ +import com.clickhouse._ +import com.clickhouse.spec._ import java.time.ZoneId import scala.util.control.NonFatal diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseReader.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala similarity index 90% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseReader.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala index 53f82485..6c5ec915 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ClickHouseReader.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala @@ -12,19 +12,18 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read -import com.clickhouse.client.ClickHouseResponse +import com.clickhouse.{ClickHouseHelper, Logging, TaskMetric} +import com.clickhouse.client.{ClickHouseResponse, NodeClient, NodesClient} import com.clickhouse.data.ClickHouseCompression +import com.clickhouse.format.StreamOutput import org.apache.spark.sql.catalyst.{InternalRow, SQLConfHelper} import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ import org.apache.spark.sql.connector.metric.CustomTaskMetric import org.apache.spark.sql.connector.read.PartitionReader import org.apache.spark.sql.types._ -import xenon.clickhouse.Metrics.{BLOCKS_READ, BYTES_READ} -import xenon.clickhouse.client.{NodeClient, NodesClient} -import xenon.clickhouse.format.StreamOutput -import xenon.clickhouse.{ClickHouseHelper, Logging, TaskMetric} +import com.clickhouse.Metrics.{BLOCKS_READ, BYTES_READ} abstract class ClickHouseReader[Record]( scanJob: ScanJobDescription, diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/InputPartitions.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala similarity index 93% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/InputPartitions.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala index bcfde4fb..e536e856 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/read/InputPartitions.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala @@ -12,11 +12,12 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read +import com.clickhouse.spec.{NoPartitionSpec, NodeSpec, Nodes, PartitionSpec, TableSpec} import org.apache.spark.sql.connector.read.InputPartition import org.apache.spark.sql.connector.read.partitioning.Partitioning -import xenon.clickhouse.spec._ +import com.clickhouse.spec._ case class ClickHousePartitioning(inputParts: Array[ClickHouseInputPartition]) extends Partitioning { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ScanJobDescription.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala similarity index 91% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ScanJobDescription.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala index f73f7c08..4f580481 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/ScanJobDescription.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala @@ -12,11 +12,12 @@ * limitations under the License. */ -package xenon.clickhouse.read +package com.clickhouse.read +import com.clickhouse.spec.{ClusterSpec, DistributedEngineSpec, NodeSpec, TableEngineSpec, TableSpec} import org.apache.spark.sql.clickhouse.ReadOptions import org.apache.spark.sql.types.StructType -import xenon.clickhouse.spec._ +import com.clickhouse.spec._ import java.time.ZoneId diff --git a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseBinaryReader.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala similarity index 94% rename from spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseBinaryReader.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala index 7c36cbef..4ceffc41 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseBinaryReader.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala @@ -12,17 +12,17 @@ * limitations under the License. */ -package xenon.clickhouse.read.format +package com.clickhouse.read.format import com.clickhouse.data.value.ClickHouseStringValue import com.clickhouse.data.{ClickHouseRecord, ClickHouseValue} +import com.clickhouse.exception.CHClientException +import com.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, GenericArrayData} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import java.time.ZoneOffset import java.util.concurrent.TimeUnit diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseJsonReader.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala similarity index 93% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseJsonReader.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala index 0e703857..864553c8 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/read/format/ClickHouseJsonReader.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala @@ -12,18 +12,18 @@ * limitations under the License. */ -package xenon.clickhouse.read.format +package com.clickhouse.read.format +import com.clickhouse.exception.CHClientException +import com.clickhouse.format.{JSONCompactEachRowWithNamesAndTypesStreamOutput, StreamOutput} +import com.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import com.fasterxml.jackson.databind.JsonNode import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, GenericArrayData} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import xenon.clickhouse.Utils.{dateFmt, dateTimeFmt} -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.format.{JSONCompactEachRowWithNamesAndTypesStreamOutput, StreamOutput} -import xenon.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} +import com.clickhouse.Utils.{dateFmt, dateTimeFmt} import java.math.{MathContext, RoundingMode => RM} import java.time.{LocalDate, ZoneOffset, ZonedDateTime} diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWrite.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala similarity index 90% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWrite.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala index ddb9967d..f9e70ffb 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWrite.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala @@ -12,17 +12,18 @@ * limitations under the License. */ -package xenon.clickhouse.write +package com.clickhouse.write +import com.clickhouse.{BytesWrittenMetric, RecordsWrittenMetric, SerializeTimeMetric, WriteTimeMetric} +import com.clickhouse.exception.CHClientException +import com.clickhouse.write.format.{ClickHouseArrowStreamWriter, ClickHouseJsonEachRowWriter} import org.apache.spark.sql.catalyst.{InternalRow, SQLConfHelper} import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ import org.apache.spark.sql.connector.distributions.{Distribution, Distributions} import org.apache.spark.sql.connector.expressions.SortOrder import org.apache.spark.sql.connector.metric.CustomMetric import org.apache.spark.sql.connector.write._ -import xenon.clickhouse._ -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.write.format.{ClickHouseArrowStreamWriter, ClickHouseJsonEachRowWriter} +import com.clickhouse._ class ClickHouseWriteBuilder(writeJob: WriteJobDescription) extends WriteBuilder { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWriter.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala similarity index 95% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWriter.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala index 56e1b457..1c66464f 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/ClickHouseWriter.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala @@ -12,24 +12,25 @@ * limitations under the License. */ -package xenon.clickhouse.write +package com.clickhouse.write -import com.clickhouse.client.ClickHouseProtocol +import com.clickhouse.{CommitMessage, Logging, TaskMetric, Utils} +import com.clickhouse.client.{ClickHouseProtocol, ClusterClient, NodeClient} import com.clickhouse.data.ClickHouseCompression +import com.clickhouse.exception.{CHClientException, RetryableCHException} +import com.clickhouse.spec.{DistributedEngineSpec, ShardUtils} import org.apache.commons.io.IOUtils import org.apache.spark.sql.catalyst.expressions.{BoundReference, Expression, TransformExpression} import org.apache.spark.sql.catalyst.expressions.{Projection, SafeProjection} -import org.apache.spark.sql.catalyst.{expressions, InternalRow} +import org.apache.spark.sql.catalyst.{InternalRow, expressions} import org.apache.spark.sql.clickhouse.ExprUtils import org.apache.spark.sql.connector.metric.CustomTaskMetric import org.apache.spark.sql.connector.write.{DataWriter, WriterCommitMessage} import org.apache.spark.sql.types._ -import xenon.clickhouse.Metrics._ -import xenon.clickhouse._ -import xenon.clickhouse.client.{ClusterClient, NodeClient} -import xenon.clickhouse.exception._ -import xenon.clickhouse.io.{ForwardingOutputStream, ObservableOutputStream} -import xenon.clickhouse.spec.{DistributedEngineSpec, ShardUtils} +import com.clickhouse.Metrics._ +import com.clickhouse.io.{ForwardingOutputStream, ObservableOutputStream} +import com.clickhouse._ +import com.clickhouse.exception._ import java.io.{ByteArrayInputStream, ByteArrayOutputStream, OutputStream} import java.util.concurrent.atomic.LongAdder diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/WriteJobDescription.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala similarity index 91% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/WriteJobDescription.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala index 411f08a4..66511b6e 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/WriteJobDescription.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala @@ -12,15 +12,17 @@ * limitations under the License. */ -package xenon.clickhouse.write +package com.clickhouse.write + +import com.clickhouse.expr.{Expr, FuncExpr, OrderExpr} +import com.clickhouse.func.FunctionRegistry +import com.clickhouse.spec.{ClusterSpec, DistributedEngineSpec, NodeSpec, TableEngineSpec, TableSpec} import java.time.ZoneId import org.apache.spark.sql.clickhouse.{ExprUtils, WriteOptions} import org.apache.spark.sql.connector.expressions.{Expression, SortOrder, Transform} import org.apache.spark.sql.types.StructType -import xenon.clickhouse.expr.{Expr, FuncExpr, OrderExpr} -import xenon.clickhouse.func.FunctionRegistry -import xenon.clickhouse.spec._ +import com.clickhouse.spec._ case class WriteJobDescription( queryId: String, diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseArrowStreamWriter.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala similarity index 94% rename from spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseArrowStreamWriter.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala index 158ef987..e226e6a4 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseArrowStreamWriter.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala @@ -12,8 +12,9 @@ * limitations under the License. */ -package xenon.clickhouse.write.format +package com.clickhouse.write.format +import com.clickhouse.write.{ClickHouseWriter, WriteJobDescription} import org.apache.arrow.memory.BufferAllocator import org.apache.arrow.vector.VectorSchemaRoot import org.apache.arrow.vector.ipc.ArrowStreamWriter @@ -21,7 +22,6 @@ import org.apache.arrow.vector.types.pojo.Schema import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.SparkUtils import org.apache.spark.sql.execution.arrow.ArrowWriter -import xenon.clickhouse.write.{ClickHouseWriter, WriteJobDescription} class ClickHouseArrowStreamWriter(writeJob: WriteJobDescription) extends ClickHouseWriter(writeJob) { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala similarity index 91% rename from spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala index 150ef225..e576d95c 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/xenon/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala @@ -12,12 +12,12 @@ * limitations under the License. */ -package xenon.clickhouse.write.format +package com.clickhouse.write.format +import com.clickhouse.write.{ClickHouseWriter, WriteJobDescription} import org.apache.commons.io.IOUtils import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.JsonWriter -import xenon.clickhouse.write.{ClickHouseWriter, WriteJobDescription} class ClickHouseJsonEachRowWriter(writeJob: WriteJobDescription) extends ClickHouseWriter(writeJob) { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala index a7a7f9c8..c041ee7b 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala @@ -16,7 +16,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.internal.config.ConfigEntry import org.apache.spark.sql.internal.SQLConf._ -import xenon.clickhouse.exception.ClickHouseErrCode._ +import com.clickhouse.exception.ClickHouseErrCode._ import java.util.concurrent.TimeUnit diff --git a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala index 3aaa3a69..a23861f7 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala @@ -14,6 +14,10 @@ package org.apache.spark.sql.clickhouse +import com.clickhouse.exception.CHClientException +import com.clickhouse.expr.{Expr, FieldRef, FuncExpr, OrderExpr, SQLExpr, StringLiteral} +import com.clickhouse.func.FunctionRegistry +import com.clickhouse.spec.ClusterSpec import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.catalyst.analysis.{AnsiTypeCoercion, NoSuchFunctionException, TypeCoercion} import org.apache.spark.sql.catalyst.expressions.{Attribute, BoundReference, Expression, ListQuery, Literal} @@ -21,17 +25,14 @@ import org.apache.spark.sql.catalyst.expressions.{TimeZoneAwareExpression, Trans import org.apache.spark.sql.catalyst.plans.logical.{LeafNode, LogicalPlan} import org.apache.spark.sql.catalyst.rules.{Rule, RuleExecutor} import org.apache.spark.sql.catalyst.trees.TreePattern.{LIST_SUBQUERY, TIME_ZONE_AWARE_EXPRESSION} -import org.apache.spark.sql.catalyst.{expressions, SQLConfHelper} +import org.apache.spark.sql.catalyst.{SQLConfHelper, expressions} import org.apache.spark.sql.clickhouse.ClickHouseSQLConf.IGNORE_UNSUPPORTED_TRANSFORM import org.apache.spark.sql.connector.catalog.Identifier import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFunction, UnboundFunction} import org.apache.spark.sql.connector.expressions.Expressions._ import org.apache.spark.sql.connector.expressions.{Expression => V2Expression, SortOrder => V2SortOrder, _} import org.apache.spark.sql.types.{StructField, StructType} -import xenon.clickhouse.exception.CHClientException -import xenon.clickhouse.expr._ -import xenon.clickhouse.func.FunctionRegistry -import xenon.clickhouse.spec.ClusterSpec +import com.clickhouse.expr._ import scala.util.{Failure, Success, Try} diff --git a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala index f0b564a4..055b7fa3 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala @@ -16,8 +16,8 @@ package org.apache.spark.sql.clickhouse import com.clickhouse.data.ClickHouseDataType._ import com.clickhouse.data.{ClickHouseColumn, ClickHouseDataType} +import com.clickhouse.exception.CHClientException import org.apache.spark.sql.types._ -import xenon.clickhouse.exception.CHClientException import org.apache.spark.sql.catalyst.SQLConfHelper import org.apache.spark.sql.clickhouse.ClickHouseSQLConf.READ_FIXED_STRING_AS diff --git a/spark-3.5/clickhouse-spark/src/test/resources/log4j2.xml b/spark-3.5/clickhouse-spark/src/test/resources/log4j2.xml index ecacca09..31e7b6a1 100644 --- a/spark-3.5/clickhouse-spark/src/test/resources/log4j2.xml +++ b/spark-3.5/clickhouse-spark/src/test/resources/log4j2.xml @@ -31,7 +31,7 @@ - + diff --git a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala index 1eb6a09c..2f012921 100644 --- a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala +++ b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala @@ -14,9 +14,9 @@ package org.apache.spark.sql.clickhouse +import com.clickhouse.ClickHouseHelper import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.scalatest.funsuite.AnyFunSuite -import xenon.clickhouse.ClickHouseHelper import scala.collection.JavaConverters._ diff --git a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala index 2fd17e94..20bdf128 100644 --- a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala +++ b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala @@ -14,10 +14,10 @@ package org.apache.spark.sql.clickhouse +import com.clickhouse.Utils import org.apache.spark.internal.config.ConfigEntry import org.apache.spark.sql.internal.SQLConf import org.scalatest.funsuite.AnyFunSuite -import xenon.clickhouse.Utils import java.nio.charset.StandardCharsets import java.nio.file.{Files, Path, Paths, StandardOpenOption} diff --git a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala index 0f3422fd..05d38004 100644 --- a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala +++ b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala @@ -14,8 +14,9 @@ package org.apache.spark.sql.clickhouse +import com.clickhouse.func.{ClickHouseXxHash64, ClickhouseEquivFunction, CompositeFunctionRegistry, DynamicFunctionRegistry, StaticFunctionRegistry} import org.scalatest.funsuite.AnyFunSuite -import xenon.clickhouse.func._ +import com.clickhouse.func._ class FunctionRegistrySuite extends AnyFunSuite { From d97ec99ffdf3091d9aaf5f1075c42ee3083491ec Mon Sep 17 00:00:00 2001 From: mzitnik Date: Wed, 17 Jul 2024 16:13:26 +0300 Subject: [PATCH 2/3] Apply spotless --- .../com/clickhouse/client/NodeClient.scala | 7 ++++- .../com/clickhouse/parse/AstVisitor.scala | 28 +++++++++++++++++-- .../com/clickhouse/parse/SQLParserSuite.scala | 8 +++++- .../com/clickhouse/ClickHouseCatalog.scala | 8 +++++- .../com/clickhouse/ClickHouseHelper.scala | 11 +++++++- .../com/clickhouse/ClickHouseTable.scala | 11 +++++++- .../clickhouse/write/ClickHouseWriter.scala | 2 +- .../spark/sql/clickhouse/ExprUtils.scala | 2 +- .../clickhouse/FunctionRegistrySuite.scala | 8 +++++- 9 files changed, 75 insertions(+), 10 deletions(-) diff --git a/clickhouse-core/src/main/scala/com/clickhouse/client/NodeClient.scala b/clickhouse-core/src/main/scala/com/clickhouse/client/NodeClient.scala index 460bf420..b778414c 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/client/NodeClient.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/client/NodeClient.scala @@ -19,7 +19,12 @@ import com.clickhouse.client._ import com.clickhouse.client.config.ClickHouseClientOption import com.clickhouse.data.{ClickHouseCompression, ClickHouseFormat} import com.clickhouse.exception.{CHClientException, CHException, CHServerException} -import com.clickhouse.format.{JSONCompactEachRowWithNamesAndTypesSimpleOutput, JSONEachRowSimpleOutput, NamesAndTypes, SimpleOutput} +import com.clickhouse.format.{ + JSONCompactEachRowWithNamesAndTypesSimpleOutput, + JSONEachRowSimpleOutput, + NamesAndTypes, + SimpleOutput +} import com.clickhouse.spec.NodeSpec import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.ObjectNode diff --git a/clickhouse-core/src/main/scala/com/clickhouse/parse/AstVisitor.scala b/clickhouse-core/src/main/scala/com/clickhouse/parse/AstVisitor.scala index bf1bb802..184d0b9e 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/parse/AstVisitor.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/parse/AstVisitor.scala @@ -14,9 +14,33 @@ package com.clickhouse.parse -import com.clickhouse.ClickHouseSQLParser.{ColumnExprContext, ColumnExprFunctionContext, ColumnExprIdentifierContext, ColumnExprListContext, ColumnExprLiteralContext, ColumnExprParensContext, ColumnExprPrecedence1Context, ColumnExprPrecedence2Context, ColumnExprTupleContext, ColumnsExprColumnContext, ColumnsExprContext, EngineClauseContext, OrderByClauseContext, OrderExprContext, SettingsClauseContext} +import com.clickhouse.ClickHouseSQLParser.{ + ColumnExprContext, + ColumnExprFunctionContext, + ColumnExprIdentifierContext, + ColumnExprListContext, + ColumnExprLiteralContext, + ColumnExprParensContext, + ColumnExprPrecedence1Context, + ColumnExprPrecedence2Context, + ColumnExprTupleContext, + ColumnsExprColumnContext, + ColumnsExprContext, + EngineClauseContext, + OrderByClauseContext, + OrderExprContext, + SettingsClauseContext +} import com.clickhouse.expr.{Expr, FieldRef, FuncExpr, OrderExpr, StringLiteral, TupleExpr} -import com.clickhouse.spec.{DistributedEngineSpec, MergeTreeEngineSpec, ReplacingMergeTreeEngineSpec, ReplicatedMergeTreeEngineSpec, ReplicatedReplacingMergeTreeEngineSpec, TableEngineSpec, UnknownTableEngineSpec} +import com.clickhouse.spec.{ + DistributedEngineSpec, + MergeTreeEngineSpec, + ReplacingMergeTreeEngineSpec, + ReplicatedMergeTreeEngineSpec, + ReplicatedReplacingMergeTreeEngineSpec, + TableEngineSpec, + UnknownTableEngineSpec +} import com.clickhouse.{ClickHouseSQLBaseVisitor, Logging, Utils} import scala.collection.JavaConverters._ diff --git a/clickhouse-core/src/test/scala/com/clickhouse/parse/SQLParserSuite.scala b/clickhouse-core/src/test/scala/com/clickhouse/parse/SQLParserSuite.scala index 83133b4b..f1fbff4b 100644 --- a/clickhouse-core/src/test/scala/com/clickhouse/parse/SQLParserSuite.scala +++ b/clickhouse-core/src/test/scala/com/clickhouse/parse/SQLParserSuite.scala @@ -15,7 +15,13 @@ package com.clickhouse.parse import com.clickhouse.expr.{FieldRef, FuncExpr, StringLiteral, TupleExpr} -import com.clickhouse.spec.{DistributedEngineSpec, MergeTreeEngineSpec, ReplacingMergeTreeEngineSpec, ReplicatedMergeTreeEngineSpec, ReplicatedReplacingMergeTreeEngineSpec} +import com.clickhouse.spec.{ + DistributedEngineSpec, + MergeTreeEngineSpec, + ReplacingMergeTreeEngineSpec, + ReplicatedMergeTreeEngineSpec, + ReplicatedReplacingMergeTreeEngineSpec +} import org.scalatest.funsuite.AnyFunSuite import com.clickhouse.expr._ import com.clickhouse.spec._ diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala index e4081c2d..5d7f976d 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala @@ -26,7 +26,13 @@ import org.apache.spark.sql.util.CaseInsensitiveStringMap import Constants._ import com.clickhouse import com.clickhouse.exception.ClickHouseErrCode._ -import com.clickhouse.func.{ClickHouseXxHash64Shard, CompositeFunctionRegistry, DynamicFunctionRegistry, FunctionRegistry, StaticFunctionRegistry} +import com.clickhouse.func.{ + ClickHouseXxHash64Shard, + CompositeFunctionRegistry, + DynamicFunctionRegistry, + FunctionRegistry, + StaticFunctionRegistry +} import com.clickhouse.spec.{ClusterSpec, DistributedEngineSpec, NodeSpec, TableEngineUtils} import com.clickhouse.func._ import com.clickhouse.spec._ diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala index 8541801c..11d2ccf4 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala @@ -25,7 +25,16 @@ import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap import Constants._ import Utils.dateTimeFmt -import com.clickhouse.spec.{ClusterSpec, DatabaseSpec, NoPartitionSpec, NodeSpec, PartitionSpec, ReplicaSpec, ShardSpec, TableSpec} +import com.clickhouse.spec.{ + ClusterSpec, + DatabaseSpec, + NoPartitionSpec, + NodeSpec, + PartitionSpec, + ReplicaSpec, + ShardSpec, + TableSpec +} import com.clickhouse.spec._ import java.time.{LocalDateTime, ZoneId} diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala index de9f1264..66c43ac1 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala @@ -32,7 +32,16 @@ import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.apache.spark.unsafe.types.UTF8String import Utils._ import com.clickhouse.read.{ClickHouseMetadataColumn, ClickHouseScanBuilder, ScanJobDescription} -import com.clickhouse.spec.{ClusterSpec, DistributedEngineSpec, MergeTreeFamilyEngineSpec, NodeSpec, PartitionSpec, TableEngineSpec, TableEngineUtils, TableSpec} +import com.clickhouse.spec.{ + ClusterSpec, + DistributedEngineSpec, + MergeTreeFamilyEngineSpec, + NodeSpec, + PartitionSpec, + TableEngineSpec, + TableEngineUtils, + TableSpec +} import com.clickhouse.write.{ClickHouseWriteBuilder, WriteJobDescription} import com.clickhouse.spec._ diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala index 1c66464f..883be56c 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala @@ -22,7 +22,7 @@ import com.clickhouse.spec.{DistributedEngineSpec, ShardUtils} import org.apache.commons.io.IOUtils import org.apache.spark.sql.catalyst.expressions.{BoundReference, Expression, TransformExpression} import org.apache.spark.sql.catalyst.expressions.{Projection, SafeProjection} -import org.apache.spark.sql.catalyst.{InternalRow, expressions} +import org.apache.spark.sql.catalyst.{expressions, InternalRow} import org.apache.spark.sql.clickhouse.ExprUtils import org.apache.spark.sql.connector.metric.CustomTaskMetric import org.apache.spark.sql.connector.write.{DataWriter, WriterCommitMessage} diff --git a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala index a23861f7..6140d180 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala @@ -25,7 +25,7 @@ import org.apache.spark.sql.catalyst.expressions.{TimeZoneAwareExpression, Trans import org.apache.spark.sql.catalyst.plans.logical.{LeafNode, LogicalPlan} import org.apache.spark.sql.catalyst.rules.{Rule, RuleExecutor} import org.apache.spark.sql.catalyst.trees.TreePattern.{LIST_SUBQUERY, TIME_ZONE_AWARE_EXPRESSION} -import org.apache.spark.sql.catalyst.{SQLConfHelper, expressions} +import org.apache.spark.sql.catalyst.{expressions, SQLConfHelper} import org.apache.spark.sql.clickhouse.ClickHouseSQLConf.IGNORE_UNSUPPORTED_TRANSFORM import org.apache.spark.sql.connector.catalog.Identifier import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFunction, UnboundFunction} diff --git a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala index 05d38004..8168f34c 100644 --- a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala +++ b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala @@ -14,7 +14,13 @@ package org.apache.spark.sql.clickhouse -import com.clickhouse.func.{ClickHouseXxHash64, ClickhouseEquivFunction, CompositeFunctionRegistry, DynamicFunctionRegistry, StaticFunctionRegistry} +import com.clickhouse.func.{ + ClickHouseXxHash64, + ClickhouseEquivFunction, + CompositeFunctionRegistry, + DynamicFunctionRegistry, + StaticFunctionRegistry +} import org.scalatest.funsuite.AnyFunSuite import com.clickhouse.func._ From 4a148ff9441870affe6ca3dd7affc9aaee09e227 Mon Sep 17 00:00:00 2001 From: mzitnik Date: Sun, 21 Jul 2024 13:25:27 +0300 Subject: [PATCH 3/3] Change from com.clickhouse to com.clickhouse.spark --- build.gradle | 2 +- .../src/test/resources/log4j.properties | 2 +- .../clickhouse/{ => spark}/HashSuite.scala | 10 +++++----- .../{ => spark}/UtilsClickHouseSuite.scala | 4 ++-- .../exception/ClickHouseErrCode.java | 2 +- .../hash/cityhash/CityHash_v1_0_2.java | 2 +- .../{ => spark}/hash/cityhash/UInt128.java | 2 +- .../clickhouse/{ => spark}/JsonProtocol.scala | 2 +- .../com/clickhouse/{ => spark}/Logging.scala | 2 +- .../com/clickhouse/{ => spark}/Utils.scala | 2 +- .../{ => spark}/client/ClusterClient.scala | 8 ++++---- .../{ => spark}/client/NodeClient.scala | 12 +++++------ .../{ => spark}/client/NodesClient.scala | 6 +++--- .../{ => spark}/exception/CHException.scala | 4 ++-- .../{ => spark}/expr/Expressions.scala | 2 +- .../{ => spark}/format/InputFormat.scala | 2 +- .../{ => spark}/format/JSONOutputFormat.scala | 6 +++--- .../{ => spark}/format/OutputFormat.scala | 2 +- .../{ => spark}/hash/CityHash64.scala | 4 ++-- .../{ => spark}/hash/HashFunc.scala | 2 +- .../{ => spark}/hash/HashUtils.scala | 2 +- .../{ => spark}/hash/Murmurhash2_32.scala | 2 +- .../{ => spark}/hash/Murmurhash2_64.scala | 2 +- .../{ => spark}/hash/Murmurhash3_32.scala | 2 +- .../{ => spark}/hash/Murmurhash3_64.scala | 2 +- .../io/ForwardingOutputStream.scala | 2 +- .../{ => spark}/io/ForwardingWriter.scala | 2 +- .../io/ObservableOutputStream.scala | 4 ++-- .../{ => spark}/parse/AstVisitor.scala | 16 +++++++-------- .../{ => spark}/parse/ParseUtils.scala | 2 +- .../{ => spark}/parse/SQLParser.scala | 10 +++++----- .../{ => spark}/spec/DatabaseSpec.scala | 4 ++-- .../{ => spark}/spec/NodeSpec.scala | 6 +++--- .../{ => spark}/spec/PartitionSpec.scala | 4 ++-- .../{ => spark}/spec/ShardUtils.scala | 2 +- .../{ => spark}/spec/TableEngineSpec.scala | 6 +++--- .../{ => spark}/spec/TableEngineUtils.scala | 8 ++++---- .../{ => spark}/spec/TableSpec.scala | 4 ++-- .../src/test/resources/log4j.properties | 2 +- .../clickhouse/{ => spark}/UtilsSuite.scala | 2 +- .../{ => spark}/parse/SQLParserSuite.scala | 10 +++++----- .../{ => spark}/spec/NodeSpecHelper.scala | 2 +- .../{ => spark}/spec/NodeSpecSuite.scala | 2 +- .../{ => spark}/spec/ShardUtilsSuite.scala | 2 +- .../base/ClickHouseClusterMixIn.scala | 4 ++-- .../base/ClickHouseSingleMixIn.scala | 9 +++++---- docker/conf/spark-defaults.conf | 8 ++++---- docs/best_practices/01_deployment.md | 4 ++-- .../01_catalog_configurations.md | 6 +++--- docs/quick_start/02_play_with_spark_sql.md | 2 +- docs/quick_start/03_play_with_spark_shell.md | 4 ++-- gradle.properties | 2 +- .../spark/sql/clickhouse/SparkTest.scala | 2 +- .../cluster/SparkClickHouseClusterTest.scala | 10 +++++----- .../single/SparkClickHouseSingleTest.scala | 4 ++-- .../{ => spark}/ClickHouseCatalog.scala | 14 ++++++------- .../{ => spark}/ClickHouseCommandRunner.scala | 4 ++-- .../{ => spark}/ClickHouseHelper.scala | 12 +++++------ .../{ => spark}/ClickHouseTable.scala | 14 ++++++------- .../com/clickhouse/spark}/CommitMessage.scala | 2 +- .../com/clickhouse/spark}/Constants.scala | 2 +- .../com/clickhouse/{ => spark}/Metrics.scala | 4 ++-- .../clickhouse/{ => spark}/SQLHelper.scala | 4 ++-- .../{ => spark}/func/ClickHouseXxHash64.scala | 4 ++-- .../{ => spark}/func/FunctionRegistry.scala | 2 +- .../read/ClickHouseMetadataColumn.scala | 2 +- .../spark}/read/ClickHouseRead.scala | 12 +++++------ .../{ => spark}/read/ClickHouseReader.scala | 10 +++++----- .../{ => spark}/read/InputPartitions.scala | 4 ++-- .../spark}/read/ScanJobDescription.scala | 4 ++-- .../read/format/ClickHouseBinaryReader.scala | 6 +++--- .../read/format/ClickHouseJsonReader.scala | 10 +++++----- .../{ => spark}/write/ClickHouseWrite.scala | 8 ++++---- .../{ => spark}/write/ClickHouseWriter.scala | 14 ++++++------- .../write/WriteJobDescription.scala | 6 +++--- .../format/ClickHouseArrowStreamWriter.scala | 4 ++-- .../format/ClickHouseJsonEachRowWriter.scala | 4 ++-- .../sql/clickhouse/ClickHouseSQLConf.scala | 2 +- .../spark/sql/clickhouse/ExprUtils.scala | 4 ++-- .../spark/sql/clickhouse/SchemaUtils.scala | 2 +- .../src/test/resources/log4j2.xml | 2 +- .../clickhouse/ClickHouseHelperSuite.scala | 2 +- .../src/test/resources/log4j2.xml | 2 +- .../spark/sql/clickhouse/SparkTest.scala | 2 +- .../ClickHouseClusterHashUDFSuite.scala | 2 +- .../cluster/SparkClickHouseClusterTest.scala | 10 +++++----- .../single/SparkClickHouseSingleTest.scala | 4 ++-- .../{ => spark}/ClickHouseCatalog.scala | 14 ++++++------- .../{ => spark}/ClickHouseCommandRunner.scala | 4 ++-- .../{ => spark}/ClickHouseHelper.scala | 12 +++++------ .../{ => spark}/ClickHouseTable.scala | 16 +++++++-------- .../com/clickhouse/spark}/CommitMessage.scala | 2 +- .../com/clickhouse/spark}/Constants.scala | 2 +- .../com/clickhouse/{ => spark}/Metrics.scala | 4 ++-- .../clickhouse/{ => spark}/SQLHelper.scala | 4 ++-- .../clickhouse/spark}/func/CityHash64.scala | 4 ++-- .../spark}/func/FunctionRegistry.scala | 2 +- .../func/MultiStringArgsHash.scala | 2 +- .../{ => spark}/func/MurmurHash2.scala | 6 +++--- .../{ => spark}/func/MurmurHash3.scala | 6 +++--- .../com/clickhouse/spark}/func/XxHash64.scala | 4 ++-- .../read/ClickHouseMetadataColumn.scala | 2 +- .../spark}/read/ClickHouseRead.scala | 12 +++++------ .../{ => spark}/read/ClickHouseReader.scala | 10 +++++----- .../{ => spark}/read/InputPartitions.scala | 4 ++-- .../spark}/read/ScanJobDescription.scala | 4 ++-- .../read/format/ClickHouseBinaryReader.scala | 6 +++--- .../read/format/ClickHouseJsonReader.scala | 10 +++++----- .../{ => spark}/write/ClickHouseWrite.scala | 8 ++++---- .../{ => spark}/write/ClickHouseWriter.scala | 14 ++++++------- .../write/WriteJobDescription.scala | 8 ++++---- .../format/ClickHouseArrowStreamWriter.scala | 4 ++-- .../format/ClickHouseJsonEachRowWriter.scala | 4 ++-- .../sql/clickhouse/ClickHouseSQLConf.scala | 2 +- .../spark/sql/clickhouse/ExprUtils.scala | 8 ++++---- .../spark/sql/clickhouse/SchemaUtils.scala | 2 +- .../src/test/resources/log4j2.xml | 2 +- .../clickhouse/ClickHouseHelperSuite.scala | 2 +- .../sql/clickhouse/ConfigurationSuite.scala | 2 +- .../clickhouse/FunctionRegistrySuite.scala | 2 +- .../src/test/resources/log4j2.xml | 2 +- .../spark/sql/clickhouse/SparkTest.scala | 2 +- .../ClickHouseClusterHashUDFSuite.scala | 2 +- .../cluster/SparkClickHouseClusterTest.scala | 10 +++++----- .../single/SparkClickHouseSingleTest.scala | 4 ++-- .../{ => spark}/ClickHouseCatalog.scala | 20 +++++++++---------- .../{ => spark}/ClickHouseCommandRunner.scala | 4 ++-- .../{ => spark}/ClickHouseHelper.scala | 11 +++++----- .../{ => spark}/ClickHouseTable.scala | 16 +++++++-------- .../com/clickhouse/spark}/CommitMessage.scala | 2 +- .../clickhouse/{ => spark}/Constants.scala | 2 +- .../com/clickhouse/{ => spark}/Metrics.scala | 2 +- .../clickhouse/{ => spark}/SQLHelper.scala | 2 +- .../clickhouse/spark}/func/CityHash64.scala | 4 ++-- .../spark}/func/FunctionRegistry.scala | 2 +- .../func/MultiStringArgsHash.scala | 2 +- .../{ => spark}/func/MurmurHash2.scala | 6 +++--- .../{ => spark}/func/MurmurHash3.scala | 6 +++--- .../com/clickhouse/spark}/func/XxHash64.scala | 4 ++-- .../read/ClickHouseMetadataColumn.scala | 2 +- .../{ => spark}/read/ClickHouseRead.scala | 16 +++++++-------- .../{ => spark}/read/ClickHouseReader.scala | 11 +++++----- .../{ => spark}/read/InputPartitions.scala | 6 +++--- .../{ => spark}/read/ScanJobDescription.scala | 5 ++--- .../read/format/ClickHouseBinaryReader.scala | 6 +++--- .../read/format/ClickHouseJsonReader.scala | 10 +++++----- .../{ => spark}/write/ClickHouseWrite.scala | 10 +++++----- .../{ => spark}/write/ClickHouseWriter.scala | 19 +++++++++--------- .../write/WriteJobDescription.scala | 10 +++++----- .../format/ClickHouseArrowStreamWriter.scala | 4 ++-- .../format/ClickHouseJsonEachRowWriter.scala | 4 ++-- .../sql/clickhouse/ClickHouseSQLConf.scala | 2 +- .../spark/sql/clickhouse/ExprUtils.scala | 10 +++++----- .../spark/sql/clickhouse/SchemaUtils.scala | 2 +- .../src/test/resources/log4j2.xml | 2 +- .../clickhouse/ClickHouseHelperSuite.scala | 2 +- .../sql/clickhouse/ConfigurationSuite.scala | 2 +- .../clickhouse/FunctionRegistrySuite.scala | 4 ++-- 158 files changed, 416 insertions(+), 413 deletions(-) rename clickhouse-core-it/src/test/scala/com/clickhouse/{ => spark}/HashSuite.scala (92%) rename clickhouse-core-it/src/test/scala/com/clickhouse/{ => spark}/UtilsClickHouseSuite.scala (93%) rename clickhouse-core/src/main/java/com/clickhouse/{ => spark}/exception/ClickHouseErrCode.java (99%) rename clickhouse-core/src/main/java/com/clickhouse/{ => spark}/hash/cityhash/CityHash_v1_0_2.java (99%) rename clickhouse-core/src/main/java/com/clickhouse/{ => spark}/hash/cityhash/UInt128.java (95%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/JsonProtocol.scala (97%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/Logging.scala (96%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/Utils.scala (99%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/client/ClusterClient.scala (92%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/client/NodeClient.scala (96%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/client/NodesClient.scala (91%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/exception/CHException.scala (94%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/expr/Expressions.scala (98%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/format/InputFormat.scala (94%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/format/JSONOutputFormat.scala (96%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/format/OutputFormat.scala (96%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/hash/CityHash64.scala (90%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/hash/HashFunc.scala (97%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/hash/HashUtils.scala (97%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/hash/Murmurhash2_32.scala (96%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/hash/Murmurhash2_64.scala (96%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/hash/Murmurhash3_32.scala (96%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/hash/Murmurhash3_64.scala (96%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/io/ForwardingOutputStream.scala (97%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/io/ForwardingWriter.scala (96%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/io/ObservableOutputStream.scala (97%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/parse/AstVisitor.scala (96%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/parse/ParseUtils.scala (98%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/parse/SQLParser.scala (92%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/spec/DatabaseSpec.scala (93%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/spec/NodeSpec.scala (97%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/spec/PartitionSpec.scala (91%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/spec/ShardUtils.scala (97%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/spec/TableEngineSpec.scala (97%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/spec/TableEngineUtils.scala (87%) rename clickhouse-core/src/main/scala/com/clickhouse/{ => spark}/spec/TableSpec.scala (97%) rename clickhouse-core/src/test/scala/com/clickhouse/{ => spark}/UtilsSuite.scala (98%) rename clickhouse-core/src/test/scala/com/clickhouse/{ => spark}/parse/SQLParserSuite.scala (97%) rename clickhouse-core/src/test/scala/com/clickhouse/{ => spark}/spec/NodeSpecHelper.scala (97%) rename clickhouse-core/src/test/scala/com/clickhouse/{ => spark}/spec/NodeSpecSuite.scala (96%) rename clickhouse-core/src/test/scala/com/clickhouse/{ => spark}/spec/ShardUtilsSuite.scala (97%) rename clickhouse-core/src/testFixtures/scala/com/clickhouse/{ => spark}/base/ClickHouseClusterMixIn.scala (98%) rename clickhouse-core/src/testFixtures/scala/com/clickhouse/{ => spark}/base/ClickHouseSingleMixIn.scala (94%) rename spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/ClickHouseCatalog.scala (97%) rename spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/ClickHouseCommandRunner.scala (93%) rename spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/ClickHouseHelper.scala (98%) rename spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/ClickHouseTable.scala (96%) rename {spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark}/CommitMessage.scala (96%) rename {spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark}/Constants.scala (98%) rename spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/Metrics.scala (97%) rename spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/SQLHelper.scala (98%) rename spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/func/ClickHouseXxHash64.scala (97%) rename spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/func/FunctionRegistry.scala (98%) rename {spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark}/read/ClickHouseMetadataColumn.scala (98%) rename {spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark}/read/ClickHouseRead.scala (96%) rename spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/read/ClickHouseReader.scala (91%) rename spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/read/InputPartitions.scala (96%) rename {spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark}/read/ScanJobDescription.scala (96%) rename {spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark}/read/format/ClickHouseBinaryReader.scala (94%) rename {spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark}/read/format/ClickHouseJsonReader.scala (92%) rename spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/write/ClickHouseWrite.scala (92%) rename spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/write/ClickHouseWriter.scala (96%) rename spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/write/WriteJobDescription.scala (94%) rename {spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark}/write/format/ClickHouseArrowStreamWriter.scala (94%) rename {spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark}/write/format/ClickHouseJsonEachRowWriter.scala (91%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/ClickHouseCatalog.scala (97%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/ClickHouseCommandRunner.scala (93%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/ClickHouseHelper.scala (98%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/ClickHouseTable.scala (96%) rename {spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark}/CommitMessage.scala (96%) rename {spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark}/Constants.scala (98%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/Metrics.scala (97%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/SQLHelper.scala (98%) rename {spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark}/func/CityHash64.scala (93%) rename {spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark}/func/FunctionRegistry.scala (99%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/func/MultiStringArgsHash.scala (98%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/func/MurmurHash2.scala (92%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/func/MurmurHash3.scala (92%) rename {spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark}/func/XxHash64.scala (97%) rename {spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark}/read/ClickHouseMetadataColumn.scala (98%) rename {spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark}/read/ClickHouseRead.scala (96%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/read/ClickHouseReader.scala (91%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/read/InputPartitions.scala (96%) rename {spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark}/read/ScanJobDescription.scala (96%) rename {spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark}/read/format/ClickHouseBinaryReader.scala (94%) rename {spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark}/read/format/ClickHouseJsonReader.scala (92%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/write/ClickHouseWrite.scala (92%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/write/ClickHouseWriter.scala (97%) rename spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/write/WriteJobDescription.scala (93%) rename {spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark}/write/format/ClickHouseArrowStreamWriter.scala (94%) rename {spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark}/write/format/ClickHouseJsonEachRowWriter.scala (91%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/ClickHouseCatalog.scala (96%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/ClickHouseCommandRunner.scala (93%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/ClickHouseHelper.scala (98%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/ClickHouseTable.scala (96%) rename {spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark}/CommitMessage.scala (96%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/Constants.scala (98%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/Metrics.scala (98%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/SQLHelper.scala (99%) rename {spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark}/func/CityHash64.scala (93%) rename {spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark}/func/FunctionRegistry.scala (99%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/func/MultiStringArgsHash.scala (98%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/func/MurmurHash2.scala (90%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/func/MurmurHash3.scala (90%) rename {spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark}/func/XxHash64.scala (97%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/read/ClickHouseMetadataColumn.scala (98%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/read/ClickHouseRead.scala (94%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/read/ClickHouseReader.scala (90%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/read/InputPartitions.scala (92%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/read/ScanJobDescription.scala (91%) rename {spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark}/read/format/ClickHouseBinaryReader.scala (94%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/read/format/ClickHouseJsonReader.scala (92%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/write/ClickHouseWrite.scala (89%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/write/ClickHouseWriter.scala (95%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/write/WriteJobDescription.scala (90%) rename {spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse => spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark}/write/format/ClickHouseArrowStreamWriter.scala (94%) rename spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/{ => spark}/write/format/ClickHouseJsonEachRowWriter.scala (91%) diff --git a/build.gradle b/build.gradle index e521c58d..b19e9e4b 100644 --- a/build.gradle +++ b/build.gradle @@ -164,7 +164,7 @@ project(':clickhouse-core') { generateGrammarSource { maxHeapSize = "64m" - arguments += ["-visitor", "-package", "com.clickhouse"] + arguments += ["-visitor", "-package", "com.clickhouse.spark"] } test { diff --git a/clickhouse-core-it/src/test/resources/log4j.properties b/clickhouse-core-it/src/test/resources/log4j.properties index fd3d701c..fad6cde2 100644 --- a/clickhouse-core-it/src/test/resources/log4j.properties +++ b/clickhouse-core-it/src/test/resources/log4j.properties @@ -27,4 +27,4 @@ log4j.appender.file.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss.SSS} %t %p %c{ log4j.logger.org.apache.hadoop.util.Shell=ERROR log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR -log4j.logger.com.clickhouse=DEBUG +log4j.logger.com.clickhouse.spark=DEBUG diff --git a/clickhouse-core-it/src/test/scala/com/clickhouse/HashSuite.scala b/clickhouse-core-it/src/test/scala/com/clickhouse/spark/HashSuite.scala similarity index 92% rename from clickhouse-core-it/src/test/scala/com/clickhouse/HashSuite.scala rename to clickhouse-core-it/src/test/scala/com/clickhouse/spark/HashSuite.scala index 82109016..bf06bced 100644 --- a/clickhouse-core-it/src/test/scala/com/clickhouse/HashSuite.scala +++ b/clickhouse-core-it/src/test/scala/com/clickhouse/spark/HashSuite.scala @@ -12,12 +12,12 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark -import com.clickhouse.base.ClickHouseSingleMixIn -import com.clickhouse.client.NodeClient -import com.clickhouse.hash.{CityHash64, HashUtils, Murmurhash2_32, Murmurhash2_64, Murmurhash3_32, Murmurhash3_64} -import com.clickhouse.hash._ +import com.clickhouse.spark.base.ClickHouseSingleMixIn +import com.clickhouse.spark.client.NodeClient +import com.clickhouse.spark.hash.{CityHash64, HashUtils, Murmurhash2_32, Murmurhash2_64, Murmurhash3_32, Murmurhash3_64} +import com.clickhouse.spark.hash._ class HashSuite extends ClickHouseSingleMixIn with Logging { diff --git a/clickhouse-core-it/src/test/scala/com/clickhouse/UtilsClickHouseSuite.scala b/clickhouse-core-it/src/test/scala/com/clickhouse/spark/UtilsClickHouseSuite.scala similarity index 93% rename from clickhouse-core-it/src/test/scala/com/clickhouse/UtilsClickHouseSuite.scala rename to clickhouse-core-it/src/test/scala/com/clickhouse/spark/UtilsClickHouseSuite.scala index e8000935..50a8525a 100644 --- a/clickhouse-core-it/src/test/scala/com/clickhouse/UtilsClickHouseSuite.scala +++ b/clickhouse-core-it/src/test/scala/com/clickhouse/spark/UtilsClickHouseSuite.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark -import com.clickhouse.base.ClickHouseSingleMixIn +import com.clickhouse.spark.base.ClickHouseSingleMixIn import java.time.{LocalDateTime, ZoneId} class UtilsClickHouseSuite extends ClickHouseSingleMixIn with Logging { diff --git a/clickhouse-core/src/main/java/com/clickhouse/exception/ClickHouseErrCode.java b/clickhouse-core/src/main/java/com/clickhouse/spark/exception/ClickHouseErrCode.java similarity index 99% rename from clickhouse-core/src/main/java/com/clickhouse/exception/ClickHouseErrCode.java rename to clickhouse-core/src/main/java/com/clickhouse/spark/exception/ClickHouseErrCode.java index 7d1af3e9..11ecc6f2 100644 --- a/clickhouse-core/src/main/java/com/clickhouse/exception/ClickHouseErrCode.java +++ b/clickhouse-core/src/main/java/com/clickhouse/spark/exception/ClickHouseErrCode.java @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.exception; +package com.clickhouse.spark.exception; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/clickhouse-core/src/main/java/com/clickhouse/hash/cityhash/CityHash_v1_0_2.java b/clickhouse-core/src/main/java/com/clickhouse/spark/hash/cityhash/CityHash_v1_0_2.java similarity index 99% rename from clickhouse-core/src/main/java/com/clickhouse/hash/cityhash/CityHash_v1_0_2.java rename to clickhouse-core/src/main/java/com/clickhouse/spark/hash/cityhash/CityHash_v1_0_2.java index ff68fa03..e06c54c5 100644 --- a/clickhouse-core/src/main/java/com/clickhouse/hash/cityhash/CityHash_v1_0_2.java +++ b/clickhouse-core/src/main/java/com/clickhouse/spark/hash/cityhash/CityHash_v1_0_2.java @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.hash.cityhash; +package com.clickhouse.spark.hash.cityhash; // modified from https://github.com/dpoluyanov/achord/blob/master/src/main/java/com/github/mangelion/achord/CityHash_v1_0_2.java diff --git a/clickhouse-core/src/main/java/com/clickhouse/hash/cityhash/UInt128.java b/clickhouse-core/src/main/java/com/clickhouse/spark/hash/cityhash/UInt128.java similarity index 95% rename from clickhouse-core/src/main/java/com/clickhouse/hash/cityhash/UInt128.java rename to clickhouse-core/src/main/java/com/clickhouse/spark/hash/cityhash/UInt128.java index 69ef8e35..8169f1ff 100644 --- a/clickhouse-core/src/main/java/com/clickhouse/hash/cityhash/UInt128.java +++ b/clickhouse-core/src/main/java/com/clickhouse/spark/hash/cityhash/UInt128.java @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.hash.cityhash; +package com.clickhouse.spark.hash.cityhash; /** * copied from https://github.com/dpoluyanov/achord/blob/master/src/main/java/com/github/mangelion/achord/UInt128.java diff --git a/clickhouse-core/src/main/scala/com/clickhouse/JsonProtocol.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/JsonProtocol.scala similarity index 97% rename from clickhouse-core/src/main/scala/com/clickhouse/JsonProtocol.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/JsonProtocol.scala index a7159c8d..c68cd72f 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/JsonProtocol.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/JsonProtocol.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import com.fasterxml.jackson.databind.{DeserializationFeature, ObjectMapper, SerializationFeature} import com.fasterxml.jackson.module.scala.ClassTagExtensions diff --git a/clickhouse-core/src/main/scala/com/clickhouse/Logging.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/Logging.scala similarity index 96% rename from clickhouse-core/src/main/scala/com/clickhouse/Logging.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/Logging.scala index c9675a9f..b81dbcf0 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/Logging.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/Logging.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import org.slf4j.{Logger, LoggerFactory} diff --git a/clickhouse-core/src/main/scala/com/clickhouse/Utils.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/Utils.scala similarity index 99% rename from clickhouse-core/src/main/scala/com/clickhouse/Utils.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/Utils.scala index b91fe959..3402a76e 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/Utils.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/Utils.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import org.apache.commons.lang3.time.FastDateFormat diff --git a/clickhouse-core/src/main/scala/com/clickhouse/client/ClusterClient.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/client/ClusterClient.scala similarity index 92% rename from clickhouse-core/src/main/scala/com/clickhouse/client/ClusterClient.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/client/ClusterClient.scala index 264cfb8a..be75f824 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/client/ClusterClient.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/client/ClusterClient.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package com.clickhouse.client +package com.clickhouse.spark.client -import com.clickhouse.Logging -import com.clickhouse.exception.CHClientException -import com.clickhouse.spec.ClusterSpec +import com.clickhouse.spark.Logging +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.spec.ClusterSpec import java.util.concurrent.ConcurrentHashMap import scala.collection.JavaConverters._ diff --git a/clickhouse-core/src/main/scala/com/clickhouse/client/NodeClient.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/client/NodeClient.scala similarity index 96% rename from clickhouse-core/src/main/scala/com/clickhouse/client/NodeClient.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/client/NodeClient.scala index b778414c..6f27670f 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/client/NodeClient.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/client/NodeClient.scala @@ -12,23 +12,23 @@ * limitations under the License. */ -package com.clickhouse.client +package com.clickhouse.spark.client -import com.clickhouse.Logging +import com.clickhouse.spark.Logging import com.clickhouse.client._ import com.clickhouse.client.config.ClickHouseClientOption import com.clickhouse.data.{ClickHouseCompression, ClickHouseFormat} -import com.clickhouse.exception.{CHClientException, CHException, CHServerException} -import com.clickhouse.format.{ +import com.clickhouse.spark.exception.{CHClientException, CHException, CHServerException} +import com.clickhouse.spark.format.{ JSONCompactEachRowWithNamesAndTypesSimpleOutput, JSONEachRowSimpleOutput, NamesAndTypes, SimpleOutput } -import com.clickhouse.spec.NodeSpec +import com.clickhouse.spark.spec.NodeSpec import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.ObjectNode -import com.clickhouse.format._ +import com.clickhouse.spark.format._ import java.io.InputStream import java.util.UUID diff --git a/clickhouse-core/src/main/scala/com/clickhouse/client/NodesClient.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/client/NodesClient.scala similarity index 91% rename from clickhouse-core/src/main/scala/com/clickhouse/client/NodesClient.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/client/NodesClient.scala index d39c2995..d5fa1fb5 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/client/NodesClient.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/client/NodesClient.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package com.clickhouse.client +package com.clickhouse.spark.client -import com.clickhouse.Logging -import com.clickhouse.spec.{NodeSpec, Nodes} +import com.clickhouse.spark.Logging +import com.clickhouse.spark.spec.{NodeSpec, Nodes} import java.util.concurrent.ConcurrentHashMap import scala.collection.JavaConverters._ diff --git a/clickhouse-core/src/main/scala/com/clickhouse/exception/CHException.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/exception/CHException.scala similarity index 94% rename from clickhouse-core/src/main/scala/com/clickhouse/exception/CHException.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/exception/CHException.scala index abd11214..40016388 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/exception/CHException.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/exception/CHException.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse.exception +package com.clickhouse.spark.exception -import com.clickhouse.spec.NodeSpec +import com.clickhouse.spark.spec.NodeSpec abstract class CHException( val code: Int, diff --git a/clickhouse-core/src/main/scala/com/clickhouse/expr/Expressions.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/expr/Expressions.scala similarity index 98% rename from clickhouse-core/src/main/scala/com/clickhouse/expr/Expressions.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/expr/Expressions.scala index d4fe0bb0..915882de 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/expr/Expressions.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/expr/Expressions.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.expr +package com.clickhouse.spark.expr trait Expr extends Serializable { def sql: String // ClickHouse dialect diff --git a/clickhouse-core/src/main/scala/com/clickhouse/format/InputFormat.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/format/InputFormat.scala similarity index 94% rename from clickhouse-core/src/main/scala/com/clickhouse/format/InputFormat.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/format/InputFormat.scala index ee6d4720..fb68a06a 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/format/InputFormat.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/format/InputFormat.scala @@ -12,6 +12,6 @@ * limitations under the License. */ -package com.clickhouse.format +package com.clickhouse.spark.format trait InputFormat diff --git a/clickhouse-core/src/main/scala/com/clickhouse/format/JSONOutputFormat.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/format/JSONOutputFormat.scala similarity index 96% rename from clickhouse-core/src/main/scala/com/clickhouse/format/JSONOutputFormat.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/format/JSONOutputFormat.scala index f89b0e7d..26b79425 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/format/JSONOutputFormat.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/format/JSONOutputFormat.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse.format +package com.clickhouse.spark.format -import com.clickhouse.exception.CHClientException +import com.clickhouse.spark.exception.CHClientException import java.io.InputStream import scala.collection.immutable.ListMap @@ -22,7 +22,7 @@ import scala.collection.JavaConverters._ import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.ObjectNode -import com.clickhouse.JsonProtocol.om +import com.clickhouse.spark.JsonProtocol.om /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////// Simple //////////////////////////////////// diff --git a/clickhouse-core/src/main/scala/com/clickhouse/format/OutputFormat.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/format/OutputFormat.scala similarity index 96% rename from clickhouse-core/src/main/scala/com/clickhouse/format/OutputFormat.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/format/OutputFormat.scala index a232406c..c090c29d 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/format/OutputFormat.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/format/OutputFormat.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.format +package com.clickhouse.spark.format import scala.collection.immutable.ListMap diff --git a/clickhouse-core/src/main/scala/com/clickhouse/hash/CityHash64.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/CityHash64.scala similarity index 90% rename from clickhouse-core/src/main/scala/com/clickhouse/hash/CityHash64.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/hash/CityHash64.scala index a4b3a0bf..0d52dad8 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/hash/CityHash64.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/CityHash64.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse.hash +package com.clickhouse.spark.hash -import com.clickhouse.hash.cityhash.{CityHash_v1_0_2, UInt128} +import com.clickhouse.spark.hash.cityhash.{CityHash_v1_0_2, UInt128} // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L694 object CityHash64 extends HashFunc[Long] { diff --git a/clickhouse-core/src/main/scala/com/clickhouse/hash/HashFunc.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/HashFunc.scala similarity index 97% rename from clickhouse-core/src/main/scala/com/clickhouse/hash/HashFunc.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/hash/HashFunc.scala index 643c240c..47bc2afd 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/hash/HashFunc.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/HashFunc.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.hash +package com.clickhouse.spark.hash import java.nio.charset.StandardCharsets import scala.reflect.ClassTag diff --git a/clickhouse-core/src/main/scala/com/clickhouse/hash/HashUtils.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/HashUtils.scala similarity index 97% rename from clickhouse-core/src/main/scala/com/clickhouse/hash/HashUtils.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/hash/HashUtils.scala index bb97be18..4000d7af 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/hash/HashUtils.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/HashUtils.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.hash +package com.clickhouse.spark.hash object HashUtils { def intHash64Impl(x: Long): Long = diff --git a/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash2_32.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/Murmurhash2_32.scala similarity index 96% rename from clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash2_32.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/hash/Murmurhash2_32.scala index 7d69f65b..23101ce0 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash2_32.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/Murmurhash2_32.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.hash +package com.clickhouse.spark.hash import org.apache.commons.codec.digest.MurmurHash2 diff --git a/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash2_64.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/Murmurhash2_64.scala similarity index 96% rename from clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash2_64.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/hash/Murmurhash2_64.scala index cb848688..288f91ef 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash2_64.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/Murmurhash2_64.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.hash +package com.clickhouse.spark.hash import org.apache.commons.codec.digest.MurmurHash2 diff --git a/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash3_32.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/Murmurhash3_32.scala similarity index 96% rename from clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash3_32.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/hash/Murmurhash3_32.scala index 14d273d9..d8aee761 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash3_32.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/Murmurhash3_32.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.hash +package com.clickhouse.spark.hash import org.apache.commons.codec.digest.MurmurHash3 diff --git a/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash3_64.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/Murmurhash3_64.scala similarity index 96% rename from clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash3_64.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/hash/Murmurhash3_64.scala index 475d8e73..908cff09 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/hash/Murmurhash3_64.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/hash/Murmurhash3_64.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.hash +package com.clickhouse.spark.hash import org.apache.commons.codec.digest.MurmurHash3 diff --git a/clickhouse-core/src/main/scala/com/clickhouse/io/ForwardingOutputStream.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/io/ForwardingOutputStream.scala similarity index 97% rename from clickhouse-core/src/main/scala/com/clickhouse/io/ForwardingOutputStream.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/io/ForwardingOutputStream.scala index 7602cc7f..7adc284d 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/io/ForwardingOutputStream.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/io/ForwardingOutputStream.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.io +package com.clickhouse.spark.io import java.io.OutputStream diff --git a/clickhouse-core/src/main/scala/com/clickhouse/io/ForwardingWriter.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/io/ForwardingWriter.scala similarity index 96% rename from clickhouse-core/src/main/scala/com/clickhouse/io/ForwardingWriter.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/io/ForwardingWriter.scala index 7ef59174..3cf47862 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/io/ForwardingWriter.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/io/ForwardingWriter.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.io +package com.clickhouse.spark.io import java.io.Writer diff --git a/clickhouse-core/src/main/scala/com/clickhouse/io/ObservableOutputStream.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/io/ObservableOutputStream.scala similarity index 97% rename from clickhouse-core/src/main/scala/com/clickhouse/io/ObservableOutputStream.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/io/ObservableOutputStream.scala index cb3a7b6d..8d34891e 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/io/ObservableOutputStream.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/io/ObservableOutputStream.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse.io +package com.clickhouse.spark.io -import com.clickhouse.Utils +import com.clickhouse.spark.Utils import java.io.OutputStream import java.util.concurrent.atomic.LongAdder diff --git a/clickhouse-core/src/main/scala/com/clickhouse/parse/AstVisitor.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/parse/AstVisitor.scala similarity index 96% rename from clickhouse-core/src/main/scala/com/clickhouse/parse/AstVisitor.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/parse/AstVisitor.scala index 184d0b9e..f4f4f8fc 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/parse/AstVisitor.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/parse/AstVisitor.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse.parse +package com.clickhouse.spark.parse -import com.clickhouse.ClickHouseSQLParser.{ +import com.clickhouse.spark.ClickHouseSQLParser.{ ColumnExprContext, ColumnExprFunctionContext, ColumnExprIdentifierContext, @@ -31,8 +31,8 @@ import com.clickhouse.ClickHouseSQLParser.{ OrderExprContext, SettingsClauseContext } -import com.clickhouse.expr.{Expr, FieldRef, FuncExpr, OrderExpr, StringLiteral, TupleExpr} -import com.clickhouse.spec.{ +import com.clickhouse.spark.expr.{Expr, FieldRef, FuncExpr, OrderExpr, StringLiteral, TupleExpr} +import com.clickhouse.spark.spec.{ DistributedEngineSpec, MergeTreeEngineSpec, ReplacingMergeTreeEngineSpec, @@ -41,13 +41,13 @@ import com.clickhouse.spec.{ TableEngineSpec, UnknownTableEngineSpec } -import com.clickhouse.{ClickHouseSQLBaseVisitor, Logging, Utils} +import com.clickhouse.spark.{ClickHouseSQLBaseVisitor, Logging, Utils} import scala.collection.JavaConverters._ import org.antlr.v4.runtime.tree.ParseTree -import com.clickhouse.expr._ -import com.clickhouse.spec._ -import com.clickhouse.ClickHouseSQLParser._ +import com.clickhouse.spark.expr._ +import com.clickhouse.spark.spec._ +import com.clickhouse.spark.ClickHouseSQLParser._ class AstVisitor extends ClickHouseSQLBaseVisitor[AnyRef] with Logging { import ParseUtils._ diff --git a/clickhouse-core/src/main/scala/com/clickhouse/parse/ParseUtils.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/parse/ParseUtils.scala similarity index 98% rename from clickhouse-core/src/main/scala/com/clickhouse/parse/ParseUtils.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/parse/ParseUtils.scala index 0c00e5ef..8fc08177 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/parse/ParseUtils.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/parse/ParseUtils.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.parse +package com.clickhouse.spark.parse import java.util import org.antlr.v4.runtime.{ParserRuleContext, Token} diff --git a/clickhouse-core/src/main/scala/com/clickhouse/parse/SQLParser.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/parse/SQLParser.scala similarity index 92% rename from clickhouse-core/src/main/scala/com/clickhouse/parse/SQLParser.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/parse/SQLParser.scala index 08bedd76..faa6b93e 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/parse/SQLParser.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/parse/SQLParser.scala @@ -12,15 +12,15 @@ * limitations under the License. */ -package com.clickhouse.parse +package com.clickhouse.spark.parse -import com.clickhouse.{ClickHouseSQLLexer, ClickHouseSQLParser, Logging} -import com.clickhouse.expr.Expr -import com.clickhouse.spec.TableEngineSpec +import com.clickhouse.spark.{ClickHouseSQLLexer, ClickHouseSQLParser, Logging} +import com.clickhouse.spark.expr.Expr +import com.clickhouse.spark.spec.TableEngineSpec import org.antlr.v4.runtime._ import org.antlr.v4.runtime.atn.PredictionMode import org.antlr.v4.runtime.misc.ParseCancellationException -import com.clickhouse._ +import com.clickhouse.spark._ class SQLParser(astVisitor: AstVisitor) extends Logging { diff --git a/clickhouse-core/src/main/scala/com/clickhouse/spec/DatabaseSpec.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/DatabaseSpec.scala similarity index 93% rename from clickhouse-core/src/main/scala/com/clickhouse/spec/DatabaseSpec.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/spec/DatabaseSpec.scala index 62437da1..1e093726 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/spec/DatabaseSpec.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/DatabaseSpec.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse.spec +package com.clickhouse.spark.spec -import com.clickhouse.ToJson +import com.clickhouse.spark.ToJson import java.util import scala.collection.JavaConverters._ diff --git a/clickhouse-core/src/main/scala/com/clickhouse/spec/NodeSpec.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/NodeSpec.scala similarity index 97% rename from clickhouse-core/src/main/scala/com/clickhouse/spec/NodeSpec.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/spec/NodeSpec.scala index 87c53f30..e3e7b891 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/spec/NodeSpec.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/NodeSpec.scala @@ -12,13 +12,13 @@ * limitations under the License. */ -package com.clickhouse.spec +package com.clickhouse.spark.spec -import com.clickhouse.ToJson +import com.clickhouse.spark.ToJson import com.clickhouse.client.ClickHouseProtocol import com.clickhouse.client.ClickHouseProtocol._ import com.fasterxml.jackson.annotation.{JsonIgnore, JsonProperty} -import com.clickhouse.Utils._ +import com.clickhouse.spark.Utils._ import java.util import java.util.Collections diff --git a/clickhouse-core/src/main/scala/com/clickhouse/spec/PartitionSpec.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/PartitionSpec.scala similarity index 91% rename from clickhouse-core/src/main/scala/com/clickhouse/spec/PartitionSpec.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/spec/PartitionSpec.scala index 16b88487..9a46cd1d 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/spec/PartitionSpec.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/PartitionSpec.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse.spec +package com.clickhouse.spark.spec -import com.clickhouse.ToJson +import com.clickhouse.spark.ToJson case class PartitionSpec( partition_value: String, diff --git a/clickhouse-core/src/main/scala/com/clickhouse/spec/ShardUtils.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/ShardUtils.scala similarity index 97% rename from clickhouse-core/src/main/scala/com/clickhouse/spec/ShardUtils.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/spec/ShardUtils.scala index ed4ace61..05b5ab13 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/spec/ShardUtils.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/ShardUtils.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.spec +package com.clickhouse.spark.spec import java.lang.{Long => JLong} diff --git a/clickhouse-core/src/main/scala/com/clickhouse/spec/TableEngineSpec.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/TableEngineSpec.scala similarity index 97% rename from clickhouse-core/src/main/scala/com/clickhouse/spec/TableEngineSpec.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/spec/TableEngineSpec.scala index 1a44a7d2..13534d76 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/spec/TableEngineSpec.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/TableEngineSpec.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package com.clickhouse.spec +package com.clickhouse.spark.spec -import com.clickhouse.expr.{Expr, FieldRef, OrderExpr, TupleExpr} -import com.clickhouse.expr._ +import com.clickhouse.spark.expr.{Expr, FieldRef, OrderExpr, TupleExpr} +import com.clickhouse.spark.expr._ sealed trait TableEngineSpec extends Serializable { def engine_clause: String diff --git a/clickhouse-core/src/main/scala/com/clickhouse/spec/TableEngineUtils.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/TableEngineUtils.scala similarity index 87% rename from clickhouse-core/src/main/scala/com/clickhouse/spec/TableEngineUtils.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/spec/TableEngineUtils.scala index c206d4ad..d609b08b 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/spec/TableEngineUtils.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/TableEngineUtils.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package com.clickhouse.spec +package com.clickhouse.spark.spec -import com.clickhouse.Logging -import com.clickhouse.exception.CHClientException -import com.clickhouse.parse.{ParseException, ParseUtils} +import com.clickhouse.spark.Logging +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.parse.{ParseException, ParseUtils} object TableEngineUtils extends Logging { diff --git a/clickhouse-core/src/main/scala/com/clickhouse/spec/TableSpec.scala b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/TableSpec.scala similarity index 97% rename from clickhouse-core/src/main/scala/com/clickhouse/spec/TableSpec.scala rename to clickhouse-core/src/main/scala/com/clickhouse/spark/spec/TableSpec.scala index 1f5daae5..b3eb10b0 100644 --- a/clickhouse-core/src/main/scala/com/clickhouse/spec/TableSpec.scala +++ b/clickhouse-core/src/main/scala/com/clickhouse/spark/spec/TableSpec.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse.spec +package com.clickhouse.spark.spec -import com.clickhouse.ToJson +import com.clickhouse.spark.ToJson import java.time.LocalDateTime import java.util diff --git a/clickhouse-core/src/test/resources/log4j.properties b/clickhouse-core/src/test/resources/log4j.properties index fd3d701c..fad6cde2 100644 --- a/clickhouse-core/src/test/resources/log4j.properties +++ b/clickhouse-core/src/test/resources/log4j.properties @@ -27,4 +27,4 @@ log4j.appender.file.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss.SSS} %t %p %c{ log4j.logger.org.apache.hadoop.util.Shell=ERROR log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR -log4j.logger.com.clickhouse=DEBUG +log4j.logger.com.clickhouse.spark=DEBUG diff --git a/clickhouse-core/src/test/scala/com/clickhouse/UtilsSuite.scala b/clickhouse-core/src/test/scala/com/clickhouse/spark/UtilsSuite.scala similarity index 98% rename from clickhouse-core/src/test/scala/com/clickhouse/UtilsSuite.scala rename to clickhouse-core/src/test/scala/com/clickhouse/spark/UtilsSuite.scala index 8a677234..cdc983dd 100644 --- a/clickhouse-core/src/test/scala/com/clickhouse/UtilsSuite.scala +++ b/clickhouse-core/src/test/scala/com/clickhouse/spark/UtilsSuite.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import org.scalatest.funsuite.AnyFunSuite import Utils._ diff --git a/clickhouse-core/src/test/scala/com/clickhouse/parse/SQLParserSuite.scala b/clickhouse-core/src/test/scala/com/clickhouse/spark/parse/SQLParserSuite.scala similarity index 97% rename from clickhouse-core/src/test/scala/com/clickhouse/parse/SQLParserSuite.scala rename to clickhouse-core/src/test/scala/com/clickhouse/spark/parse/SQLParserSuite.scala index f1fbff4b..181e7f88 100644 --- a/clickhouse-core/src/test/scala/com/clickhouse/parse/SQLParserSuite.scala +++ b/clickhouse-core/src/test/scala/com/clickhouse/spark/parse/SQLParserSuite.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package com.clickhouse.parse +package com.clickhouse.spark.parse -import com.clickhouse.expr.{FieldRef, FuncExpr, StringLiteral, TupleExpr} -import com.clickhouse.spec.{ +import com.clickhouse.spark.expr.{FieldRef, FuncExpr, StringLiteral, TupleExpr} +import com.clickhouse.spark.spec.{ DistributedEngineSpec, MergeTreeEngineSpec, ReplacingMergeTreeEngineSpec, @@ -23,8 +23,8 @@ import com.clickhouse.spec.{ ReplicatedReplacingMergeTreeEngineSpec } import org.scalatest.funsuite.AnyFunSuite -import com.clickhouse.expr._ -import com.clickhouse.spec._ +import com.clickhouse.spark.expr._ +import com.clickhouse.spark.spec._ class SQLParserSuite extends AnyFunSuite { diff --git a/clickhouse-core/src/test/scala/com/clickhouse/spec/NodeSpecHelper.scala b/clickhouse-core/src/test/scala/com/clickhouse/spark/spec/NodeSpecHelper.scala similarity index 97% rename from clickhouse-core/src/test/scala/com/clickhouse/spec/NodeSpecHelper.scala rename to clickhouse-core/src/test/scala/com/clickhouse/spark/spec/NodeSpecHelper.scala index 3ac357db..302cbcea 100644 --- a/clickhouse-core/src/test/scala/com/clickhouse/spec/NodeSpecHelper.scala +++ b/clickhouse-core/src/test/scala/com/clickhouse/spark/spec/NodeSpecHelper.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.spec +package com.clickhouse.spark.spec trait NodeSpecHelper { diff --git a/clickhouse-core/src/test/scala/com/clickhouse/spec/NodeSpecSuite.scala b/clickhouse-core/src/test/scala/com/clickhouse/spark/spec/NodeSpecSuite.scala similarity index 96% rename from clickhouse-core/src/test/scala/com/clickhouse/spec/NodeSpecSuite.scala rename to clickhouse-core/src/test/scala/com/clickhouse/spark/spec/NodeSpecSuite.scala index 14c94631..d16e3077 100644 --- a/clickhouse-core/src/test/scala/com/clickhouse/spec/NodeSpecSuite.scala +++ b/clickhouse-core/src/test/scala/com/clickhouse/spark/spec/NodeSpecSuite.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.spec +package com.clickhouse.spark.spec import org.scalatest.funsuite.AnyFunSuite diff --git a/clickhouse-core/src/test/scala/com/clickhouse/spec/ShardUtilsSuite.scala b/clickhouse-core/src/test/scala/com/clickhouse/spark/spec/ShardUtilsSuite.scala similarity index 97% rename from clickhouse-core/src/test/scala/com/clickhouse/spec/ShardUtilsSuite.scala rename to clickhouse-core/src/test/scala/com/clickhouse/spark/spec/ShardUtilsSuite.scala index cf511b7b..8c55b6e4 100644 --- a/clickhouse-core/src/test/scala/com/clickhouse/spec/ShardUtilsSuite.scala +++ b/clickhouse-core/src/test/scala/com/clickhouse/spark/spec/ShardUtilsSuite.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.spec +package com.clickhouse.spark.spec import org.scalatest.funsuite.AnyFunSuite diff --git a/clickhouse-core/src/testFixtures/scala/com/clickhouse/base/ClickHouseClusterMixIn.scala b/clickhouse-core/src/testFixtures/scala/com/clickhouse/spark/base/ClickHouseClusterMixIn.scala similarity index 98% rename from clickhouse-core/src/testFixtures/scala/com/clickhouse/base/ClickHouseClusterMixIn.scala rename to clickhouse-core/src/testFixtures/scala/com/clickhouse/spark/base/ClickHouseClusterMixIn.scala index 865df638..22641a67 100644 --- a/clickhouse-core/src/testFixtures/scala/com/clickhouse/base/ClickHouseClusterMixIn.scala +++ b/clickhouse-core/src/testFixtures/scala/com/clickhouse/spark/base/ClickHouseClusterMixIn.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse.base +package com.clickhouse.spark.base -import com.clickhouse.Utils +import com.clickhouse.spark.Utils import com.clickhouse.data.ClickHouseVersion import com.dimafeng.testcontainers.{DockerComposeContainer, ExposedService, ForAllTestContainer} import org.scalatest.funsuite.AnyFunSuite diff --git a/clickhouse-core/src/testFixtures/scala/com/clickhouse/base/ClickHouseSingleMixIn.scala b/clickhouse-core/src/testFixtures/scala/com/clickhouse/spark/base/ClickHouseSingleMixIn.scala similarity index 94% rename from clickhouse-core/src/testFixtures/scala/com/clickhouse/base/ClickHouseSingleMixIn.scala rename to clickhouse-core/src/testFixtures/scala/com/clickhouse/spark/base/ClickHouseSingleMixIn.scala index 6a06ea2c..d8325895 100644 --- a/clickhouse-core/src/testFixtures/scala/com/clickhouse/base/ClickHouseSingleMixIn.scala +++ b/clickhouse-core/src/testFixtures/scala/com/clickhouse/spark/base/ClickHouseSingleMixIn.scala @@ -12,13 +12,14 @@ * limitations under the License. */ -package com.clickhouse.base +package com.clickhouse.spark.base -import com.clickhouse.Utils -import com.clickhouse.client.{ClickHouseProtocol, NodeClient} +import com.clickhouse.spark.Utils +import com.clickhouse.client.ClickHouseProtocol import com.clickhouse.client.ClickHouseProtocol._ import com.clickhouse.data.ClickHouseVersion -import com.clickhouse.spec.NodeSpec +import com.clickhouse.spark.client.NodeClient +import com.clickhouse.spark.spec.NodeSpec import com.dimafeng.testcontainers.{ForAllTestContainer, JdbcDatabaseContainer, SingleContainer} import org.scalatest.funsuite.AnyFunSuite import org.testcontainers.containers.ClickHouseContainer diff --git a/docker/conf/spark-defaults.conf b/docker/conf/spark-defaults.conf index 25ccdc8d..e8eb6697 100644 --- a/docker/conf/spark-defaults.conf +++ b/docker/conf/spark-defaults.conf @@ -43,7 +43,7 @@ spark.sql.catalog.iceberg=org.apache.iceberg.spark.SparkCatalog spark.sql.catalog.iceberg.type=hadoop spark.sql.catalog.iceberg.warehouse=s3a://iceberg-bucket/iceberg-warehouse -spark.sql.catalog.clickhouse_s1r1=com.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse_s1r1=com.clickhouse.spark.ClickHouseCatalog spark.sql.catalog.clickhouse_s1r1.host=clickhouse-s1r1 spark.sql.catalog.clickhouse_s1r1.protocol=http spark.sql.catalog.clickhouse_s1r1.http_port=8123 @@ -52,7 +52,7 @@ spark.sql.catalog.clickhouse_s1r1.password= spark.sql.catalog.clickhouse_s1r1.database=default spark.sql.catalog.clickhouse_s1r1.option.custom_http_params=async_insert=1,wait_for_async_insert=1 -spark.sql.catalog.clickhouse_s1r2=com.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse_s1r2=com.clickhouse.spark.ClickHouseCatalog spark.sql.catalog.clickhouse_s1r2.host=clickhouse-s1r2 spark.sql.catalog.clickhouse_s1r2.protocol=http spark.sql.catalog.clickhouse_s1r2.http_port=8123 @@ -61,7 +61,7 @@ spark.sql.catalog.clickhouse_s1r2.password= spark.sql.catalog.clickhouse_s1r2.database=default spark.sql.catalog.clickhouse_s1r2.option.custom_http_params=async_insert=1,wait_for_async_insert=1 -spark.sql.catalog.clickhouse_s2r1=com.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse_s2r1=com.clickhouse.spark.ClickHouseCatalog spark.sql.catalog.clickhouse_s2r1.host=clickhouse-s2r1 spark.sql.catalog.clickhouse_s2r1.protocol=http spark.sql.catalog.clickhouse_s2r1.http_port=8123 @@ -70,7 +70,7 @@ spark.sql.catalog.clickhouse_s2r1.password= spark.sql.catalog.clickhouse_s2r1.database=default spark.sql.catalog.clickhouse_s2r1.option.custom_http_params=async_insert=1,wait_for_async_insert=1 -spark.sql.catalog.clickhouse_s2r2=com.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse_s2r2=com.clickhouse.spark.ClickHouseCatalog spark.sql.catalog.clickhouse_s2r2.host=clickhouse-s2r2 spark.sql.catalog.clickhouse_s2r2.protocol=http spark.sql.catalog.clickhouse_s2r2.http_port=8123 diff --git a/docs/best_practices/01_deployment.md b/docs/best_practices/01_deployment.md index cabf213e..b02dae25 100644 --- a/docs/best_practices/01_deployment.md +++ b/docs/best_practices/01_deployment.md @@ -29,7 +29,7 @@ Persist catalog configurations into `$SPARK_HOME/conf/spark-defaults.conf`, then `spark-shell` or `spark-sql`. ``` -spark.sql.catalog.ck_01=com.clickhouse.ClickHouseCatalog +spark.sql.catalog.ck_01=com.clickhouse.spark.ClickHouseCatalog spark.sql.catalog.ck_01.host=10.0.0.1 spark.sql.catalog.ck_01.protocol=http spark.sql.catalog.ck_01.http_port=8123 @@ -37,7 +37,7 @@ spark.sql.catalog.ck_01.user=app spark.sql.catalog.ck_01.password=pwd spark.sql.catalog.ck_01.database=default -spark.sql.catalog.ck_02=com.clickhouse.ClickHouseCatalog +spark.sql.catalog.ck_02=com.clickhouse.spark.ClickHouseCatalog spark.sql.catalog.ck_02.host=10.0.0.2 spark.sql.catalog.ck_02.protocol=http spark.sql.catalog.ck_02.http_port=8123 diff --git a/docs/configurations/01_catalog_configurations.md b/docs/configurations/01_catalog_configurations.md index a8899cee..f061e1f7 100644 --- a/docs/configurations/01_catalog_configurations.md +++ b/docs/configurations/01_catalog_configurations.md @@ -24,7 +24,7 @@ Edit `$SPARK_HOME/conf/spark-defaults.conf`. #################################################################################### ## register a catalog named "clickhouse" #################################################################################### -spark.sql.catalog.clickhouse com.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse com.clickhouse.spark.ClickHouseCatalog #################################################################################### ## basic configurations for "clickhouse" catalog @@ -57,7 +57,7 @@ named clickhouse1, and another installed on `10.0.0.2` and exposes HTTPS endpoin Edit `$SPARK_HOME/conf/spark-defaults.conf`. ``` -spark.sql.catalog.clickhouse1 com.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse1 com.clickhouse.spark.ClickHouseCatalog spark.sql.catalog.clickhouse1.host 10.0.0.1 spark.sql.catalog.clickhouse1.protocol https spark.sql.catalog.clickhouse1.http_port 8443 @@ -66,7 +66,7 @@ spark.sql.catalog.clickhouse1.password spark.sql.catalog.clickhouse1.database default spark.sql.catalog.clickhouse1.option.ssl true -spark.sql.catalog.clickhouse2 com.clickhouse.ClickHouseCatalog +spark.sql.catalog.clickhouse2 com.clickhouse.spark.ClickHouseCatalog spark.sql.catalog.clickhouse2.host 10.0.0.2 spark.sql.catalog.clickhouse2.protocol https spark.sql.catalog.clickhouse2.http_port 8443 diff --git a/docs/quick_start/02_play_with_spark_sql.md b/docs/quick_start/02_play_with_spark_sql.md index a56bd2cc..7805591a 100644 --- a/docs/quick_start/02_play_with_spark_sql.md +++ b/docs/quick_start/02_play_with_spark_sql.md @@ -23,7 +23,7 @@ for Production. ```shell $SPARK_HOME/bin/spark-sql \ - --conf spark.sql.catalog.clickhouse=com.clickhouse.ClickHouseCatalog \ + --conf spark.sql.catalog.clickhouse=com.clickhouse.spark.ClickHouseCatalog \ --conf spark.sql.catalog.clickhouse.host=${CLICKHOUSE_HOST:-127.0.0.1} \ --conf spark.sql.catalog.clickhouse.protocol=http \ --conf spark.sql.catalog.clickhouse.http_port=${CLICKHOUSE_HTTP_PORT:-8123} \ diff --git a/docs/quick_start/03_play_with_spark_shell.md b/docs/quick_start/03_play_with_spark_shell.md index 604c2573..dcd6b1c2 100644 --- a/docs/quick_start/03_play_with_spark_shell.md +++ b/docs/quick_start/03_play_with_spark_shell.md @@ -20,7 +20,7 @@ Play with Spark Shell ```shell $SPARK_HOME/bin/spark-shell \ - --conf spark.sql.catalog.clickhouse=com.clickhouse.ClickHouseCatalog \ + --conf spark.sql.catalog.clickhouse=com.clickhouse.spark.ClickHouseCatalog \ --conf spark.sql.catalog.clickhouse.host=${CLICKHOUSE_HOST:-127.0.0.1} \ --conf spark.sql.catalog.clickhouse.protocol=http \ --conf spark.sql.catalog.clickhouse.http_port=${CLICKHOUSE_HTTP_PORT:-8123} \ @@ -130,7 +130,7 @@ scala> val sql = """ | |ORDER BY id | """.stripMargin -scala> spark.executeCommand("com.clickhouse.ClickHouseCommandRunner", sql, options) +scala> spark.executeCommand("com.clickhouse.spark.ClickHouseCommandRunner", sql, options) scala> spark.sql("show tables in clickhouse_s1r1.test_db").show +---------+---------+-----------+ diff --git a/gradle.properties b/gradle.properties index c5b37a3b..be683b1a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,7 @@ systemProp.known_scala_binary_versions=2.12,2.13 systemProp.spark_binary_version=3.5 systemProp.known_spark_binary_versions=3.3,3.4,3.5 -group=com.clickhouse +group=com.clickhouse.spark clickhouse_jdbc_version=0.6.2 diff --git a/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala b/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala index 709bce71..dc914722 100644 --- a/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala +++ b/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.SparkConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.{DataFrame, QueryTest} -import com.clickhouse.ClickHouseCommandRunner +import com.clickhouse.spark.ClickHouseCommandRunner import java.sql.{Date, Timestamp} import java.time.Instant diff --git a/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala b/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala index 9655da33..a75ef7c1 100644 --- a/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala +++ b/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse.cluster import org.apache.spark.SparkConf import org.apache.spark.sql.clickhouse.SparkTest import org.apache.spark.sql.functions.{month, year} -import com.clickhouse.base.ClickHouseClusterMixIn +import com.clickhouse.spark.base.ClickHouseClusterMixIn trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { @@ -29,7 +29,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.shuffle.partitions", "4") // catalog .set("spark.sql.defaultCatalog", "clickhouse_s1r1") - .set("spark.sql.catalog.clickhouse_s1r1", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s1r1", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s1r1.host", clickhouse_s1r1_host) .set("spark.sql.catalog.clickhouse_s1r1.http_port", clickhouse_s1r1_http_port.toString) .set("spark.sql.catalog.clickhouse_s1r1.protocol", "http") @@ -37,7 +37,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s1r1.password", "") .set("spark.sql.catalog.clickhouse_s1r1.database", "default") .set("spark.sql.catalog.clickhouse_s1r1.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s1r2", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s1r2", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s1r2.host", clickhouse_s1r2_host) .set("spark.sql.catalog.clickhouse_s1r2.http_port", clickhouse_s1r2_http_port.toString) .set("spark.sql.catalog.clickhouse_s1r2.protocol", "http") @@ -45,7 +45,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s1r2.password", "") .set("spark.sql.catalog.clickhouse_s1r2.database", "default") .set("spark.sql.catalog.clickhouse_s1r2.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s2r1", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s2r1", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s2r1.host", clickhouse_s2r1_host) .set("spark.sql.catalog.clickhouse_s2r1.http_port", clickhouse_s2r1_http_port.toString) .set("spark.sql.catalog.clickhouse_s2r1.protocol", "http") @@ -53,7 +53,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s2r1.password", "") .set("spark.sql.catalog.clickhouse_s2r1.database", "default") .set("spark.sql.catalog.clickhouse_s2r1.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s2r2", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s2r2", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s2r2.host", clickhouse_s2r2_host) .set("spark.sql.catalog.clickhouse_s2r2.http_port", clickhouse_s2r2_http_port.toString) .set("spark.sql.catalog.clickhouse_s2r2.protocol", "http") diff --git a/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala b/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala index 9654d11a..65f7f372 100644 --- a/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala +++ b/spark-3.3/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala @@ -18,7 +18,7 @@ import org.apache.spark.SparkConf import org.apache.spark.sql.clickhouse.SparkTest import org.apache.spark.sql.functions.month import org.apache.spark.sql.types.StructType -import com.clickhouse.base.ClickHouseSingleMixIn +import com.clickhouse.spark.base.ClickHouseSingleMixIn trait SparkClickHouseSingleTest extends SparkTest with ClickHouseSingleMixIn { @@ -30,7 +30,7 @@ trait SparkClickHouseSingleTest extends SparkTest with ClickHouseSingleMixIn { .set("spark.sql.shuffle.partitions", "2") // catalog .set("spark.sql.defaultCatalog", "clickhouse") - .set("spark.sql.catalog.clickhouse", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse.host", clickhouseHost) .set("spark.sql.catalog.clickhouse.http_port", clickhouseHttpPort.toString) .set("spark.sql.catalog.clickhouse.protocol", "http") diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCatalog.scala similarity index 97% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCatalog.scala index 3a823ffb..dea17a61 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCatalog.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import com.clickhouse.client.ClickHouseProtocol import org.apache.spark.sql.catalyst.analysis._ @@ -22,12 +22,12 @@ import org.apache.spark.sql.connector.catalog.functions.UnboundFunction import org.apache.spark.sql.connector.expressions.Transform import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap -import com.clickhouse.Constants._ -import com.clickhouse.client.NodeClient -import com.clickhouse.exception.CHClientException -import com.clickhouse.exception.ClickHouseErrCode._ -import com.clickhouse.func.{FunctionRegistry, _} -import com.clickhouse.spec._ +import com.clickhouse.spark.Constants._ +import com.clickhouse.spark.client.NodeClient +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.exception.ClickHouseErrCode._ +import com.clickhouse.spark.func.{FunctionRegistry, _} +import com.clickhouse.spark.spec._ import java.time.ZoneId import java.util diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCommandRunner.scala similarity index 93% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCommandRunner.scala index f7da6bc4..75db6f78 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCommandRunner.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import org.apache.spark.sql.connector.ExternalCommandRunner import org.apache.spark.sql.util.CaseInsensitiveStringMap -import com.clickhouse.client.NodeClient +import com.clickhouse.spark.client.NodeClient class ClickHouseCommandRunner extends ExternalCommandRunner with ClickHouseHelper { diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseHelper.scala similarity index 98% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseHelper.scala index 46b62aee..6495d62c 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseHelper.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import com.clickhouse.client.ClickHouseProtocol import com.fasterxml.jackson.databind.JsonNode @@ -22,11 +22,11 @@ import org.apache.spark.sql.clickhouse.SchemaUtils import org.apache.spark.sql.connector.catalog.Identifier import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap -import com.clickhouse.Constants._ -import com.clickhouse.Utils.dateTimeFmt -import com.clickhouse.client.NodeClient -import com.clickhouse.exception.CHException -import com.clickhouse.spec._ +import com.clickhouse.spark.Constants._ +import com.clickhouse.spark.Utils.dateTimeFmt +import com.clickhouse.spark.client.NodeClient +import com.clickhouse.spark.exception.CHException +import com.clickhouse.spark.spec._ import java.time.{LocalDateTime, ZoneId} import java.util.{HashMap => JHashMap} diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseTable.scala similarity index 96% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseTable.scala index 484f07a7..0da17655 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseTable.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import java.lang.{Integer => JInt, Long => JLong} import java.time.{LocalDate, ZoneId} @@ -33,12 +33,12 @@ import org.apache.spark.sql.sources.{AlwaysTrue, Filter} import org.apache.spark.sql.types._ import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.apache.spark.unsafe.types.UTF8String -import com.clickhouse.Utils._ -import com.clickhouse.client.NodeClient -import com.clickhouse.expr.{Expr, OrderExpr} -import com.clickhouse.read.{ClickHouseMetadataColumn, ClickHouseScanBuilder, ScanJobDescription} -import com.clickhouse.spec._ -import com.clickhouse.write.{ClickHouseWriteBuilder, WriteJobDescription} +import com.clickhouse.spark.Utils._ +import com.clickhouse.spark.client.NodeClient +import com.clickhouse.spark.expr.{Expr, OrderExpr} +import com.clickhouse.spark.read.{ClickHouseMetadataColumn, ClickHouseScanBuilder, ScanJobDescription} +import com.clickhouse.spark.spec._ +import com.clickhouse.spark.write.{ClickHouseWriteBuilder, WriteJobDescription} case class ClickHouseTable( node: NodeSpec, diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/CommitMessage.scala similarity index 96% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/CommitMessage.scala index 75a93f0b..c98f4c9d 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/CommitMessage.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import org.apache.spark.sql.connector.write.WriterCommitMessage diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/Constants.scala similarity index 98% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/Constants.scala index 7facf6e7..e91b303a 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/Constants.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import com.clickhouse.client.config.ClickHouseClientOption._ diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/Metrics.scala similarity index 97% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/Metrics.scala index 944759f0..cc1e4f75 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/Metrics.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import org.apache.spark.sql.connector.metric.{CustomMetric, CustomSumMetric, CustomTaskMetric} -import com.clickhouse.Metrics._ +import com.clickhouse.spark.Metrics._ case class TaskMetric(override val name: String, override val value: Long) extends CustomTaskMetric diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/SQLHelper.scala similarity index 98% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/SQLHelper.scala index 43b9146e..cab13c3c 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/SQLHelper.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import java.sql.{Date, Timestamp} import java.time.{Instant, LocalDate, LocalDateTime, ZoneId} @@ -21,7 +21,7 @@ import org.apache.spark.sql.connector.expressions.aggregate._ import org.apache.spark.sql.connector.expressions.NamedReference import org.apache.spark.sql.sources._ import org.apache.spark.unsafe.types.UTF8String -import com.clickhouse.Utils._ +import com.clickhouse.spark.Utils._ trait SQLHelper { diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/func/ClickHouseXxHash64.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/ClickHouseXxHash64.scala similarity index 97% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/func/ClickHouseXxHash64.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/ClickHouseXxHash64.scala index 2c08c164..89dcf508 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/func/ClickHouseXxHash64.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/ClickHouseXxHash64.scala @@ -12,13 +12,13 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func import org.apache.spark.sql.catalyst.expressions.XxHash64Function import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFunction, UnboundFunction} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import com.clickhouse.spec.{ClusterSpec, ShardUtils} +import com.clickhouse.spark.spec.{ClusterSpec, ShardUtils} /** * ClickHouse equivalent function: diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/FunctionRegistry.scala similarity index 98% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/FunctionRegistry.scala index aa8d5858..c86d10fd 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/FunctionRegistry.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func import org.apache.spark.sql.connector.catalog.functions.UnboundFunction diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseMetadataColumn.scala similarity index 98% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseMetadataColumn.scala index 6e95401e..9bc518e1 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseMetadataColumn.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read import org.apache.spark.sql.connector.catalog.MetadataColumn import org.apache.spark.sql.types.{DataType, DoubleType, IntegerType, LongType, StringType, StructField} diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseRead.scala similarity index 96% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseRead.scala index 704fa1b3..e2a8e7c5 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseRead.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ @@ -23,11 +23,11 @@ import org.apache.spark.sql.connector.read._ import org.apache.spark.sql.connector.read.partitioning.{Partitioning, UnknownPartitioning} import org.apache.spark.sql.sources.{AlwaysTrue, Filter} import org.apache.spark.sql.types.StructType -import com.clickhouse._ -import com.clickhouse.client.NodeClient -import com.clickhouse.exception.CHClientException -import com.clickhouse.read.format.{ClickHouseBinaryReader, ClickHouseJsonReader} -import com.clickhouse.spec._ +import com.clickhouse.spark._ +import com.clickhouse.spark.client.NodeClient +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.read.format.{ClickHouseBinaryReader, ClickHouseJsonReader} +import com.clickhouse.spark.spec._ import java.time.ZoneId import scala.util.control.NonFatal diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseReader.scala similarity index 91% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseReader.scala index 629eb3c1..5068a8c3 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseReader.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read import com.clickhouse.client.ClickHouseResponse import com.clickhouse.data.ClickHouseCompression @@ -21,10 +21,10 @@ import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ import org.apache.spark.sql.connector.metric.CustomTaskMetric import org.apache.spark.sql.connector.read.PartitionReader import org.apache.spark.sql.types._ -import com.clickhouse.Metrics.{BLOCKS_READ, BYTES_READ} -import com.clickhouse.client.{NodeClient, NodesClient} -import com.clickhouse.format.StreamOutput -import com.clickhouse.{ClickHouseHelper, Logging, TaskMetric} +import com.clickhouse.spark.Metrics.{BLOCKS_READ, BYTES_READ} +import com.clickhouse.spark.client.{NodeClient, NodesClient} +import com.clickhouse.spark.format.StreamOutput +import com.clickhouse.spark.{ClickHouseHelper, Logging, TaskMetric} abstract class ClickHouseReader[Record]( scanJob: ScanJobDescription, diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/InputPartitions.scala similarity index 96% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/InputPartitions.scala index 5a2a4c62..dfd0277b 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/InputPartitions.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read import org.apache.spark.sql.connector.read.InputPartition import org.apache.spark.sql.connector.read.partitioning.Partitioning -import com.clickhouse.spec._ +import com.clickhouse.spark.spec._ case class ClickHousePartitioning(inputParts: Array[ClickHouseInputPartition]) extends Partitioning { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ScanJobDescription.scala similarity index 96% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ScanJobDescription.scala index ddc8335a..71878944 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ScanJobDescription.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read import org.apache.spark.sql.clickhouse.ReadOptions import org.apache.spark.sql.types.StructType -import com.clickhouse.spec._ +import com.clickhouse.spark.spec._ import java.time.ZoneId diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseBinaryReader.scala similarity index 94% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseBinaryReader.scala index bfa1c191..ff2a7b49 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseBinaryReader.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.read.format +package com.clickhouse.spark.read.format import com.clickhouse.data.value.ClickHouseStringValue import com.clickhouse.data.{ClickHouseRecord, ClickHouseValue} @@ -21,8 +21,8 @@ import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, GenericArrayData} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import com.clickhouse.exception.CHClientException -import com.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import java.time.ZoneOffset import java.util.concurrent.TimeUnit diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseJsonReader.scala similarity index 92% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseJsonReader.scala index 96b3e05a..2671155f 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseJsonReader.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.read.format +package com.clickhouse.spark.read.format import com.fasterxml.jackson.databind.JsonNode import org.apache.spark.sql.catalyst.InternalRow @@ -20,10 +20,10 @@ import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, GenericArrayData} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import com.clickhouse.Utils.{dateFmt, dateTimeFmt} -import com.clickhouse.exception.CHClientException -import com.clickhouse.format.{JSONCompactEachRowWithNamesAndTypesStreamOutput, StreamOutput} -import com.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} +import com.clickhouse.spark.Utils.{dateFmt, dateTimeFmt} +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.format.{JSONCompactEachRowWithNamesAndTypesStreamOutput, StreamOutput} +import com.clickhouse.spark.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import java.math.{MathContext, RoundingMode => RM} import java.time.{LocalDate, ZoneOffset, ZonedDateTime} diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWrite.scala similarity index 92% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWrite.scala index 25f971e4..c48ff8ec 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWrite.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.write +package com.clickhouse.spark.write import org.apache.spark.sql.catalyst.{InternalRow, SQLConfHelper} import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ @@ -20,9 +20,9 @@ import org.apache.spark.sql.connector.distributions.{Distribution, Distributions import org.apache.spark.sql.connector.expressions.SortOrder import org.apache.spark.sql.connector.metric.CustomMetric import org.apache.spark.sql.connector.write._ -import com.clickhouse._ -import com.clickhouse.exception.CHClientException -import com.clickhouse.write.format.{ClickHouseArrowStreamWriter, ClickHouseJsonEachRowWriter} +import com.clickhouse.spark._ +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.write.format.{ClickHouseArrowStreamWriter, ClickHouseJsonEachRowWriter} class ClickHouseWriteBuilder(writeJob: WriteJobDescription) extends WriteBuilder { diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala similarity index 96% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala index a339da2d..13953a2a 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.write +package com.clickhouse.spark.write import com.clickhouse.client.ClickHouseProtocol import com.clickhouse.data.ClickHouseCompression @@ -23,12 +23,12 @@ import org.apache.spark.sql.clickhouse.ExprUtils import org.apache.spark.sql.connector.metric.CustomTaskMetric import org.apache.spark.sql.connector.write.{DataWriter, WriterCommitMessage} import org.apache.spark.sql.types._ -import com.clickhouse.Metrics._ -import com.clickhouse._ -import com.clickhouse.client.{ClusterClient, NodeClient} -import com.clickhouse.exception._ -import com.clickhouse.io.{ForwardingOutputStream, ObservableOutputStream} -import com.clickhouse.spec.{DistributedEngineSpec, ShardUtils} +import com.clickhouse.spark.Metrics._ +import com.clickhouse.spark._ +import com.clickhouse.spark.client.{ClusterClient, NodeClient} +import com.clickhouse.spark.exception._ +import com.clickhouse.spark.io.{ForwardingOutputStream, ObservableOutputStream} +import com.clickhouse.spark.spec.{DistributedEngineSpec, ShardUtils} import java.io.{ByteArrayInputStream, ByteArrayOutputStream, OutputStream} import java.util.concurrent.atomic.LongAdder diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/WriteJobDescription.scala similarity index 94% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/WriteJobDescription.scala index 03100ed8..9a8d1f21 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/WriteJobDescription.scala @@ -12,15 +12,15 @@ * limitations under the License. */ -package com.clickhouse.write +package com.clickhouse.spark.write import java.time.ZoneId import org.apache.spark.sql.clickhouse.{ExprUtils, WriteOptions} import org.apache.spark.sql.connector.expressions.{Expression, SortOrder, Transform} import org.apache.spark.sql.types.StructType -import com.clickhouse.expr.{Expr, FuncExpr, OrderExpr} -import com.clickhouse.spec._ +import com.clickhouse.spark.expr.{Expr, FuncExpr, OrderExpr} +import com.clickhouse.spark.spec._ case class WriteJobDescription( queryId: String, diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseArrowStreamWriter.scala similarity index 94% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseArrowStreamWriter.scala index e226e6a4..a9867849 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseArrowStreamWriter.scala @@ -12,9 +12,8 @@ * limitations under the License. */ -package com.clickhouse.write.format +package com.clickhouse.spark.write.format -import com.clickhouse.write.{ClickHouseWriter, WriteJobDescription} import org.apache.arrow.memory.BufferAllocator import org.apache.arrow.vector.VectorSchemaRoot import org.apache.arrow.vector.ipc.ArrowStreamWriter @@ -22,6 +21,7 @@ import org.apache.arrow.vector.types.pojo.Schema import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.SparkUtils import org.apache.spark.sql.execution.arrow.ArrowWriter +import com.clickhouse.spark.write.{ClickHouseWriter, WriteJobDescription} class ClickHouseArrowStreamWriter(writeJob: WriteJobDescription) extends ClickHouseWriter(writeJob) { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseJsonEachRowWriter.scala similarity index 91% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala rename to spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseJsonEachRowWriter.scala index 64c0dafe..451850ea 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseJsonEachRowWriter.scala @@ -12,12 +12,12 @@ * limitations under the License. */ -package com.clickhouse.write.format +package com.clickhouse.spark.write.format import org.apache.commons.io.IOUtils import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.JsonWriter -import com.clickhouse.write.{ClickHouseWriter, WriteJobDescription} +import com.clickhouse.spark.write.{ClickHouseWriter, WriteJobDescription} class ClickHouseJsonEachRowWriter(writeJob: WriteJobDescription) extends ClickHouseWriter(writeJob) { diff --git a/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala b/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala index c041ee7b..ce5c28d3 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala @@ -16,7 +16,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.internal.config.ConfigEntry import org.apache.spark.sql.internal.SQLConf._ -import com.clickhouse.exception.ClickHouseErrCode._ +import com.clickhouse.spark.exception.ClickHouseErrCode._ import java.util.concurrent.TimeUnit diff --git a/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala b/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala index 05b8bc6b..3c131a3b 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala @@ -21,8 +21,8 @@ import org.apache.spark.sql.clickhouse.ClickHouseSQLConf.IGNORE_UNSUPPORTED_TRAN import org.apache.spark.sql.connector.expressions.Expressions._ import org.apache.spark.sql.connector.expressions.{Expression => V2Expression, _} import org.apache.spark.sql.types.{IntegerType, LongType, StructField, StructType} -import com.clickhouse.exception.CHClientException -import com.clickhouse.expr._ +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.expr._ import scala.annotation.tailrec import scala.util.{Failure, Success, Try} diff --git a/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala b/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala index 6bb11760..cc70a493 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse import com.clickhouse.data.ClickHouseDataType._ import com.clickhouse.data.{ClickHouseColumn, ClickHouseDataType} import org.apache.spark.sql.types._ -import com.clickhouse.exception.CHClientException +import com.clickhouse.spark.exception.CHClientException import org.apache.spark.sql.catalyst.SQLConfHelper import org.apache.spark.sql.clickhouse.ClickHouseSQLConf.READ_FIXED_STRING_AS diff --git a/spark-3.3/clickhouse-spark/src/test/resources/log4j2.xml b/spark-3.3/clickhouse-spark/src/test/resources/log4j2.xml index 31e7b6a1..3e2579f1 100644 --- a/spark-3.3/clickhouse-spark/src/test/resources/log4j2.xml +++ b/spark-3.3/clickhouse-spark/src/test/resources/log4j2.xml @@ -31,7 +31,7 @@ - + diff --git a/spark-3.3/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala b/spark-3.3/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala index 898240e6..5cc49154 100644 --- a/spark-3.3/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala +++ b/spark-3.3/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala @@ -16,7 +16,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.scalatest.funsuite.AnyFunSuite -import com.clickhouse.ClickHouseHelper +import com.clickhouse.spark.ClickHouseHelper import scala.collection.JavaConverters._ diff --git a/spark-3.4/clickhouse-spark-it/src/test/resources/log4j2.xml b/spark-3.4/clickhouse-spark-it/src/test/resources/log4j2.xml index 31e7b6a1..3e2579f1 100644 --- a/spark-3.4/clickhouse-spark-it/src/test/resources/log4j2.xml +++ b/spark-3.4/clickhouse-spark-it/src/test/resources/log4j2.xml @@ -31,7 +31,7 @@ - + diff --git a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala index 709bce71..dc914722 100644 --- a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala +++ b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.SparkConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.{DataFrame, QueryTest} -import com.clickhouse.ClickHouseCommandRunner +import com.clickhouse.spark.ClickHouseCommandRunner import java.sql.{Date, Timestamp} import java.time.Instant diff --git a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala index 257494fd..d711ff4b 100644 --- a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala +++ b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala @@ -15,7 +15,7 @@ package org.apache.spark.sql.clickhouse.cluster import org.apache.spark.sql.clickhouse.TestUtils.om -import com.clickhouse.func._ +import com.clickhouse.spark.func._ import java.lang.{Long => JLong} class ClickHouseClusterHashUDFSuite extends SparkClickHouseClusterTest { diff --git a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala index 9655da33..a75ef7c1 100644 --- a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala +++ b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse.cluster import org.apache.spark.SparkConf import org.apache.spark.sql.clickhouse.SparkTest import org.apache.spark.sql.functions.{month, year} -import com.clickhouse.base.ClickHouseClusterMixIn +import com.clickhouse.spark.base.ClickHouseClusterMixIn trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { @@ -29,7 +29,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.shuffle.partitions", "4") // catalog .set("spark.sql.defaultCatalog", "clickhouse_s1r1") - .set("spark.sql.catalog.clickhouse_s1r1", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s1r1", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s1r1.host", clickhouse_s1r1_host) .set("spark.sql.catalog.clickhouse_s1r1.http_port", clickhouse_s1r1_http_port.toString) .set("spark.sql.catalog.clickhouse_s1r1.protocol", "http") @@ -37,7 +37,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s1r1.password", "") .set("spark.sql.catalog.clickhouse_s1r1.database", "default") .set("spark.sql.catalog.clickhouse_s1r1.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s1r2", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s1r2", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s1r2.host", clickhouse_s1r2_host) .set("spark.sql.catalog.clickhouse_s1r2.http_port", clickhouse_s1r2_http_port.toString) .set("spark.sql.catalog.clickhouse_s1r2.protocol", "http") @@ -45,7 +45,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s1r2.password", "") .set("spark.sql.catalog.clickhouse_s1r2.database", "default") .set("spark.sql.catalog.clickhouse_s1r2.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s2r1", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s2r1", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s2r1.host", clickhouse_s2r1_host) .set("spark.sql.catalog.clickhouse_s2r1.http_port", clickhouse_s2r1_http_port.toString) .set("spark.sql.catalog.clickhouse_s2r1.protocol", "http") @@ -53,7 +53,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s2r1.password", "") .set("spark.sql.catalog.clickhouse_s2r1.database", "default") .set("spark.sql.catalog.clickhouse_s2r1.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s2r2", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s2r2", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s2r2.host", clickhouse_s2r2_host) .set("spark.sql.catalog.clickhouse_s2r2.http_port", clickhouse_s2r2_http_port.toString) .set("spark.sql.catalog.clickhouse_s2r2.protocol", "http") diff --git a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala index 9654d11a..65f7f372 100644 --- a/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala +++ b/spark-3.4/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala @@ -18,7 +18,7 @@ import org.apache.spark.SparkConf import org.apache.spark.sql.clickhouse.SparkTest import org.apache.spark.sql.functions.month import org.apache.spark.sql.types.StructType -import com.clickhouse.base.ClickHouseSingleMixIn +import com.clickhouse.spark.base.ClickHouseSingleMixIn trait SparkClickHouseSingleTest extends SparkTest with ClickHouseSingleMixIn { @@ -30,7 +30,7 @@ trait SparkClickHouseSingleTest extends SparkTest with ClickHouseSingleMixIn { .set("spark.sql.shuffle.partitions", "2") // catalog .set("spark.sql.defaultCatalog", "clickhouse") - .set("spark.sql.catalog.clickhouse", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse.host", clickhouseHost) .set("spark.sql.catalog.clickhouse.http_port", clickhouseHttpPort.toString) .set("spark.sql.catalog.clickhouse.protocol", "http") diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCatalog.scala similarity index 97% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCatalog.scala index 6da0392e..51c2ecb8 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCatalog.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import com.clickhouse.client.ClickHouseProtocol import org.apache.spark.sql.catalyst.analysis._ @@ -22,12 +22,12 @@ import org.apache.spark.sql.connector.catalog.functions.UnboundFunction import org.apache.spark.sql.connector.expressions.Transform import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap -import com.clickhouse.Constants._ -import com.clickhouse.client.NodeClient -import com.clickhouse.exception.CHClientException -import com.clickhouse.exception.ClickHouseErrCode._ -import com.clickhouse.func.{ClickHouseXxHash64Shard, FunctionRegistry, _} -import com.clickhouse.spec._ +import com.clickhouse.spark.Constants._ +import com.clickhouse.spark.client.NodeClient +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.exception.ClickHouseErrCode._ +import com.clickhouse.spark.func.{ClickHouseXxHash64Shard, FunctionRegistry, _} +import com.clickhouse.spark.spec._ import java.time.ZoneId import java.util diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCommandRunner.scala similarity index 93% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCommandRunner.scala index f7da6bc4..75db6f78 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCommandRunner.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import org.apache.spark.sql.connector.ExternalCommandRunner import org.apache.spark.sql.util.CaseInsensitiveStringMap -import com.clickhouse.client.NodeClient +import com.clickhouse.spark.client.NodeClient class ClickHouseCommandRunner extends ExternalCommandRunner with ClickHouseHelper { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseHelper.scala similarity index 98% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseHelper.scala index 9f648d4f..68a322fa 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseHelper.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import com.clickhouse.client.ClickHouseProtocol import com.fasterxml.jackson.databind.JsonNode @@ -22,11 +22,11 @@ import org.apache.spark.sql.clickhouse.SchemaUtils import org.apache.spark.sql.connector.catalog.Identifier import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap -import com.clickhouse.Constants._ -import com.clickhouse.Utils.dateTimeFmt -import com.clickhouse.client.NodeClient -import com.clickhouse.exception.CHException -import com.clickhouse.spec._ +import com.clickhouse.spark.Constants._ +import com.clickhouse.spark.Utils.dateTimeFmt +import com.clickhouse.spark.client.NodeClient +import com.clickhouse.spark.exception.CHException +import com.clickhouse.spark.spec._ import java.time.{LocalDateTime, ZoneId} import java.util.{HashMap => JHashMap} diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseTable.scala similarity index 96% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseTable.scala index 9b3a44be..f409bbef 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseTable.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.{InternalRow, SQLConfHelper} @@ -27,13 +27,13 @@ import org.apache.spark.sql.sources.{AlwaysTrue, Filter} import org.apache.spark.sql.types._ import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.apache.spark.unsafe.types.UTF8String -import com.clickhouse.Utils._ -import com.clickhouse.client.NodeClient -import com.clickhouse.expr.{Expr, OrderExpr} -import com.clickhouse.func.FunctionRegistry -import com.clickhouse.read.{ClickHouseMetadataColumn, ClickHouseScanBuilder, ScanJobDescription} -import com.clickhouse.spec._ -import com.clickhouse.write.{ClickHouseWriteBuilder, WriteJobDescription} +import com.clickhouse.spark.Utils._ +import com.clickhouse.spark.client.NodeClient +import com.clickhouse.spark.expr.{Expr, OrderExpr} +import com.clickhouse.spark.func.FunctionRegistry +import com.clickhouse.spark.read.{ClickHouseMetadataColumn, ClickHouseScanBuilder, ScanJobDescription} +import com.clickhouse.spark.spec._ +import com.clickhouse.spark.write.{ClickHouseWriteBuilder, WriteJobDescription} import java.lang.{Integer => JInt, Long => JLong} import java.time.{LocalDate, ZoneId} diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/CommitMessage.scala similarity index 96% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/CommitMessage.scala index 75a93f0b..c98f4c9d 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/CommitMessage.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import org.apache.spark.sql.connector.write.WriterCommitMessage diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/Constants.scala similarity index 98% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/Constants.scala index 7facf6e7..e91b303a 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/Constants.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import com.clickhouse.client.config.ClickHouseClientOption._ diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/Metrics.scala similarity index 97% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/Metrics.scala index 944759f0..cc1e4f75 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/Metrics.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import org.apache.spark.sql.connector.metric.{CustomMetric, CustomSumMetric, CustomTaskMetric} -import com.clickhouse.Metrics._ +import com.clickhouse.spark.Metrics._ case class TaskMetric(override val name: String, override val value: Long) extends CustomTaskMetric diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/SQLHelper.scala similarity index 98% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/SQLHelper.scala index 43b9146e..cab13c3c 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/SQLHelper.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import java.sql.{Date, Timestamp} import java.time.{Instant, LocalDate, LocalDateTime, ZoneId} @@ -21,7 +21,7 @@ import org.apache.spark.sql.connector.expressions.aggregate._ import org.apache.spark.sql.connector.expressions.NamedReference import org.apache.spark.sql.sources._ import org.apache.spark.unsafe.types.UTF8String -import com.clickhouse.Utils._ +import com.clickhouse.spark.Utils._ trait SQLHelper { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/CityHash64.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/CityHash64.scala similarity index 93% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/CityHash64.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/CityHash64.scala index 6dd26a5c..5cd677d1 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/CityHash64.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/CityHash64.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func -import com.clickhouse.hash +import com.clickhouse.spark.hash // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L694 object CityHash64 extends MultiStringArgsHash { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/FunctionRegistry.scala similarity index 99% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/FunctionRegistry.scala index d43ae2ec..25263717 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/FunctionRegistry.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func import org.apache.spark.sql.connector.catalog.functions.UnboundFunction diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MultiStringArgsHash.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MultiStringArgsHash.scala similarity index 98% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MultiStringArgsHash.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MultiStringArgsHash.scala index 4b212561..d68fb2ea 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MultiStringArgsHash.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MultiStringArgsHash.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFunction, UnboundFunction} diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash2.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MurmurHash2.scala similarity index 92% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash2.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MurmurHash2.scala index 90d6bb63..b54ec7d6 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash2.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MurmurHash2.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func -import com.clickhouse.hash -import com.clickhouse.hash.HashUtils +import com.clickhouse.spark.hash +import com.clickhouse.spark.hash.HashUtils // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L460 object MurmurHash2_64 extends MultiStringArgsHash { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash3.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MurmurHash3.scala similarity index 92% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash3.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MurmurHash3.scala index 7c328218..754d2f83 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash3.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MurmurHash3.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func -import com.clickhouse.hash -import com.clickhouse.hash.HashUtils +import com.clickhouse.spark.hash +import com.clickhouse.spark.hash.HashUtils // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L543 object MurmurHash3_64 extends MultiStringArgsHash { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/XxHash64.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/XxHash64.scala similarity index 97% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/XxHash64.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/XxHash64.scala index 6175f5d7..b08cc136 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/XxHash64.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/XxHash64.scala @@ -12,13 +12,13 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func -import com.clickhouse.spec.{ClusterSpec, ShardUtils} import org.apache.spark.sql.catalyst.expressions.XxHash64Function import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFunction, UnboundFunction} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String +import com.clickhouse.spark.spec.{ClusterSpec, ShardUtils} /** * ClickHouse equivalent function: diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseMetadataColumn.scala similarity index 98% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseMetadataColumn.scala index 6e95401e..9bc518e1 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseMetadataColumn.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read import org.apache.spark.sql.connector.catalog.MetadataColumn import org.apache.spark.sql.types.{DataType, DoubleType, IntegerType, LongType, StringType, StructField} diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseRead.scala similarity index 96% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseRead.scala index 704fa1b3..e2a8e7c5 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseRead.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ @@ -23,11 +23,11 @@ import org.apache.spark.sql.connector.read._ import org.apache.spark.sql.connector.read.partitioning.{Partitioning, UnknownPartitioning} import org.apache.spark.sql.sources.{AlwaysTrue, Filter} import org.apache.spark.sql.types.StructType -import com.clickhouse._ -import com.clickhouse.client.NodeClient -import com.clickhouse.exception.CHClientException -import com.clickhouse.read.format.{ClickHouseBinaryReader, ClickHouseJsonReader} -import com.clickhouse.spec._ +import com.clickhouse.spark._ +import com.clickhouse.spark.client.NodeClient +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.read.format.{ClickHouseBinaryReader, ClickHouseJsonReader} +import com.clickhouse.spark.spec._ import java.time.ZoneId import scala.util.control.NonFatal diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseReader.scala similarity index 91% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseReader.scala index 629eb3c1..5068a8c3 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseReader.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read import com.clickhouse.client.ClickHouseResponse import com.clickhouse.data.ClickHouseCompression @@ -21,10 +21,10 @@ import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ import org.apache.spark.sql.connector.metric.CustomTaskMetric import org.apache.spark.sql.connector.read.PartitionReader import org.apache.spark.sql.types._ -import com.clickhouse.Metrics.{BLOCKS_READ, BYTES_READ} -import com.clickhouse.client.{NodeClient, NodesClient} -import com.clickhouse.format.StreamOutput -import com.clickhouse.{ClickHouseHelper, Logging, TaskMetric} +import com.clickhouse.spark.Metrics.{BLOCKS_READ, BYTES_READ} +import com.clickhouse.spark.client.{NodeClient, NodesClient} +import com.clickhouse.spark.format.StreamOutput +import com.clickhouse.spark.{ClickHouseHelper, Logging, TaskMetric} abstract class ClickHouseReader[Record]( scanJob: ScanJobDescription, diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/InputPartitions.scala similarity index 96% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/InputPartitions.scala index 5a2a4c62..dfd0277b 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/InputPartitions.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read import org.apache.spark.sql.connector.read.InputPartition import org.apache.spark.sql.connector.read.partitioning.Partitioning -import com.clickhouse.spec._ +import com.clickhouse.spark.spec._ case class ClickHousePartitioning(inputParts: Array[ClickHouseInputPartition]) extends Partitioning { diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ScanJobDescription.scala similarity index 96% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ScanJobDescription.scala index ddc8335a..71878944 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ScanJobDescription.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read import org.apache.spark.sql.clickhouse.ReadOptions import org.apache.spark.sql.types.StructType -import com.clickhouse.spec._ +import com.clickhouse.spark.spec._ import java.time.ZoneId diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseBinaryReader.scala similarity index 94% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseBinaryReader.scala index 4ceffc41..ff2a7b49 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseBinaryReader.scala @@ -12,17 +12,17 @@ * limitations under the License. */ -package com.clickhouse.read.format +package com.clickhouse.spark.read.format import com.clickhouse.data.value.ClickHouseStringValue import com.clickhouse.data.{ClickHouseRecord, ClickHouseValue} -import com.clickhouse.exception.CHClientException -import com.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, GenericArrayData} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import java.time.ZoneOffset import java.util.concurrent.TimeUnit diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseJsonReader.scala similarity index 92% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseJsonReader.scala index 96b3e05a..2671155f 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseJsonReader.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.read.format +package com.clickhouse.spark.read.format import com.fasterxml.jackson.databind.JsonNode import org.apache.spark.sql.catalyst.InternalRow @@ -20,10 +20,10 @@ import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, GenericArrayData} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import com.clickhouse.Utils.{dateFmt, dateTimeFmt} -import com.clickhouse.exception.CHClientException -import com.clickhouse.format.{JSONCompactEachRowWithNamesAndTypesStreamOutput, StreamOutput} -import com.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} +import com.clickhouse.spark.Utils.{dateFmt, dateTimeFmt} +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.format.{JSONCompactEachRowWithNamesAndTypesStreamOutput, StreamOutput} +import com.clickhouse.spark.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import java.math.{MathContext, RoundingMode => RM} import java.time.{LocalDate, ZoneOffset, ZonedDateTime} diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWrite.scala similarity index 92% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWrite.scala index 504f69ae..bb1753b2 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWrite.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.write +package com.clickhouse.spark.write import org.apache.spark.sql.catalyst.{InternalRow, SQLConfHelper} import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ @@ -20,9 +20,9 @@ import org.apache.spark.sql.connector.distributions.{Distribution, Distributions import org.apache.spark.sql.connector.expressions.SortOrder import org.apache.spark.sql.connector.metric.CustomMetric import org.apache.spark.sql.connector.write._ -import com.clickhouse._ -import com.clickhouse.exception.CHClientException -import com.clickhouse.write.format.{ClickHouseArrowStreamWriter, ClickHouseJsonEachRowWriter} +import com.clickhouse.spark._ +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.write.format.{ClickHouseArrowStreamWriter, ClickHouseJsonEachRowWriter} class ClickHouseWriteBuilder(writeJob: WriteJobDescription) extends WriteBuilder { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala similarity index 97% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala index ccb29d18..bedd827c 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.write +package com.clickhouse.spark.write import com.clickhouse.client.ClickHouseProtocol import com.clickhouse.data.ClickHouseCompression @@ -24,12 +24,12 @@ import org.apache.spark.sql.clickhouse.ExprUtils import org.apache.spark.sql.connector.metric.CustomTaskMetric import org.apache.spark.sql.connector.write.{DataWriter, WriterCommitMessage} import org.apache.spark.sql.types._ -import com.clickhouse.Metrics._ -import com.clickhouse._ -import com.clickhouse.client.{ClusterClient, NodeClient} -import com.clickhouse.exception._ -import com.clickhouse.io.{ForwardingOutputStream, ObservableOutputStream} -import com.clickhouse.spec.{DistributedEngineSpec, ShardUtils} +import com.clickhouse.spark.Metrics._ +import com.clickhouse.spark._ +import com.clickhouse.spark.client.{ClusterClient, NodeClient} +import com.clickhouse.spark.exception._ +import com.clickhouse.spark.io.{ForwardingOutputStream, ObservableOutputStream} +import com.clickhouse.spark.spec.{DistributedEngineSpec, ShardUtils} import java.io.{ByteArrayInputStream, ByteArrayOutputStream, OutputStream} import java.util.concurrent.atomic.LongAdder diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/WriteJobDescription.scala similarity index 93% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/WriteJobDescription.scala index e1ba1e5e..603e1e68 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/WriteJobDescription.scala @@ -12,15 +12,15 @@ * limitations under the License. */ -package com.clickhouse.write +package com.clickhouse.spark.write import java.time.ZoneId import org.apache.spark.sql.clickhouse.{ExprUtils, WriteOptions} import org.apache.spark.sql.connector.expressions.{Expression, SortOrder, Transform} import org.apache.spark.sql.types.StructType -import com.clickhouse.expr.{Expr, FuncExpr, OrderExpr} -import com.clickhouse.func.FunctionRegistry -import com.clickhouse.spec._ +import com.clickhouse.spark.expr.{Expr, FuncExpr, OrderExpr} +import com.clickhouse.spark.func.FunctionRegistry +import com.clickhouse.spark.spec._ case class WriteJobDescription( queryId: String, diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseArrowStreamWriter.scala similarity index 94% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseArrowStreamWriter.scala index a97e7d89..a9867849 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseArrowStreamWriter.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.write.format +package com.clickhouse.spark.write.format import org.apache.arrow.memory.BufferAllocator import org.apache.arrow.vector.VectorSchemaRoot @@ -21,7 +21,7 @@ import org.apache.arrow.vector.types.pojo.Schema import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.SparkUtils import org.apache.spark.sql.execution.arrow.ArrowWriter -import com.clickhouse.write.{ClickHouseWriter, WriteJobDescription} +import com.clickhouse.spark.write.{ClickHouseWriter, WriteJobDescription} class ClickHouseArrowStreamWriter(writeJob: WriteJobDescription) extends ClickHouseWriter(writeJob) { diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseJsonEachRowWriter.scala similarity index 91% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala rename to spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseJsonEachRowWriter.scala index 64c0dafe..451850ea 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseJsonEachRowWriter.scala @@ -12,12 +12,12 @@ * limitations under the License. */ -package com.clickhouse.write.format +package com.clickhouse.spark.write.format import org.apache.commons.io.IOUtils import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.JsonWriter -import com.clickhouse.write.{ClickHouseWriter, WriteJobDescription} +import com.clickhouse.spark.write.{ClickHouseWriter, WriteJobDescription} class ClickHouseJsonEachRowWriter(writeJob: WriteJobDescription) extends ClickHouseWriter(writeJob) { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala b/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala index c041ee7b..ce5c28d3 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala @@ -16,7 +16,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.internal.config.ConfigEntry import org.apache.spark.sql.internal.SQLConf._ -import com.clickhouse.exception.ClickHouseErrCode._ +import com.clickhouse.spark.exception.ClickHouseErrCode._ import java.util.concurrent.TimeUnit diff --git a/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala b/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala index ea8dd36f..99498222 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala @@ -28,10 +28,10 @@ import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFu import org.apache.spark.sql.connector.expressions.Expressions._ import org.apache.spark.sql.connector.expressions.{Expression => V2Expression, SortOrder => V2SortOrder, _} import org.apache.spark.sql.types.{StructField, StructType} -import com.clickhouse.exception.CHClientException -import com.clickhouse.expr._ -import com.clickhouse.func.FunctionRegistry -import com.clickhouse.spec.ClusterSpec +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.expr._ +import com.clickhouse.spark.func.FunctionRegistry +import com.clickhouse.spark.spec.ClusterSpec import scala.util.{Failure, Success, Try} diff --git a/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala b/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala index 6bb11760..cc70a493 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse import com.clickhouse.data.ClickHouseDataType._ import com.clickhouse.data.{ClickHouseColumn, ClickHouseDataType} import org.apache.spark.sql.types._ -import com.clickhouse.exception.CHClientException +import com.clickhouse.spark.exception.CHClientException import org.apache.spark.sql.catalyst.SQLConfHelper import org.apache.spark.sql.clickhouse.ClickHouseSQLConf.READ_FIXED_STRING_AS diff --git a/spark-3.4/clickhouse-spark/src/test/resources/log4j2.xml b/spark-3.4/clickhouse-spark/src/test/resources/log4j2.xml index 31e7b6a1..3e2579f1 100644 --- a/spark-3.4/clickhouse-spark/src/test/resources/log4j2.xml +++ b/spark-3.4/clickhouse-spark/src/test/resources/log4j2.xml @@ -31,7 +31,7 @@ - + diff --git a/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala b/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala index 898240e6..5cc49154 100644 --- a/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala +++ b/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala @@ -16,7 +16,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.scalatest.funsuite.AnyFunSuite -import com.clickhouse.ClickHouseHelper +import com.clickhouse.spark.ClickHouseHelper import scala.collection.JavaConverters._ diff --git a/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala b/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala index 597659b6..e034ac7c 100644 --- a/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala +++ b/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.internal.config.ConfigEntry import org.apache.spark.sql.internal.SQLConf import org.scalatest.funsuite.AnyFunSuite -import com.clickhouse.Utils +import com.clickhouse.spark.Utils import java.nio.charset.StandardCharsets import java.nio.file.{Files, Path, Paths, StandardOpenOption} diff --git a/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala b/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala index 45188209..fc4a7efa 100644 --- a/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala +++ b/spark-3.4/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala @@ -15,7 +15,7 @@ package org.apache.spark.sql.clickhouse import org.scalatest.funsuite.AnyFunSuite -import com.clickhouse.func._ +import com.clickhouse.spark.func._ class FunctionRegistrySuite extends AnyFunSuite { diff --git a/spark-3.5/clickhouse-spark-it/src/test/resources/log4j2.xml b/spark-3.5/clickhouse-spark-it/src/test/resources/log4j2.xml index 31e7b6a1..3e2579f1 100644 --- a/spark-3.5/clickhouse-spark-it/src/test/resources/log4j2.xml +++ b/spark-3.5/clickhouse-spark-it/src/test/resources/log4j2.xml @@ -31,7 +31,7 @@ - + diff --git a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala index 709bce71..dc914722 100644 --- a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala +++ b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/SparkTest.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.SparkConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.{DataFrame, QueryTest} -import com.clickhouse.ClickHouseCommandRunner +import com.clickhouse.spark.ClickHouseCommandRunner import java.sql.{Date, Timestamp} import java.time.Instant diff --git a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala index 257494fd..d711ff4b 100644 --- a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala +++ b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/ClickHouseClusterHashUDFSuite.scala @@ -15,7 +15,7 @@ package org.apache.spark.sql.clickhouse.cluster import org.apache.spark.sql.clickhouse.TestUtils.om -import com.clickhouse.func._ +import com.clickhouse.spark.func._ import java.lang.{Long => JLong} class ClickHouseClusterHashUDFSuite extends SparkClickHouseClusterTest { diff --git a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala index aa7446f6..c8de2044 100644 --- a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala +++ b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/cluster/SparkClickHouseClusterTest.scala @@ -14,7 +14,7 @@ package org.apache.spark.sql.clickhouse.cluster -import com.clickhouse.base.ClickHouseClusterMixIn +import com.clickhouse.spark.base.ClickHouseClusterMixIn import org.apache.spark.SparkConf import org.apache.spark.sql.clickhouse.SparkTest import org.apache.spark.sql.functions.{month, year} @@ -29,7 +29,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.shuffle.partitions", "4") // catalog .set("spark.sql.defaultCatalog", "clickhouse_s1r1") - .set("spark.sql.catalog.clickhouse_s1r1", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s1r1", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s1r1.host", clickhouse_s1r1_host) .set("spark.sql.catalog.clickhouse_s1r1.http_port", clickhouse_s1r1_http_port.toString) .set("spark.sql.catalog.clickhouse_s1r1.protocol", "http") @@ -37,7 +37,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s1r1.password", "") .set("spark.sql.catalog.clickhouse_s1r1.database", "default") .set("spark.sql.catalog.clickhouse_s1r1.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s1r2", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s1r2", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s1r2.host", clickhouse_s1r2_host) .set("spark.sql.catalog.clickhouse_s1r2.http_port", clickhouse_s1r2_http_port.toString) .set("spark.sql.catalog.clickhouse_s1r2.protocol", "http") @@ -45,7 +45,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s1r2.password", "") .set("spark.sql.catalog.clickhouse_s1r2.database", "default") .set("spark.sql.catalog.clickhouse_s1r2.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s2r1", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s2r1", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s2r1.host", clickhouse_s2r1_host) .set("spark.sql.catalog.clickhouse_s2r1.http_port", clickhouse_s2r1_http_port.toString) .set("spark.sql.catalog.clickhouse_s2r1.protocol", "http") @@ -53,7 +53,7 @@ trait SparkClickHouseClusterTest extends SparkTest with ClickHouseClusterMixIn { .set("spark.sql.catalog.clickhouse_s2r1.password", "") .set("spark.sql.catalog.clickhouse_s2r1.database", "default") .set("spark.sql.catalog.clickhouse_s2r1.option.custom_http_params", "async_insert=1,wait_for_async_insert=1") - .set("spark.sql.catalog.clickhouse_s2r2", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse_s2r2", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse_s2r2.host", clickhouse_s2r2_host) .set("spark.sql.catalog.clickhouse_s2r2.http_port", clickhouse_s2r2_http_port.toString) .set("spark.sql.catalog.clickhouse_s2r2.protocol", "http") diff --git a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala index ee14dd20..ca80c49f 100644 --- a/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala +++ b/spark-3.5/clickhouse-spark-it/src/test/scala/org/apache/spark/sql/clickhouse/single/SparkClickHouseSingleTest.scala @@ -14,7 +14,7 @@ package org.apache.spark.sql.clickhouse.single -import com.clickhouse.base.ClickHouseSingleMixIn +import com.clickhouse.spark.base.ClickHouseSingleMixIn import org.apache.spark.SparkConf import org.apache.spark.sql.clickhouse.SparkTest import org.apache.spark.sql.functions.month @@ -30,7 +30,7 @@ trait SparkClickHouseSingleTest extends SparkTest with ClickHouseSingleMixIn { .set("spark.sql.shuffle.partitions", "2") // catalog .set("spark.sql.defaultCatalog", "clickhouse") - .set("spark.sql.catalog.clickhouse", "com.clickhouse.ClickHouseCatalog") + .set("spark.sql.catalog.clickhouse", "com.clickhouse.spark.ClickHouseCatalog") .set("spark.sql.catalog.clickhouse.host", clickhouseHost) .set("spark.sql.catalog.clickhouse.http_port", clickhouseHttpPort.toString) .set("spark.sql.catalog.clickhouse.protocol", "http") diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCatalog.scala similarity index 96% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCatalog.scala index 5d7f976d..d8437b59 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCatalog.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCatalog.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark -import com.clickhouse.client.{ClickHouseProtocol, NodeClient} -import com.clickhouse.exception.CHClientException +import com.clickhouse.client.ClickHouseProtocol +import com.clickhouse.spark.exception.CHClientException import org.apache.spark.sql.catalyst.analysis._ import org.apache.spark.sql.clickhouse.{ExprUtils, SchemaUtils} import org.apache.spark.sql.connector.catalog._ @@ -24,18 +24,18 @@ import org.apache.spark.sql.connector.expressions.Transform import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap import Constants._ -import com.clickhouse -import com.clickhouse.exception.ClickHouseErrCode._ -import com.clickhouse.func.{ +import com.clickhouse.spark.exception.ClickHouseErrCode._ +import com.clickhouse.spark.func.{ ClickHouseXxHash64Shard, CompositeFunctionRegistry, DynamicFunctionRegistry, FunctionRegistry, StaticFunctionRegistry } -import com.clickhouse.spec.{ClusterSpec, DistributedEngineSpec, NodeSpec, TableEngineUtils} -import com.clickhouse.func._ -import com.clickhouse.spec._ +import com.clickhouse.spark.spec.{ClusterSpec, DistributedEngineSpec, NodeSpec, TableEngineUtils} +import com.clickhouse.spark.func._ +import com.clickhouse.spark.client.NodeClient +import com.clickhouse.spark.spec._ import java.time.ZoneId import java.util @@ -145,7 +145,7 @@ class ClickHouseCatalog extends TableCatalog Some(TableEngineUtils.resolveTableCluster(distributeSpec, clusterSpecs)) case _ => None } - clickhouse.ClickHouseTable( + ClickHouseTable( nodeSpec, tableClusterSpec, _tz, diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCommandRunner.scala similarity index 93% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCommandRunner.scala index 285b5bad..ff486351 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseCommandRunner.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseCommandRunner.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark -import com.clickhouse.client.NodeClient +import com.clickhouse.spark.client.NodeClient import org.apache.spark.sql.connector.ExternalCommandRunner import org.apache.spark.sql.util.CaseInsensitiveStringMap diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseHelper.scala similarity index 98% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseHelper.scala index 11d2ccf4..f859b117 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseHelper.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseHelper.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark -import com.clickhouse.client.{ClickHouseProtocol, NodeClient} -import com.clickhouse.exception.CHException +import com.clickhouse.client.ClickHouseProtocol +import com.clickhouse.spark.exception.CHException import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.NullNode import org.apache.spark.sql.catalyst.analysis.{NoSuchNamespaceException, NoSuchTableException} @@ -24,8 +24,9 @@ import org.apache.spark.sql.connector.catalog.Identifier import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap import Constants._ +import com.clickhouse.spark.client.NodeClient import Utils.dateTimeFmt -import com.clickhouse.spec.{ +import com.clickhouse.spark.spec.{ ClusterSpec, DatabaseSpec, NoPartitionSpec, @@ -35,7 +36,7 @@ import com.clickhouse.spec.{ ShardSpec, TableSpec } -import com.clickhouse.spec._ +import com.clickhouse.spark.spec._ import java.time.{LocalDateTime, ZoneId} import java.util.{HashMap => JHashMap} diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseTable.scala similarity index 96% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseTable.scala index 66c43ac1..2dec715c 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/ClickHouseTable.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/ClickHouseTable.scala @@ -12,11 +12,11 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark -import com.clickhouse.client.NodeClient -import com.clickhouse.expr.{Expr, OrderExpr} -import com.clickhouse.func.FunctionRegistry +import com.clickhouse.spark.client.NodeClient +import com.clickhouse.spark.expr.{Expr, OrderExpr} +import com.clickhouse.spark.func.FunctionRegistry import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.{InternalRow, SQLConfHelper} import org.apache.spark.sql.clickhouse.ClickHouseSQLConf.{READ_DISTRIBUTED_CONVERT_LOCAL, USE_NULLABLE_QUERY_SCHEMA} @@ -31,8 +31,8 @@ import org.apache.spark.sql.types._ import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.apache.spark.unsafe.types.UTF8String import Utils._ -import com.clickhouse.read.{ClickHouseMetadataColumn, ClickHouseScanBuilder, ScanJobDescription} -import com.clickhouse.spec.{ +import com.clickhouse.spark.read.{ClickHouseMetadataColumn, ClickHouseScanBuilder, ScanJobDescription} +import com.clickhouse.spark.spec.{ ClusterSpec, DistributedEngineSpec, MergeTreeFamilyEngineSpec, @@ -42,8 +42,8 @@ import com.clickhouse.spec.{ TableEngineUtils, TableSpec } -import com.clickhouse.write.{ClickHouseWriteBuilder, WriteJobDescription} -import com.clickhouse.spec._ +import com.clickhouse.spark.write.{ClickHouseWriteBuilder, WriteJobDescription} +import com.clickhouse.spark.spec._ import java.lang.{Integer => JInt, Long => JLong} import java.time.{LocalDate, ZoneId} diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/CommitMessage.scala similarity index 96% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/CommitMessage.scala index 75a93f0b..c98f4c9d 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/CommitMessage.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/CommitMessage.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import org.apache.spark.sql.connector.write.WriterCommitMessage diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/Constants.scala similarity index 98% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/Constants.scala index 7facf6e7..e91b303a 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/Constants.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/Constants.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import com.clickhouse.client.config.ClickHouseClientOption._ diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/Metrics.scala similarity index 98% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/Metrics.scala index 22e61dce..e7b84f24 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/Metrics.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/Metrics.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import org.apache.spark.sql.connector.metric.{CustomMetric, CustomSumMetric, CustomTaskMetric} import Metrics._ diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/SQLHelper.scala similarity index 99% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/SQLHelper.scala index 44c1b56e..6531f5fa 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/SQLHelper.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/SQLHelper.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse +package com.clickhouse.spark import java.sql.{Date, Timestamp} import java.time.{Instant, LocalDate, LocalDateTime, ZoneId} diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/CityHash64.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/CityHash64.scala similarity index 93% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/CityHash64.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/CityHash64.scala index 6dd26a5c..5cd677d1 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/CityHash64.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/CityHash64.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func -import com.clickhouse.hash +import com.clickhouse.spark.hash // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L694 object CityHash64 extends MultiStringArgsHash { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/FunctionRegistry.scala similarity index 99% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/FunctionRegistry.scala index d43ae2ec..25263717 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/FunctionRegistry.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/FunctionRegistry.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func import org.apache.spark.sql.connector.catalog.functions.UnboundFunction diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MultiStringArgsHash.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MultiStringArgsHash.scala similarity index 98% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MultiStringArgsHash.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MultiStringArgsHash.scala index 4b212561..d68fb2ea 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MultiStringArgsHash.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MultiStringArgsHash.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFunction, UnboundFunction} diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash2.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MurmurHash2.scala similarity index 90% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash2.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MurmurHash2.scala index 39bd54dd..e6791e4e 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash2.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MurmurHash2.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func -import com.clickhouse.hash.{HashUtils, Murmurhash2_32, Murmurhash2_64} -import com.clickhouse.hash +import com.clickhouse.spark.hash.{HashUtils, Murmurhash2_32, Murmurhash2_64} +import com.clickhouse.spark.hash // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L460 object MurmurHash2_64 extends MultiStringArgsHash { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash3.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MurmurHash3.scala similarity index 90% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash3.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MurmurHash3.scala index d906379c..a9dc2ba9 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/func/MurmurHash3.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/MurmurHash3.scala @@ -12,10 +12,10 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func -import com.clickhouse.hash.{HashUtils, Murmurhash3_32, Murmurhash3_64} -import com.clickhouse.hash +import com.clickhouse.spark.hash.{HashUtils, Murmurhash3_32, Murmurhash3_64} +import com.clickhouse.spark.hash // https://github.com/ClickHouse/ClickHouse/blob/v23.5.3.24-stable/src/Functions/FunctionsHashing.h#L543 object MurmurHash3_64 extends MultiStringArgsHash { diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/XxHash64.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/XxHash64.scala similarity index 97% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/XxHash64.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/XxHash64.scala index 6c0b0593..7e2b5287 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/func/XxHash64.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/func/XxHash64.scala @@ -12,13 +12,13 @@ * limitations under the License. */ -package com.clickhouse.func +package com.clickhouse.spark.func +import com.clickhouse.spark.spec.{ClusterSpec, ShardUtils} import org.apache.spark.sql.catalyst.expressions.XxHash64Function import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFunction, UnboundFunction} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import com.clickhouse.spec.{ClusterSpec, ShardUtils} /** * ClickHouse equivalent function: diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseMetadataColumn.scala similarity index 98% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseMetadataColumn.scala index 6e95401e..9bc518e1 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseMetadataColumn.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseMetadataColumn.scala @@ -12,7 +12,7 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read import org.apache.spark.sql.connector.catalog.MetadataColumn import org.apache.spark.sql.types.{DataType, DoubleType, IntegerType, LongType, StringType, StructField} diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseRead.scala similarity index 94% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseRead.scala index cb31f7ca..d210fb0f 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseRead.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseRead.scala @@ -12,13 +12,13 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read -import com.clickhouse.client.NodeClient -import com.clickhouse.exception.CHClientException -import com.clickhouse.read.format.{ClickHouseBinaryReader, ClickHouseJsonReader} -import com.clickhouse.spec.{DistributedEngineSpec, NoPartitionSpec, TableEngineSpec} -import com.clickhouse.{BlocksReadMetric, BytesReadMetric, ClickHouseHelper, Logging, SQLHelper, Utils} +import com.clickhouse.spark.client.NodeClient +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.read.format.{ClickHouseBinaryReader, ClickHouseJsonReader} +import com.clickhouse.spark.spec.{DistributedEngineSpec, NoPartitionSpec, TableEngineSpec} +import com.clickhouse.spark.{BlocksReadMetric, BytesReadMetric, ClickHouseHelper, Logging, SQLHelper, Utils} import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ import org.apache.spark.sql.connector.expressions.{Expressions, NamedReference, Transform} @@ -28,8 +28,8 @@ import org.apache.spark.sql.connector.read._ import org.apache.spark.sql.connector.read.partitioning.{Partitioning, UnknownPartitioning} import org.apache.spark.sql.sources.{AlwaysTrue, Filter} import org.apache.spark.sql.types.StructType -import com.clickhouse._ -import com.clickhouse.spec._ +import com.clickhouse.spark._ +import com.clickhouse.spark.spec._ import java.time.ZoneId import scala.util.control.NonFatal diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseReader.scala similarity index 90% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseReader.scala index 6c5ec915..c19ddbaa 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ClickHouseReader.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ClickHouseReader.scala @@ -12,18 +12,19 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read -import com.clickhouse.{ClickHouseHelper, Logging, TaskMetric} -import com.clickhouse.client.{ClickHouseResponse, NodeClient, NodesClient} +import com.clickhouse.spark.{ClickHouseHelper, Logging, TaskMetric} +import com.clickhouse.spark.client.{NodeClient, NodesClient} import com.clickhouse.data.ClickHouseCompression -import com.clickhouse.format.StreamOutput +import com.clickhouse.spark.format.StreamOutput import org.apache.spark.sql.catalyst.{InternalRow, SQLConfHelper} import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ import org.apache.spark.sql.connector.metric.CustomTaskMetric import org.apache.spark.sql.connector.read.PartitionReader import org.apache.spark.sql.types._ -import com.clickhouse.Metrics.{BLOCKS_READ, BYTES_READ} +import com.clickhouse.spark.Metrics.{BLOCKS_READ, BYTES_READ} +import com.clickhouse.client.ClickHouseResponse abstract class ClickHouseReader[Record]( scanJob: ScanJobDescription, diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/InputPartitions.scala similarity index 92% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/InputPartitions.scala index e536e856..13ed9744 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/InputPartitions.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/InputPartitions.scala @@ -12,12 +12,12 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read -import com.clickhouse.spec.{NoPartitionSpec, NodeSpec, Nodes, PartitionSpec, TableSpec} +import com.clickhouse.spark.spec.{NoPartitionSpec, NodeSpec, Nodes, PartitionSpec, TableSpec} import org.apache.spark.sql.connector.read.InputPartition import org.apache.spark.sql.connector.read.partitioning.Partitioning -import com.clickhouse.spec._ +import com.clickhouse.spark.spec._ case class ClickHousePartitioning(inputParts: Array[ClickHouseInputPartition]) extends Partitioning { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ScanJobDescription.scala similarity index 91% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ScanJobDescription.scala index 4f580481..0b4c8bcb 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/ScanJobDescription.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/ScanJobDescription.scala @@ -12,12 +12,11 @@ * limitations under the License. */ -package com.clickhouse.read +package com.clickhouse.spark.read -import com.clickhouse.spec.{ClusterSpec, DistributedEngineSpec, NodeSpec, TableEngineSpec, TableSpec} +import com.clickhouse.spark.spec.{ClusterSpec, DistributedEngineSpec, NodeSpec, TableEngineSpec, TableSpec} import org.apache.spark.sql.clickhouse.ReadOptions import org.apache.spark.sql.types.StructType -import com.clickhouse.spec._ import java.time.ZoneId diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseBinaryReader.scala similarity index 94% rename from spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseBinaryReader.scala index bfa1c191..2d77b112 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseBinaryReader.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseBinaryReader.scala @@ -12,17 +12,17 @@ * limitations under the License. */ -package com.clickhouse.read.format +package com.clickhouse.spark.read.format import com.clickhouse.data.value.ClickHouseStringValue import com.clickhouse.data.{ClickHouseRecord, ClickHouseValue} +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, GenericArrayData} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import com.clickhouse.exception.CHClientException -import com.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import java.time.ZoneOffset import java.util.concurrent.TimeUnit diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseJsonReader.scala similarity index 92% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseJsonReader.scala index 864553c8..8c044ad4 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/read/format/ClickHouseJsonReader.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/read/format/ClickHouseJsonReader.scala @@ -12,18 +12,18 @@ * limitations under the License. */ -package com.clickhouse.read.format +package com.clickhouse.spark.read.format -import com.clickhouse.exception.CHClientException -import com.clickhouse.format.{JSONCompactEachRowWithNamesAndTypesStreamOutput, StreamOutput} -import com.clickhouse.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.format.{JSONCompactEachRowWithNamesAndTypesStreamOutput, StreamOutput} +import com.clickhouse.spark.read.{ClickHouseInputPartition, ClickHouseReader, ScanJobDescription} import com.fasterxml.jackson.databind.JsonNode import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.GenericInternalRow import org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, GenericArrayData} import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -import com.clickhouse.Utils.{dateFmt, dateTimeFmt} +import com.clickhouse.spark.Utils.{dateFmt, dateTimeFmt} import java.math.{MathContext, RoundingMode => RM} import java.time.{LocalDate, ZoneOffset, ZonedDateTime} diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWrite.scala similarity index 89% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWrite.scala index f9e70ffb..da4cc936 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWrite.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWrite.scala @@ -12,18 +12,18 @@ * limitations under the License. */ -package com.clickhouse.write +package com.clickhouse.spark.write -import com.clickhouse.{BytesWrittenMetric, RecordsWrittenMetric, SerializeTimeMetric, WriteTimeMetric} -import com.clickhouse.exception.CHClientException -import com.clickhouse.write.format.{ClickHouseArrowStreamWriter, ClickHouseJsonEachRowWriter} +import com.clickhouse.spark.{BytesWrittenMetric, RecordsWrittenMetric, SerializeTimeMetric, WriteTimeMetric} +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.write.format.{ClickHouseArrowStreamWriter, ClickHouseJsonEachRowWriter} import org.apache.spark.sql.catalyst.{InternalRow, SQLConfHelper} import org.apache.spark.sql.clickhouse.ClickHouseSQLConf._ import org.apache.spark.sql.connector.distributions.{Distribution, Distributions} import org.apache.spark.sql.connector.expressions.SortOrder import org.apache.spark.sql.connector.metric.CustomMetric import org.apache.spark.sql.connector.write._ -import com.clickhouse._ +import com.clickhouse.spark._ class ClickHouseWriteBuilder(writeJob: WriteJobDescription) extends WriteBuilder { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala similarity index 95% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala index 883be56c..6f9b267b 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/ClickHouseWriter.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala @@ -12,13 +12,13 @@ * limitations under the License. */ -package com.clickhouse.write +package com.clickhouse.spark.write -import com.clickhouse.{CommitMessage, Logging, TaskMetric, Utils} -import com.clickhouse.client.{ClickHouseProtocol, ClusterClient, NodeClient} +import com.clickhouse.spark.{CommitMessage, Logging, TaskMetric, Utils} +import com.clickhouse.client.ClickHouseProtocol import com.clickhouse.data.ClickHouseCompression -import com.clickhouse.exception.{CHClientException, RetryableCHException} -import com.clickhouse.spec.{DistributedEngineSpec, ShardUtils} +import com.clickhouse.spark.exception.{CHClientException, RetryableCHException} +import com.clickhouse.spark.spec.{DistributedEngineSpec, ShardUtils} import org.apache.commons.io.IOUtils import org.apache.spark.sql.catalyst.expressions.{BoundReference, Expression, TransformExpression} import org.apache.spark.sql.catalyst.expressions.{Projection, SafeProjection} @@ -27,10 +27,11 @@ import org.apache.spark.sql.clickhouse.ExprUtils import org.apache.spark.sql.connector.metric.CustomTaskMetric import org.apache.spark.sql.connector.write.{DataWriter, WriterCommitMessage} import org.apache.spark.sql.types._ -import com.clickhouse.Metrics._ -import com.clickhouse.io.{ForwardingOutputStream, ObservableOutputStream} -import com.clickhouse._ -import com.clickhouse.exception._ +import com.clickhouse.spark.Metrics._ +import com.clickhouse.spark.io.{ForwardingOutputStream, ObservableOutputStream} +import com.clickhouse.spark._ +import com.clickhouse.spark.client.{ClusterClient, NodeClient} +import com.clickhouse.spark.exception._ import java.io.{ByteArrayInputStream, ByteArrayOutputStream, OutputStream} import java.util.concurrent.atomic.LongAdder diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/WriteJobDescription.scala similarity index 90% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/WriteJobDescription.scala index 66511b6e..ca58eb89 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/WriteJobDescription.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/WriteJobDescription.scala @@ -12,17 +12,17 @@ * limitations under the License. */ -package com.clickhouse.write +package com.clickhouse.spark.write -import com.clickhouse.expr.{Expr, FuncExpr, OrderExpr} -import com.clickhouse.func.FunctionRegistry -import com.clickhouse.spec.{ClusterSpec, DistributedEngineSpec, NodeSpec, TableEngineSpec, TableSpec} +import com.clickhouse.spark.expr.{Expr, FuncExpr, OrderExpr} +import com.clickhouse.spark.func.FunctionRegistry +import com.clickhouse.spark.spec.{ClusterSpec, DistributedEngineSpec, NodeSpec, TableEngineSpec, TableSpec} import java.time.ZoneId import org.apache.spark.sql.clickhouse.{ExprUtils, WriteOptions} import org.apache.spark.sql.connector.expressions.{Expression, SortOrder, Transform} import org.apache.spark.sql.types.StructType -import com.clickhouse.spec._ +import com.clickhouse.spark.spec._ case class WriteJobDescription( queryId: String, diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseArrowStreamWriter.scala similarity index 94% rename from spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseArrowStreamWriter.scala index a97e7d89..b538c489 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseArrowStreamWriter.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseArrowStreamWriter.scala @@ -12,8 +12,9 @@ * limitations under the License. */ -package com.clickhouse.write.format +package com.clickhouse.spark.write.format +import com.clickhouse.spark.write.{ClickHouseWriter, WriteJobDescription} import org.apache.arrow.memory.BufferAllocator import org.apache.arrow.vector.VectorSchemaRoot import org.apache.arrow.vector.ipc.ArrowStreamWriter @@ -21,7 +22,6 @@ import org.apache.arrow.vector.types.pojo.Schema import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.SparkUtils import org.apache.spark.sql.execution.arrow.ArrowWriter -import com.clickhouse.write.{ClickHouseWriter, WriteJobDescription} class ClickHouseArrowStreamWriter(writeJob: WriteJobDescription) extends ClickHouseWriter(writeJob) { diff --git a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseJsonEachRowWriter.scala similarity index 91% rename from spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala rename to spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseJsonEachRowWriter.scala index e576d95c..756c7d87 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/write/format/ClickHouseJsonEachRowWriter.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/format/ClickHouseJsonEachRowWriter.scala @@ -12,9 +12,9 @@ * limitations under the License. */ -package com.clickhouse.write.format +package com.clickhouse.spark.write.format -import com.clickhouse.write.{ClickHouseWriter, WriteJobDescription} +import com.clickhouse.spark.write.{ClickHouseWriter, WriteJobDescription} import org.apache.commons.io.IOUtils import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.clickhouse.JsonWriter diff --git a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala index c041ee7b..ce5c28d3 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ClickHouseSQLConf.scala @@ -16,7 +16,7 @@ package org.apache.spark.sql.clickhouse import org.apache.spark.internal.config.ConfigEntry import org.apache.spark.sql.internal.SQLConf._ -import com.clickhouse.exception.ClickHouseErrCode._ +import com.clickhouse.spark.exception.ClickHouseErrCode._ import java.util.concurrent.TimeUnit diff --git a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala index 6140d180..b59f9f5a 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/ExprUtils.scala @@ -14,10 +14,10 @@ package org.apache.spark.sql.clickhouse -import com.clickhouse.exception.CHClientException -import com.clickhouse.expr.{Expr, FieldRef, FuncExpr, OrderExpr, SQLExpr, StringLiteral} -import com.clickhouse.func.FunctionRegistry -import com.clickhouse.spec.ClusterSpec +import com.clickhouse.spark.exception.CHClientException +import com.clickhouse.spark.expr.{Expr, FieldRef, FuncExpr, OrderExpr, SQLExpr, StringLiteral} +import com.clickhouse.spark.func.FunctionRegistry +import com.clickhouse.spark.spec.ClusterSpec import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.catalyst.analysis.{AnsiTypeCoercion, NoSuchFunctionException, TypeCoercion} import org.apache.spark.sql.catalyst.expressions.{Attribute, BoundReference, Expression, ListQuery, Literal} @@ -32,7 +32,7 @@ import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFu import org.apache.spark.sql.connector.expressions.Expressions._ import org.apache.spark.sql.connector.expressions.{Expression => V2Expression, SortOrder => V2SortOrder, _} import org.apache.spark.sql.types.{StructField, StructType} -import com.clickhouse.expr._ +import com.clickhouse.spark.expr._ import scala.util.{Failure, Success, Try} diff --git a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala index 055b7fa3..7b43ee33 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/org/apache/spark/sql/clickhouse/SchemaUtils.scala @@ -16,7 +16,7 @@ package org.apache.spark.sql.clickhouse import com.clickhouse.data.ClickHouseDataType._ import com.clickhouse.data.{ClickHouseColumn, ClickHouseDataType} -import com.clickhouse.exception.CHClientException +import com.clickhouse.spark.exception.CHClientException import org.apache.spark.sql.types._ import org.apache.spark.sql.catalyst.SQLConfHelper import org.apache.spark.sql.clickhouse.ClickHouseSQLConf.READ_FIXED_STRING_AS diff --git a/spark-3.5/clickhouse-spark/src/test/resources/log4j2.xml b/spark-3.5/clickhouse-spark/src/test/resources/log4j2.xml index 31e7b6a1..3e2579f1 100644 --- a/spark-3.5/clickhouse-spark/src/test/resources/log4j2.xml +++ b/spark-3.5/clickhouse-spark/src/test/resources/log4j2.xml @@ -31,7 +31,7 @@ - + diff --git a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala index 2f012921..063b500a 100644 --- a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala +++ b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ClickHouseHelperSuite.scala @@ -14,7 +14,7 @@ package org.apache.spark.sql.clickhouse -import com.clickhouse.ClickHouseHelper +import com.clickhouse.spark.ClickHouseHelper import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.scalatest.funsuite.AnyFunSuite diff --git a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala index 20bdf128..c5119c40 100644 --- a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala +++ b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/ConfigurationSuite.scala @@ -14,7 +14,7 @@ package org.apache.spark.sql.clickhouse -import com.clickhouse.Utils +import com.clickhouse.spark.Utils import org.apache.spark.internal.config.ConfigEntry import org.apache.spark.sql.internal.SQLConf import org.scalatest.funsuite.AnyFunSuite diff --git a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala index 8168f34c..df82a95d 100644 --- a/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala +++ b/spark-3.5/clickhouse-spark/src/test/scala/org/apache/spark/sql/clickhouse/FunctionRegistrySuite.scala @@ -14,7 +14,7 @@ package org.apache.spark.sql.clickhouse -import com.clickhouse.func.{ +import com.clickhouse.spark.func.{ ClickHouseXxHash64, ClickhouseEquivFunction, CompositeFunctionRegistry, @@ -22,7 +22,7 @@ import com.clickhouse.func.{ StaticFunctionRegistry } import org.scalatest.funsuite.AnyFunSuite -import com.clickhouse.func._ +import com.clickhouse.spark.func._ class FunctionRegistrySuite extends AnyFunSuite {