Skip to content

Commit

Permalink
mereg Cloud Tesst with main
Browse files Browse the repository at this point in the history
  • Loading branch information
mzitnik committed Jul 22, 2024
2 parents 7ddd2ec + 5779763 commit d292c51
Show file tree
Hide file tree
Showing 167 changed files with 516 additions and 428 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
strategy:
fail-fast: false
matrix:
clickhouse: [ 23.8, 24.3, 24.4, 24.5, cloud]
clickhouse: [ 22.3, 22.8, 23.3, 23.8, 24.3, 24.6, 24.4, 24.5, cloud ]
env:
CLICKHOUSE_IMAGE: clickhouse/clickhouse-server:${{ matrix.clickhouse }}
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Notes:

| Version | Compatible Spark Versions | ClickHouse JDBC version |
|---------|---------------------------|-------------------------|
| main | Spark 3.3, 3.4, 3.5 | 0.6.0 |
| main | Spark 3.3, 3.4, 3.5 | 0.6.3 |
| 0.7.3 | Spark 3.3, 3.4 | 0.4.6 |
| 0.6.0 | Spark 3.3 | 0.3.2-patch11 |
| 0.5.0 | Spark 3.2, 3.3 | 0.3.2-patch11 |
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ plugins {
id "com.diffplug.spotless" version "6.12.1" apply false
id "org.nosphere.apache.rat" version "0.8.1"
id "com.github.maiflai.scalatest" version "0.32" apply false
id "com.github.johnrengelman.shadow" version "7.1.2" apply false
id "com.github.johnrengelman.shadow" version "8.1.1" apply false
}

