This is an automated email from the ASF dual-hosted git repository.
liuneng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
The following commit(s) were added to refs/heads/main by this push:
new f653ce7a6 [GLUTEN-4914][CH][FOLLOWUP] Fix exceptions in ASTParser
(#5518)
f653ce7a6 is described below
commit f653ce7a6a351f58a1cfbf414e786068fb420955
Author: exmy <[email protected]>
AuthorDate: Thu Apr 25 15:07:02 2024 +0800
[GLUTEN-4914][CH][FOLLOWUP] Fix exceptions in ASTParser (#5518)
What changes were proposed in this pull request?
(Fixes: #4914)
func_parser->getCHFunctionName() still gets function name from
SCALAR_FUNCTIONS and will parse error when get function implemented by
FunctionParser.
How was this patch tested?
Add UT
---
.../GlutenClickHouseTPCHSaltNullParquetSuite.scala | 16 +++++++++++++++-
cpp-ch/local-engine/Parser/SerializedPlanParser.cpp | 2 +-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git
a/backends-clickhouse/src/test/scala/org/apache/gluten/execution/GlutenClickHouseTPCHSaltNullParquetSuite.scala
b/backends-clickhouse/src/test/scala/org/apache/gluten/execution/GlutenClickHouseTPCHSaltNullParquetSuite.scala
index 615cceae9..cc2eebcab 100644
---
a/backends-clickhouse/src/test/scala/org/apache/gluten/execution/GlutenClickHouseTPCHSaltNullParquetSuite.scala
+++
b/backends-clickhouse/src/test/scala/org/apache/gluten/execution/GlutenClickHouseTPCHSaltNullParquetSuite.scala
@@ -49,7 +49,8 @@ class GlutenClickHouseTPCHSaltNullParquetSuite extends
GlutenClickHouseTPCHAbstr
.set("spark.sql.shuffle.partitions", "5")
.set("spark.sql.autoBroadcastJoinThreshold", "10MB")
.set("spark.gluten.supported.scala.udfs", "my_add")
- // .set("spark.sql.planChangeLog.level", "error")
+//
.set("spark.gluten.sql.columnar.backend.ch.runtime_config.logger.level",
"trace")
+// .set("spark.sql.planChangeLog.level", "error")
}
override protected val createNullableTables = true
@@ -2316,6 +2317,19 @@ class GlutenClickHouseTPCHSaltNullParquetSuite extends
GlutenClickHouseTPCHAbstr
}
}
+ test("GLUTEN-4914: Fix exceptions in ASTParser") {
+ val sql =
+ """
+ |select t1.l_orderkey, t1.l_partkey, t1.l_shipdate, t2.o_custkey from (
+ |select l_orderkey, l_partkey, l_shipdate from lineitem where
l_orderkey < 1000 ) t1
+ |join (
+ | select o_orderkey, o_custkey, o_orderdate from orders where
o_orderkey < 1000
+ |) t2 on t1.l_orderkey = t2.o_orderkey
+ |and unix_timestamp(t1.l_shipdate, 'yyyy-MM-dd') <
unix_timestamp(t2.o_orderdate, 'yyyy-MM-dd')
+ |""".stripMargin
+ compareResultsAgainstVanillaSpark(sql, true, { _ => })
+ }
+
test("GLUTEN-3467: Fix 'Names of tuple elements must be unique' error for ch
backend") {
val sql =
"""
diff --git a/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp
b/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp
index 4c7f4c775..aa7b95d67 100644
--- a/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp
+++ b/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp
@@ -1903,7 +1903,7 @@ ASTPtr ASTParser::parseToAST(const Names & names, const
substrait::Expression &
auto substrait_name = function_signature.substr(0,
function_signature.find(':'));
auto func_parser =
FunctionParserFactory::instance().tryGet(substrait_name, plan_parser);
- String function_name = func_parser ?
func_parser->getCHFunctionName(scalar_function)
+ String function_name = func_parser ? func_parser->getName()
:
SerializedPlanParser::getFunctionName(function_signature, scalar_function);
ASTs ast_args;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]