mihaibudiu commented on code in PR #4953:
URL: https://github.com/apache/calcite/pull/4953#discussion_r3283087240
##########
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 (containsListField(fields)) {
Review Comment:
I don't know what this projector is doing, can you explain what is going on
here?
##########
arrow/src/test/java/org/apache/calcite/adapter/arrow/ArrowDataTest.java:
##########
@@ -329,6 +342,26 @@ public void writeArrowDataType(File file) throws
IOException {
fileOutputStream.close();
}
+
+ public void writeArrowListData(File file) throws IOException {
+ FileOutputStream fileOutputStream = new FileOutputStream(file);
+ Schema arrowSchema = makeArrowListSchema();
+ VectorSchemaRoot vectorSchemaRoot =
+ VectorSchemaRoot.create(arrowSchema, new
RootAllocator(Integer.MAX_VALUE));
+ ArrowFileWriter arrowFileWriter =
+ new ArrowFileWriter(vectorSchemaRoot, null,
fileOutputStream.getChannel());
+
+ arrowFileWriter.start();
+ int rowCount = 3;
+ vectorSchemaRoot.setRowCount(rowCount);
+ listField(vectorSchemaRoot.getVector("intListField"), rowCount);
+ arrowFileWriter.writeBatch();
+ arrowFileWriter.end();
+ arrowFileWriter.close();
+ fileOutputStream.flush();
+ fileOutputStream.close();
Review Comment:
would using try with resources work here?
--
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]