Skip to content

Commit

Permalink
[CH] Support bit_get/bit_count function
Browse files Browse the repository at this point in the history
  • Loading branch information
exmy committed Jun 27, 2024
1 parent 3a42e8f commit 2f899f2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,13 @@ class GlutenClickHouseTPCHSaltNullParquetSuite extends GlutenClickHouseTPCHAbstr
}
}

test("bit_get/bit_count") {
runQueryAndCompare(
"select bit_count(id), bit_get(id, 0), bit_get(id, 1), bit_get(id, 2), bit_get(id, 3) from range(100)") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
}

test("test 'EqualNullSafe'") {
runQueryAndCompare("select l_linenumber <=> l_orderkey, l_linenumber <=> null from lineitem") {
checkGlutenOperatorMatch[ProjectExecTransformer]
Expand Down
2 changes: 2 additions & 0 deletions cpp-ch/local-engine/Parser/SerializedPlanParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ static const std::map<std::string, std::string> SCALAR_FUNCTIONS
{"bitwise_and", "bitAnd"},
{"bitwise_or", "bitOr"},
{"bitwise_xor", "bitXor"},
{"bit_get", "bitTest"},
{"bit_count", "bitCount"},
{"sqrt", "sqrt"},
{"cbrt", "cbrt"},
{"degrees", "degrees"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ class ClickHouseTestSettings extends BackendTestSettings {
.exclude("SPARK-28322: IntegralDivide supports decimal type")
.exclude("SPARK-33008: division by zero on divide-like operations returns incorrect result")
.exclude("SPARK-34920: error class")
enableSuite[GlutenBitwiseExpressionsSuite].exclude("BitGet")
enableSuite[GlutenBitwiseExpressionsSuite]
enableSuite[GlutenCastSuite]
.exclude("null cast")
.exclude("cast string to date")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ class ClickHouseTestSettings extends BackendTestSettings {
.exclude("SPARK-36920: Support day-time intervals by ABS")
.exclude("SPARK-36921: Support YearMonthIntervalType by div")
.exclude("SPARK-36921: Support DayTimeIntervalType by div")
enableSuite[GlutenBitwiseExpressionsSuite].exclude("BitGet")
enableSuite[GlutenBitwiseExpressionsSuite]
enableSuite[GlutenCastSuite]
.exclude("null cast")
.exclude("cast string to date")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ class ClickHouseTestSettings extends BackendTestSettings {
.exclude("SPARK-36920: Support day-time intervals by ABS")
.exclude("SPARK-36921: Support YearMonthIntervalType by div")
.exclude("SPARK-36921: Support DayTimeIntervalType by div")
enableSuite[GlutenBitwiseExpressionsSuite].exclude("BitGet")
enableSuite[GlutenBitwiseExpressionsSuite]
enableSuite[GlutenCastSuite]
.exclude("null cast")
.exclude("cast string to date")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ class ClickHouseTestSettings extends BackendTestSettings {
.exclude("SPARK-36920: Support day-time intervals by ABS")
.exclude("SPARK-36921: Support YearMonthIntervalType by div")
.exclude("SPARK-36921: Support DayTimeIntervalType by div")
enableSuite[GlutenBitwiseExpressionsSuite].exclude("BitGet")
enableSuite[GlutenBitwiseExpressionsSuite]
enableSuite[GlutenCastSuite]
.exclude("null cast")
.exclude("cast string to date")
Expand Down

0 comments on commit 2f899f2

Please sign in to comment.