shfshihuafeng commented on code in PR #2567:
URL: https://github.com/apache/drill/pull/2567#discussion_r3781868274
##########
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java:
##########
@@ -274,8 +338,10 @@ private void setValueCount(int count) {
for (ComplexWriter writer : complexWriters) {
writer.setValueCount(count);
}
- } else if (rsLoader != null) {
- rsLoader.setTargetRowCount(count);
+ } else if (!CollectionUtils.isEmpty(rsLoaders)) {
+ for (ResultSetLoader loader : rsLoaders) {
+ loader.setTargetRowCount(count);
Review Comment:
In my opinion, Multi-row queries don't change the branch logic here. Whether
complexWriters is null is decided at setup time (by addComplexField() →
initComplexWriters()), not per-batch.
Are you referring to a multi‑row scenario like following example? Query
reads 10,000 rows from test_multirow.json
and, for each row, concatenates id and name into a JSON string, then
converts it with convert_fromJSON. Does that match what you meant by "multi‑row
queries"?
```
{"id":6,"name":"user_6","value":60}
apache drill> SELECT
2..semicolon> convert_fromJSON(CONCAT('{"nested_id":', CAST(id AS
VARCHAR), ',"orig_name":"', name, '"}')) AS js
3..semicolon> FROM
4..semicolon> dfs.test.`test_multirow.json`;
```
--
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]