Github user nongli commented on the pull request:

    https://github.com/apache/spark/pull/11008#issuecomment-178273018
  
    ```
    /* 001 */ public Object generate(Object[] references) {
    /* 002 */   return new GeneratedIterator(references);
    /* 003 */ }
    /* 004 */ 
    /* 005 */ class GeneratedIterator extends 
org.apache.spark.sql.execution.BufferedRowIterator {
    /* 006 */   
    /* 007 */   private Object[] references;
    /* 008 */   private boolean Sort_needToSort0;
    /* 009 */   private org.apache.spark.sql.execution.Sort Sort_plan1;
    /* 010 */   private org.apache.spark.sql.execution.UnsafeExternalRowSorter 
Sort_sorter2;
    /* 011 */   private scala.collection.Iterator<UnsafeRow> Sort_sortedIter3;
    /* 012 */   private UnsafeRow Sort_result24;
    /* 013 */   private 
org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder Sort_holder25;
    /* 014 */   private 
org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter 
Sort_rowWriter26;
    /* 015 */   
    /* 016 */   private void Sort_addToSorter4() throws java.io.IOException {
    /* 017 */     
    /* 018 */     while (input.hasNext()) {
    /* 019 */       InternalRow InputAdapter_row5 = (InternalRow) input.next();
    /* 020 */       /* input[0, int] */
    /* 021 */       boolean InputAdapter_isNull6 = 
InputAdapter_row5.isNullAt(0);
    /* 022 */       int InputAdapter_value7 = InputAdapter_isNull6 ? -1 : 
(InputAdapter_row5.getInt(0));
    /* 023 */       /* input[1, string] */
    /* 024 */       boolean InputAdapter_isNull8 = 
InputAdapter_row5.isNullAt(1);
    /* 025 */       UTF8String InputAdapter_value9 = InputAdapter_isNull8 ? 
null : (InputAdapter_row5.getUTF8String(1));
    /* 026 */       
    /* 027 */       /* (input[0, int] < 20) */
    /* 028 */       /* input[0, int] */
    /* 029 */       
    /* 030 */       /* 20 */
    /* 031 */       
    /* 032 */       boolean Filter_value11 = false;
    /* 033 */       Filter_value11 = InputAdapter_value7 < 20;
    /* 034 */       if (!false && Filter_value11) {
    /* 035 */         
    /* 036 */         /* input[0, int] */
    /* 037 */         
    /* 038 */         /* input[1, string] */
    /* 039 */         
    /* 040 */         
    /* 041 */         // Convert the input attributes to an UnsafeRow and add 
it to the sorter
    /* 042 */         
    /* 043 */         Sort_holder25.reset();
    /* 044 */         
    /* 045 */         Sort_rowWriter26.zeroOutNullBytes();
    /* 046 */         
    /* 047 */         /* input[0, int] */
    /* 048 */         
    /* 049 */         if (InputAdapter_isNull6) {
    /* 050 */           Sort_rowWriter26.setNullAt(0);
    /* 051 */         } else {
    /* 052 */           Sort_rowWriter26.write(0, InputAdapter_value7);
    /* 053 */         }
    /* 054 */         
    /* 055 */         /* input[1, string] */
    /* 056 */         
    /* 057 */         if (InputAdapter_isNull8) {
    /* 058 */           Sort_rowWriter26.setNullAt(1);
    /* 059 */         } else {
    /* 060 */           Sort_rowWriter26.write(1, InputAdapter_value9);
    /* 061 */         }
    /* 062 */         Sort_result24.setTotalSize(Sort_holder25.totalSize());
    /* 063 */         
    /* 064 */         Sort_sorter2.insertRow(Sort_result24);
    /* 065 */         
    /* 066 */       }
    /* 067 */       
    /* 068 */     }
    /* 069 */     
    /* 070 */   }
    /* 071 */   
    /* 072 */   public GeneratedIterator(Object[] references) {
    /* 073 */     this.references = references;
    /* 074 */     Sort_needToSort0 = true;
    /* 075 */     this.Sort_plan1 = (org.apache.spark.sql.execution.Sort) 
references[0];
    /* 076 */     Sort_sorter2 = Sort_plan1.createSorter();
    /* 077 */     
    /* 078 */     Sort_result24 = new UnsafeRow(2);
    /* 079 */     this.Sort_holder25 = new 
org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder(Sort_result24, 
32);
    /* 080 */     this.Sort_rowWriter26 = new 
org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(Sort_holder25,
 2);
    /* 081 */   }
    /* 082 */   
    /* 083 */   protected void processNext() throws java.io.IOException {
    /* 084 */     if (Sort_needToSort0) {
    /* 085 */       Sort_addToSorter4();
    /* 086 */       Sort_sortedIter3 = Sort_sorter2.sort();
    /* 087 */       Sort_needToSort0 = false;
    /* 088 */     }
    /* 089 */     
    /* 090 */     while (Sort_sortedIter3.hasNext()) {
    /* 091 */       UnsafeRow Sort_outputRow29 = 
(UnsafeRow)Sort_sortedIter3.next();
    /* 092 */       System.out.println(Sort_outputRow29);
    /* 093 */       currentRow = Sort_outputRow29;
    /* 094 */       return;
    /* 095 */     }
    /* 096 */   }
    /* 097 */ }
    ```



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