taiyang-li commented on code in PR #4829:
URL: https://github.com/apache/incubator-gluten/pull/4829#discussion_r1529964940
##########
cpp-ch/local-engine/Parser/SerializedPlanParser.cpp:
##########
@@ -313,12 +314,17 @@ QueryPlanStepPtr
SerializedPlanParser::parseReadRealWithJavaIter(const substrait
auto iter = rel.local_files().items().at(0).uri_file();
auto pos = iter.find(':');
auto iter_index = std::stoi(iter.substr(pos + 1, iter.size()));
+ jobject input_iter = input_iters[iter_index];
+ bool materialize_input = materialize_inputs[iter_index];
+
+ GET_JNIENV(env)
+ SCOPE_EXIT({CLEAN_JNIENV});
+ auto * first_block = SourceFromJavaIter::peekBlock(env, input_iter);
+
+ /// Try to decide header from the first block read from Java iterator.
Thus AggregateFunction with parameters has more precise types.
+ auto header = first_block ? first_block->cloneEmpty() :
TypeParser::buildBlockFromNamedStruct(rel.base_schema());
Review Comment:
@lgbo-ustc could you please review those changes? First block read from
input iterator was treated as source header to make sure we get precise data
types, especially for `AggregateFunction` with parameters.
--
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]