From 7f2e54c2e74c8f9539c7cf72591ee20b4e38e822 Mon Sep 17 00:00:00 2001 From: "wangguangxin.cn" Date: Fri, 3 Jan 2025 15:21:47 +0800 Subject: [PATCH] support null type in hashagg --- .../org/apache/gluten/execution/MiscOperatorSuite.scala | 6 ++++++ cpp/velox/substrait/VeloxSubstraitSignature.cc | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala b/backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala index 42e3e0bcc77a..107d096e7851 100644 --- a/backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala +++ b/backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala @@ -1985,4 +1985,10 @@ class MiscOperatorSuite extends VeloxWholeStageTransformerSuite with AdaptiveSpa } } } + + test("support null type in aggregate") { + runQueryAndCompare("SELECT max(null), min(null) from range(10)".stripMargin) { + checkGlutenOperatorMatch[HashAggregateExecTransformer] + } + } } diff --git a/cpp/velox/substrait/VeloxSubstraitSignature.cc b/cpp/velox/substrait/VeloxSubstraitSignature.cc index e1f716ae2088..a68870f653ab 100644 --- a/cpp/velox/substrait/VeloxSubstraitSignature.cc +++ b/cpp/velox/substrait/VeloxSubstraitSignature.cc @@ -159,6 +159,10 @@ TypePtr VeloxSubstraitSignature::fromSubstraitSignature(const std::string& signa return DATE(); } + if (signature == "nothing") { + return UNKNOWN(); + } + auto startWith = [](const std::string& str, const std::string& prefix) { return str.size() >= prefix.size() && str.substr(0, prefix.size()) == prefix; };