Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/14322
  
    **After the PR changes**, the whole-stage codegen output is like:
    ```JAVA
    == Subtree 1 / 1 ==
    *Scan json [value#37L] Format: JSON, InputPaths: 
file:/private/var/folders/4b/sgmfldk15js406vk7lw5llzw0000gn/T/spark-8ac18be7-053f-4498-bf59-5ed87...,
 PushedFilters: [], ReadSchema: struct<value:bigint>
    
    Generated code:
    /* 001 */ public Object generate(Object[] references) {
    /* 002 */   return new GeneratedIterator(references);
    /* 003 */ }
    /* 004 */
    /* 005 */ final class GeneratedIterator extends 
org.apache.spark.sql.execution.BufferedRowIterator {
    /* 006 */   private Object[] references;
    /* 007 */   private org.apache.spark.sql.execution.metric.SQLMetric 
scan_numOutputRows;
    /* 008 */   private scala.collection.Iterator scan_input;
    /* 009 */
    /* 010 */   public GeneratedIterator(Object[] references) {
    /* 011 */     this.references = references;
    /* 012 */   }
    /* 013 */
    /* 014 */   public void init(int index, scala.collection.Iterator inputs[]) 
{
    /* 015 */     partitionIndex = index;
    /* 016 */     this.scan_numOutputRows = 
(org.apache.spark.sql.execution.metric.SQLMetric) references[0];
    /* 017 */     scan_input = inputs[0];
    /* 018 */   }
    /* 019 */
    /* 020 */   protected void processNext() throws java.io.IOException {
    /* 021 */     while (scan_input.hasNext()) {
    /* 022 */       InternalRow scan_row = (InternalRow) scan_input.next();
    /* 023 */       scan_numOutputRows.add(1);
    /* 024 */       append(scan_row);
    /* 025 */       if (shouldStop()) return;
    /* 026 */     }
    /* 027 */   }
    /* 028 */ }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to