taiyang-li commented on code in PR #8256:
URL: https://github.com/apache/incubator-gluten/pull/8256#discussion_r1893373532


##########
cpp-ch/local-engine/Parser/ExpressionParser.cpp:
##########
@@ -433,8 +432,31 @@ const ActionsDAG::Node * 
ExpressionParser::parseExpression(ActionsDAG & actions_
                         "SingularOrList options type mismatch:{} and {}",
                         elem_type->getName(),
                         option_type->getName());
+                options_type_and_field.emplace_back(type_and_field);
+            }
 
-                elem_column->insert(type_and_field.second);
+            // check tuple internal types
+            if (isTuple(elem_type) && isTuple(args[0]->result_type))
+            {
+                // align tuple inner types with nullable
+                auto tuple_type = std::static_pointer_cast<const 
DB::DataTypeTuple>(elem_type);
+                auto result_type = std::static_pointer_cast<const 
DB::DataTypeTuple>(args[0]->result_type);
+                assert(tuple_type->getElements().size() == 
result_type->getElements().size());
+                DataTypes new_types;
+                for (int i = 0; i < tuple_type->getElements().size(); ++i)

Review Comment:
   better to refactor it with `castColumn`. You could delete dozens of codes 
after refactor.
   1. Given the type of first argument in `in` expression
   2. Given the column of second argument in `in` expression
   3. Cast the column of second argument to the type of first argument. 
   



-- 
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]

Reply via email to