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


##########
arrow/src/test/java/org/apache/calcite/adapter/arrow/ArrowData.java:
##########
@@ -174,6 +196,53 @@ public void writeArrowData(File file) throws IOException {
     fileOutputStream.close();
   }
 
+  private void populateTypeMetaDataVector(FieldVector vector, int numRows) {
+    switch (vector.getMinorType()) {
+    case TINYINT:
+      byteField(vector, numRows);

Review Comment:
   done



##########
arrow/src/test/java/org/apache/calcite/adapter/arrow/ArrowData.java:
##########
@@ -174,6 +196,53 @@ public void writeArrowData(File file) throws IOException {
     fileOutputStream.close();
   }
 
+  private void populateTypeMetaDataVector(FieldVector vector, int numRows) {
+    switch (vector.getMinorType()) {
+    case TINYINT:
+      byteField(vector, numRows);
+      break;
+    case SMALLINT:
+      smallIntFiled(vector, numRows);
+      break;
+    case INT:
+      intField(vector, numRows);
+      break;
+    case FLOAT4:
+      floatField(vector, numRows);
+      break;
+    case VARCHAR:
+      varCharField(vector, numRows);
+      break;
+    case BIGINT:
+      longField(vector, numRows);
+      break;
+    default:
+      throw new IllegalStateException("Not supported type yet: " + 
vector.getMinorType());
+    }
+  }
+
+  private void byteField(FieldVector fieldVector, int rowCount) {
+    TinyIntVector tinyIntVector = (TinyIntVector) fieldVector;
+    tinyIntVector.setInitialCapacity(rowCount);
+    tinyIntVector.allocateNew();
+    for (int i = 0; i < rowCount; i++) {
+      tinyIntVector.set(i, this.byteValue);
+      this.byteValue++;
+    }
+    fieldVector.setValueCount(rowCount);
+  }
+
+  private void smallIntFiled(FieldVector fieldVector, int rowCount) {
+    SmallIntVector shortVector = (SmallIntVector) fieldVector;

Review Comment:
   done



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