yaooqinn commented on code in PR #13825:
URL: https://github.com/apache/gluten/pull/13825#discussion_r4780256316
##########
cpp/velox/tests/SubstraitVeloxExprConverterTest.cc:
##########
@@ -31,6 +31,23 @@ namespace gluten {
class SubstraitVeloxExprConverterExecutionTest : public
exec::test::OperatorTestBase {};
+TEST(SubstraitVeloxExprConverterTest, emptyStructLiteral) {
+ memory::MemoryManager::testingSetInstance({});
+ auto pool = memory::memoryManager()->addLeafPool();
+ const std::unordered_map<uint64_t, std::string> functionMap;
+ SubstraitVeloxExprConverter converter(pool.get(), functionMap);
+ ::substrait::Expression expression;
+ expression.mutable_literal()->mutable_struct_();
+
+ auto result =
+ std::dynamic_pointer_cast<const
core::ConstantTypedExpr>(converter.toVeloxExpr(expression, ROW({}, {})));
+ ASSERT_NE(result, nullptr);
+ EXPECT_TRUE(result->type()->equivalent(*ROW({}, {})));
+ ASSERT_TRUE(result->hasValueVector());
+ ASSERT_EQ(result->valueVector()->size(), 1);
Review Comment:
Thanks, 2364e0c1 covers it: the struct test now checks the wrapped row
vector, and `arrayOfEmptyStructLiterals` checks the list literal keeps both
rows, which is the converter path behind the wrong result. Fine with that in
place of the SQL test. LGTM once the fork CI has run on this head (there is no
run in your fork for 2364e0c1 yet).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]