project.ext {
Expand Down Expand Up @@ -164,7 +164,7 @@ project(':clickhouse-core') {

generateGrammarSource {
maxHeapSize = "64m"
arguments += ["-visitor", "-package", "xenon.clickhouse"]
arguments += ["-visitor", "-package", "com.clickhouse.spark"]
}

test {
Expand Down
2 changes: 1 addition & 1 deletion clickhouse-core-it/src/test/resources/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.spark=DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
* limitations under the License.
*/

package xenon.clickhouse
package com.clickhouse.spark

import xenon.clickhouse.base.ClickHouseSingleMixIn
import xenon.clickhouse.client.NodeClient
import xenon.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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
* limitations under the License.
*/

package xenon.clickhouse

import xenon.clickhouse.base.ClickHouseSingleMixIn
package com.clickhouse.spark

import com.clickhouse.spark.base.ClickHouseSingleMixIn
import java.time.{LocalDateTime, ZoneId}

class UtilsClickHouseSuite extends ClickHouseSingleMixIn with Logging {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse.exception;
package com.clickhouse.spark.exception;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse
package com.clickhouse.spark

import com.fasterxml.jackson.databind.{DeserializationFeature, ObjectMapper, SerializationFeature}
import com.fasterxml.jackson.module.scala.ClassTagExtensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse
package com.clickhouse.spark

import org.slf4j.{Logger, LoggerFactory}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse
package com.clickhouse.spark

import org.apache.commons.lang3.time.FastDateFormat

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
* limitations under the License.
*/

package xenon.clickhouse.client
package com.clickhouse.spark.client

import xenon.clickhouse.Logging
import xenon.clickhouse.exception.CHClientException
import xenon.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._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@
* limitations under the License.
*/

package xenon.clickhouse.client
package com.clickhouse.spark.client

import com.clickhouse.spark.Logging
import com.clickhouse.client._
import com.clickhouse.client.config.ClickHouseClientOption
import com.clickhouse.data.{ClickHouseCompression, ClickHouseFormat}
import com.clickhouse.spark.exception.{CHClientException, CHException, CHServerException}
import com.clickhouse.spark.format.{
JSONCompactEachRowWithNamesAndTypesSimpleOutput,
JSONEachRowSimpleOutput,
NamesAndTypes,
SimpleOutput
}
import com.clickhouse.spark.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.spark.format._

import java.io.InputStream
import java.util.UUID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
* limitations under the License.
*/

package xenon.clickhouse.client
package com.clickhouse.spark.client

import java.util.concurrent.ConcurrentHashMap
import com.clickhouse.spark.Logging
import com.clickhouse.spark.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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* limitations under the License.
*/

package xenon.clickhouse.exception
package com.clickhouse.spark.exception

import xenon.clickhouse.spec.NodeSpec
import com.clickhouse.spark.spec.NodeSpec

abstract class CHException(
val code: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse.expr
package com.clickhouse.spark.expr

trait Expr extends Serializable {
def sql: String // ClickHouse dialect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
* limitations under the License.
*/

package xenon.clickhouse.format
package com.clickhouse.spark.format

trait InputFormat
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
* limitations under the License.
*/

package xenon.clickhouse.format
package com.clickhouse.spark.format

import com.clickhouse.spark.exception.CHClientException
import java.io.InputStream

import scala.collection.immutable.ListMap
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.spark.JsonProtocol.om

///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////// Simple ////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse.format
package com.clickhouse.spark.format

import scala.collection.immutable.ListMap

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* limitations under the License.
*/

package xenon.clickhouse.hash
package com.clickhouse.spark.hash

import xenon.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] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse.hash
package com.clickhouse.spark.hash

import java.nio.charset.StandardCharsets
import scala.reflect.ClassTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse.hash
package com.clickhouse.spark.hash

object HashUtils {
def intHash64Impl(x: Long): Long =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse.hash
package com.clickhouse.spark.hash

import org.apache.commons.codec.digest.MurmurHash2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse.hash
package com.clickhouse.spark.hash

import org.apache.commons.codec.digest.MurmurHash2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse.hash
package com.clickhouse.spark.hash

import org.apache.commons.codec.digest.MurmurHash3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse.hash
package com.clickhouse.spark.hash

import org.apache.commons.codec.digest.MurmurHash3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse.io
package com.clickhouse.spark.io

import java.io.OutputStream

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package xenon.clickhouse.io
package com.clickhouse.spark.io

import java.io.Writer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
* limitations under the License.
*/

package xenon.clickhouse.io

import xenon.clickhouse.Utils
package com.clickhouse.spark.io

import com.clickhouse.spark.Utils
import java.io.OutputStream
import java.util.concurrent.atomic.LongAdder

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,42 @@
* limitations under the License.
*/

package xenon.clickhouse.parse
package com.clickhouse.spark.parse

import scala.collection.JavaConverters._
import com.clickhouse.spark.ClickHouseSQLParser.{
ColumnExprContext,
ColumnExprFunctionContext,
ColumnExprIdentifierContext,
ColumnExprListContext,
ColumnExprLiteralContext,
ColumnExprParensContext,
ColumnExprPrecedence1Context,
ColumnExprPrecedence2Context,
ColumnExprTupleContext,
ColumnsExprColumnContext,
ColumnsExprContext,
EngineClauseContext,
OrderByClauseContext,
OrderExprContext,
SettingsClauseContext
}
import com.clickhouse.spark.expr.{Expr, FieldRef, FuncExpr, OrderExpr, StringLiteral, TupleExpr}
import com.clickhouse.spark.spec.{
DistributedEngineSpec,
MergeTreeEngineSpec,
ReplacingMergeTreeEngineSpec,
ReplicatedMergeTreeEngineSpec,
ReplicatedReplacingMergeTreeEngineSpec,
TableEngineSpec,
UnknownTableEngineSpec
}
import com.clickhouse.spark.{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.spark.expr._
import com.clickhouse.spark.spec._
import com.clickhouse.spark.ClickHouseSQLParser._

class AstVisitor extends ClickHouseSQLBaseVisitor[AnyRef] with Logging {
import ParseUtils._
Expand Down
Loading

0 comments on commit d292c51

Please sign in to comment.