caicancai commented on code in PR #4957:
URL: https://github.com/apache/calcite/pull/4957#discussion_r3353166555


##########
arrow/src/main/java/org/apache/calcite/adapter/arrow/ArrowTable.java:
##########
@@ -122,16 +122,20 @@ public Enumerable<Object> query(DataContext root, 
ImmutableIntList fields,
     if (conditions.isEmpty()) {
       filter = null;
 
-      final List<ExpressionTree> expressionTrees = new ArrayList<>();
-      for (int fieldOrdinal : fields) {
-        Field field = schema.getFields().get(fieldOrdinal);
-        TreeNode node = TreeBuilder.makeField(field);
-        expressionTrees.add(TreeBuilder.makeExpression(node, field));
-      }
-      try {
-        projector = Projector.make(schema, expressionTrees);
-      } catch (GandivaException e) {
-        throw Util.toUnchecked(e);
+      if (containsGandivaUnsupportedField(fields)) {
+        projector = null;

Review Comment:
   It is intentional here. When there is no filter and the selected fields need 
direct vector projection, `projector` is left null and `ArrowEnumerable` falls 
back to `ArrowDirectEnumerator`.
   
   So the cases are now:
   - projector: Gandiva projection
   - filter: Gandiva filter
   - neither: direct vector projection
   
   I renamed the helper and added comments to make this contract explicit.



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

Reply via email to