Copilot commented on code in PR #58224:
URL: https://github.com/apache/doris/pull/58224#discussion_r2552591250


##########
fe/be-java-extensions/avro-scanner/src/main/java/org/apache/doris/avro/AvroJNIScanner.java:
##########
@@ -193,14 +195,36 @@ public void close() throws IOException {
         }
     }
 
-    @Override
-    protected int getNext() throws IOException {
-        int numRows = 0;
-        for (; numRows < getBatchSize(); numRows++) {
+    private List<GenericRecord> readNextBatch() throws IOException {
+        List<GenericRecord> records = new ArrayList<>();
+
+        for (int numRows = 0; numRows < getBatchSize(); numRows++) {
             if (!avroReader.hasNext(inputPair, ignore)) {
                 break;
             }
             GenericRecord rowRecord = (GenericRecord) avroReader.getNext();
+            records.add(rowRecord);
+
+            // for (int i = 0; i < requiredFields.length; i++) {
+            //     Object fieldData = rowRecord.get(requiredFields[i]);
+            //     if (fieldData == null) {
+            //         appendData(i, null);
+            //     } else {
+            //         AvroColumnValue fieldValue = new 
AvroColumnValue(fieldInspectors[i], fieldData);
+            //         appendData(i, fieldValue);
+            //     }
+            // }

Review Comment:
   Remove commented-out code. This code block appears to be old implementation 
that has been replaced by the refactored version in the `getNext()` method. 
Commented code should be removed rather than left in the codebase.
   ```suggestion
   
   ```



##########
fe/be-java-extensions/hadoop-hudi-scanner/src/main/java/org/apache/doris/hudi/HadoopHudiJniScanner.java:
##########
@@ -166,13 +167,24 @@ public int getNext() throws IOException {
             return preExecutionAuthenticator.execute(() -> {
                 NullWritable key = reader.createKey();
                 ArrayWritable value = reader.createValue();
+                List<Object> records = new ArrayList<>();
                 int numRows = 0;

Review Comment:
   [nitpick] The `records` list is created but remains empty when 
`fields.length == 0` (virtual table case). While this doesn't cause incorrect 
behavior, it's inefficient to create an unused list. Consider moving the list 
creation inside the `if (fields.length > 0)` block to avoid unnecessary 
allocation.
   ```suggestion
                   int numRows = 0;
                   List<Object> records = null;
                   if (fields.length > 0) {
                       records = new ArrayList<>();
                   }
   ```



##########
fe/be-java-extensions/paimon-scanner/src/main/java/org/apache/doris/paimon/PaimonSysTableJniScanner.java:
##########
@@ -159,21 +160,15 @@ private void resetDatetimeV2Precision() {
         }
     }
 
-    private int readAndProcessNextBatch() throws IOException {
-        int rows = 0;
+    private List<InternalRow> readNextBatch() throws IOException {
+        List<InternalRow> records = new ArrayList<>();
+        // int rows = 0;

Review Comment:
   Remove commented-out code. The comment `// int rows = 0;` serves no purpose 
and should be deleted.
   ```suggestion
   
   ```



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

Reply via email to