Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
Untitled diff
Created
8 years ago
Diff never expires
Clear
Export
Share
Explain
1 removal
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
146 lines
Copy
1 addition
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
146 lines
Copy
Generated code:
Generated code:
/* 001 */ public Object generate(Object[] references) {
/* 001 */ public Object generate(Object[] references) {
/* 002 */ return new GeneratedIterator(references);
/* 002 */ return new GeneratedIterator(references);
/* 003 */ }
/* 003 */ }
/* 004 */
/* 004 */
/* 005 */ final class GeneratedIterator extends org.apache.spark.sql.execution.BufferedRowIterator {
/* 005 */ final class GeneratedIterator extends org.apache.spark.sql.execution.BufferedRowIterator {
/* 006 */ private Object[] references;
/* 006 */ private Object[] references;
/* 007 */ private scala.collection.Iterator[] inputs;
/* 007 */ private scala.collection.Iterator[] inputs;
/* 008 */ private boolean range_initRange;
/* 008 */ private boolean range_initRange;
/* 009 */ private long range_number;
/* 009 */ private long range_number;
/* 010 */ private TaskContext range_taskContext;
/* 010 */ private TaskContext range_taskContext;
/* 011 */ private InputMetrics range_inputMetrics;
/* 011 */ private InputMetrics range_inputMetrics;
/* 012 */ private long range_batchEnd;
/* 012 */ private long range_batchEnd;
/* 013 */ private long range_numElementsTodo;
/* 013 */ private long range_numElementsTodo;
/* 014 */ private org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder[] range_mutableStateArray1 = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder[3];
/* 014 */ private org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder[] range_mutableStateArray1 = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder[3];
/* 015 */ private org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[] range_mutableStateArray2 = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[3];
/* 015 */ private org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[] range_mutableStateArray2 = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[3];
/* 016 */ private UnsafeRow[] range_mutableStateArray = new UnsafeRow[3];
/* 016 */ private UnsafeRow[] range_mutableStateArray = new UnsafeRow[3];
/* 017 */
/* 017 */
/* 018 */ public GeneratedIterator(Object[] references) {
/* 018 */ public GeneratedIterator(Object[] references) {
/* 019 */ this.references = references;
/* 019 */ this.references = references;
/* 020 */ }
/* 020 */ }
/* 021 */
/* 021 */
/* 022 */ public void init(int index, scala.collection.Iterator[] inputs) {
/* 022 */ public void init(int index, scala.collection.Iterator[] inputs) {
/* 023 */ partitionIndex = index;
/* 023 */ partitionIndex = index;
/* 024 */ this.inputs = inputs;
/* 024 */ this.inputs = inputs;
/* 025 */
/* 025 */
/* 026 */ range_taskContext = TaskContext.get();
/* 026 */ range_taskContext = TaskContext.get();
/* 027 */ range_inputMetrics = range_taskContext.taskMetrics().inputMetrics();
/* 027 */ range_inputMetrics = range_taskContext.taskMetrics().inputMetrics();
/* 028 */ range_mutableStateArray[0] = new UnsafeRow(1);
/* 028 */ range_mutableStateArray[0] = new UnsafeRow(1);
/* 029 */ range_mutableStateArray1[0] = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder(range_mutableStateArray[0], 0);
/* 029 */ range_mutableStateArray1[0] = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder(range_mutableStateArray[0], 0);
/* 030 */ range_mutableStateArray2[0] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(range_mutableStateArray1[0], 1);
/* 030 */ range_mutableStateArray2[0] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(range_mutableStateArray1[0], 1);
/* 031 */ range_mutableStateArray[1] = new UnsafeRow(1);
/* 031 */ range_mutableStateArray[1] = new UnsafeRow(1);
/* 032 */ range_mutableStateArray1[1] = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder(range_mutableStateArray[1], 0);
/* 032 */ range_mutableStateArray1[1] = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder(range_mutableStateArray[1], 0);
/* 033 */ range_mutableStateArray2[1] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(range_mutableStateArray1[1], 1);
/* 033 */ range_mutableStateArray2[1] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(range_mutableStateArray1[1], 1);
/* 034 */ range_mutableStateArray[2] = new UnsafeRow(1);
/* 034 */ range_mutableStateArray[2] = new UnsafeRow(1);
/* 035 */ range_mutableStateArray1[2] = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder(range_mutableStateArray[2], 0);
/* 035 */ range_mutableStateArray1[2] = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder(range_mutableStateArray[2], 0);
/* 036 */ range_mutableStateArray2[2] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(range_mutableStateArray1[2], 1);
/* 036 */ range_mutableStateArray2[2] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(range_mutableStateArray1[2], 1);
/* 037 */
/* 037 */
/* 038 */ }
/* 038 */ }
/* 039 */
/* 039 */
/* 040 */ private void initRange(int idx) {
/* 040 */ private void initRange(int idx) {
/* 041 */ java.math.BigInteger index = java.math.BigInteger.valueOf(idx);
/* 041 */ java.math.BigInteger index = java.math.BigInteger.valueOf(idx);
/* 042 */ java.math.BigInteger numSlice = java.math.BigInteger.valueOf(8L);
/* 042 */ java.math.BigInteger numSlice = java.math.BigInteger.valueOf(8L);
Copy
Copied
Copy
Copied
/* 043 */ java.math.BigInteger numElement = java.math.BigInteger.valueOf(
3L
);
/* 043 */ java.math.BigInteger numElement = java.math.BigInteger.valueOf(
5L
);
/* 044 */ java.math.BigInteger step = java.math.BigInteger.valueOf(1L);
/* 044 */ java.math.BigInteger step = java.math.BigInteger.valueOf(1L);
/* 045 */ java.math.BigInteger start = java.math.BigInteger.valueOf(0L);
/* 045 */ java.math.BigInteger start = java.math.BigInteger.valueOf(0L);
/* 046 */ long partitionEnd;
/* 046 */ long partitionEnd;
/* 047 */
/* 047 */
/* 048 */ java.math.BigInteger st = index.multiply(numElement).divide(numSlice).multiply(step).add(start);
/* 048 */ java.math.BigInteger st = index.multiply(numElement).divide(numSlice).multiply(step).add(start);
/* 049 */ if (st.compareTo(java.math.BigInteger.valueOf(Long.MAX_VALUE)) > 0) {
/* 049 */ if (st.compareTo(java.math.BigInteger.valueOf(Long.MAX_VALUE)) > 0) {
/* 050 */ range_number = Long.MAX_VALUE;
/* 050 */ range_number = Long.MAX_VALUE;
/* 051 */ } else if (st.compareTo(java.math.BigInteger.valueOf(Long.MIN_VALUE)) < 0) {
/* 051 */ } else if (st.compareTo(java.math.BigInteger.valueOf(Long.MIN_VALUE)) < 0) {
/* 052 */ range_number = Long.MIN_VALUE;
/* 052 */ range_number = Long.MIN_VALUE;
/* 053 */ } else {
/* 053 */ } else {
/* 054 */ range_number = st.longValue();
/* 054 */ range_number = st.longValue();
/* 055 */ }
/* 055 */ }
/* 056 */ range_batchEnd = range_number;
/* 056 */ range_batchEnd = range_number;
/* 057 */
/* 057 */
/* 058 */ java.math.BigInteger end = index.add(java.math.BigInteger.ONE).multiply(numElement).divide(numSlice)
/* 058 */ java.math.BigInteger end = index.add(java.math.BigInteger.ONE).multiply(numElement).divide(numSlice)
/* 059 */ .multiply(step).add(start);
/* 059 */ .multiply(step).add(start);
/* 060 */ if (end.compareTo(java.math.BigInteger.valueOf(Long.MAX_VALUE)) > 0) {
/* 060 */ if (end.compareTo(java.math.BigInteger.valueOf(Long.MAX_VALUE)) > 0) {
/* 061 */ partitionEnd = Long.MAX_VALUE;
/* 061 */ partitionEnd = Long.MAX_VALUE;
/* 062 */ } else if (end.compareTo(java.math.BigInteger.valueOf(Long.MIN_VALUE)) < 0) {
/* 062 */ } else if (end.compareTo(java.math.BigInteger.valueOf(Long.MIN_VALUE)) < 0) {
/* 063 */ partitionEnd = Long.MIN_VALUE;
/* 063 */ partitionEnd = Long.MIN_VALUE;
/* 064 */ } else {
/* 064 */ } else {
/* 065 */ partitionEnd = end.longValue();
/* 065 */ partitionEnd = end.longValue();
/* 066 */ }
/* 066 */ }
/* 067 */
/* 067 */
/* 068 */ java.math.BigInteger startToEnd = java.math.BigInteger.valueOf(partitionEnd).subtract(
/* 068 */ java.math.BigInteger startToEnd = java.math.BigInteger.valueOf(partitionEnd).subtract(
/* 069 */ java.math.BigInteger.valueOf(range_number));
/* 069 */ java.math.BigInteger.valueOf(range_number));
/* 070 */ range_numElementsTodo = startToEnd.divide(step).longValue();
/* 070 */ range_numElementsTodo = startToEnd.divide(step).longValue();
/* 071 */ if (range_numElementsTodo < 0) {
/* 071 */ if (range_numElementsTodo < 0) {
/* 072 */ range_numElementsTodo = 0;
/* 072 */ range_numElementsTodo = 0;
/* 073 */ } else if (startToEnd.remainder(step).compareTo(java.math.BigInteger.valueOf(0L)) != 0) {
/* 073 */ } else if (startToEnd.remainder(step).compareTo(java.math.BigInteger.valueOf(0L)) != 0) {
/* 074 */ range_numElementsTodo++;
/* 074 */ range_numElementsTodo++;
/* 075 */ }
/* 075 */ }
/* 076 */ }
/* 076 */ }
/* 077 */
/* 077 */
/* 078 */ protected void processNext() throws java.io.IOException {
/* 078 */ protected void processNext() throws java.io.IOException {
/* 079 */ // initialize Range
/* 079 */ // initialize Range
/* 080 */ if (!range_initRange) {
/* 080 */ if (!range_initRange) {
/* 081 */ range_initRange = true;
/* 081 */ range_initRange = true;
/* 082 */ initRange(partitionIndex);
/* 082 */ initRange(partitionIndex);
/* 083 */ }
/* 083 */ }
/* 084 */
/* 084 */
/* 085 */ while (true) {
/* 085 */ while (true) {
/* 086 */ long range_range = range_batchEnd - range_number;
/* 086 */ long range_range = range_batchEnd - range_number;
/* 087 */ if (range_range != 0L) {
/* 087 */ if (range_range != 0L) {
/* 088 */ int range_localEnd = (int)(range_range / 1L);
/* 088 */ int range_localEnd = (int)(range_range / 1L);
/* 089 */ for (int range_localIdx = 0; range_localIdx < range_localEnd; range_localIdx++) {
/* 089 */ for (int range_localIdx = 0; range_localIdx < range_localEnd; range_localIdx++) {
/* 090 */ long range_value = ((long)range_localIdx * 1L) + range_number;
/* 090 */ long range_value = ((long)range_localIdx * 1L) + range_number;
/* 091 */
/* 091 */
/* 092 */ do {
/* 092 */ do {
/* 093 */ boolean filter_isNull1 = false;
/* 093 */ boolean filter_isNull1 = false;
/* 094 */ long filter_value1 = -1L;
/* 094 */ long filter_value1 = -1L;
/* 095 */ if (2L == 0) {
/* 095 */ if (2L == 0) {
/* 096 */ filter_isNull1 = true;
/* 096 */ filter_isNull1 = true;
/* 097 */ } else {
/* 097 */ } else {
/* 098 */ filter_value1 = (long)(range_value % 2L);
/* 098 */ filter_value1 = (long)(range_value % 2L);
/* 099 */ }
/* 099 */ }
/* 100 */ if (!(!(filter_isNull1))) continue;
/* 100 */ if (!(!(filter_isNull1))) continue;
/* 101 */
/* 101 */
/* 102 */ ((org.apache.spark.sql.execution.metric.SQLMetric) references[1] /* numOutputRows */).add(1);
/* 102 */ ((org.apache.spark.sql.execution.metric.SQLMetric) references[1] /* numOutputRows */).add(1);
/* 103 */
/* 103 */
/* 104 */ boolean project_isNull = false;
/* 104 */ boolean project_isNull = false;
/* 105 */ long project_value = -1L;
/* 105 */ long project_value = -1L;
/* 106 */ if (2L == 0) {
/* 106 */ if (2L == 0) {
/* 107 */ project_isNull = true;
/* 107 */ project_isNull = true;
/* 108 */ } else {
/* 108 */ } else {
/* 109 */ project_value = (long)(range_value % 2L);
/* 109 */ project_value = (long)(range_value % 2L);
/* 110 */ }
/* 110 */ }
/* 111 */ range_mutableStateArray2[2].zeroOutNullBytes();
/* 111 */ range_mutableStateArray2[2].zeroOutNullBytes();
/* 112 */
/* 112 */
/* 113 */ if (project_isNull) {
/* 113 */ if (project_isNull) {
/* 114 */ range_mutableStateArray2[2].setNullAt(0);
/* 114 */ range_mutableStateArray2[2].setNullAt(0);
/* 115 */ } else {
/* 115 */ } else {
/* 116 */ range_mutableStateArray2[2].write(0, project_value);
/* 116 */ range_mutableStateArray2[2].write(0, project_value);
/* 117 */ }
/* 117 */ }
/* 118 */ append(range_mutableStateArray[2]);
/* 118 */ append(range_mutableStateArray[2]);
/* 119 */
/* 119 */
/* 120 */ } while(false);
/* 120 */ } while(false);
/* 121 */
/* 121 */
/* 122 */ if (shouldStop()) { range_number = range_value + 1L; return; }
/* 122 */ if (shouldStop()) { range_number = range_value + 1L; return; }
/* 123 */ }
/* 123 */ }
/* 124 */ range_number = range_batchEnd;
/* 124 */ range_number = range_batchEnd;
/* 125 */ }
/* 125 */ }
/* 126 */
/* 126 */
/* 127 */ range_taskContext.killTaskIfInterrupted();
/* 127 */ range_taskContext.killTaskIfInterrupted();
/* 128 */
/* 128 */
/* 129 */ long range_nextBatchTodo;
/* 129 */ long range_nextBatchTodo;
/* 130 */ if (range_numElementsTodo > 1000L) {
/* 130 */ if (range_numElementsTodo > 1000L) {
/* 131 */ range_nextBatchTodo = 1000L;
/* 131 */ range_nextBatchTodo = 1000L;
/* 132 */ range_numElementsTodo -= 1000L;
/* 132 */ range_numElementsTodo -= 1000L;
/* 133 */ } else {
/* 133 */ } else {
/* 134 */ range_nextBatchTodo = range_numElementsTodo;
/* 134 */ range_nextBatchTodo = range_numElementsTodo;
/* 135 */ range_numElementsTodo = 0;
/* 135 */ range_numElementsTodo = 0;
/* 136 */ if (range_nextBatchTodo == 0) break;
/* 136 */ if (range_nextBatchTodo == 0) break;
/* 137 */ }
/* 137 */ }
/* 138 */ ((org.apache.spark.sql.execution.metric.SQLMetric) references[0] /* numOutputRows */).add(range_nextBatchTodo);
/* 138 */ ((org.apache.spark.sql.execution.metric.SQLMetric) references[0] /* numOutputRows */).add(range_nextBatchTodo);
/* 139 */ range_inputMetrics.incRecordsRead(range_nextBatchTodo);
/* 139 */ range_inputMetrics.incRecordsRead(range_nextBatchTodo);
/* 140 */
/* 140 */
/* 141 */ range_batchEnd += range_nextBatchTodo * 1L;
/* 141 */ range_batchEnd += range_nextBatchTodo * 1L;
/* 142 */ }
/* 142 */ }
/* 143 */ }
/* 143 */ }
/* 144 */
/* 144 */
/* 145 */ }
/* 145 */ }
Saved diffs
Original text
Open file
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 scala.collection.Iterator[] inputs; /* 008 */ private boolean range_initRange; /* 009 */ private long range_number; /* 010 */ private TaskContext range_taskContext; /* 011 */ private InputMetrics range_inputMetrics; /* 012 */ private long range_batchEnd; /* 013 */ private long range_numElementsTodo; /* 014 */ private org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder[] range_mutableStateArray1 = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder[3]; /* 015 */ private org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[] range_mutableStateArray2 = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[3]; /* 016 */ private UnsafeRow[] range_mutableStateArray = new UnsafeRow[3]; /* 017 */ /* 018 */ public GeneratedIterator(Object[] references) { /* 019 */ this.references = references; /* 020 */ } /* 021 */ /* 022 */ public void init(int index, scala.collection.Iterator[] inputs) { /* 023 */ partitionIndex = index; /* 024 */ this.inputs = inputs; /* 025 */ /* 026 */ range_taskContext = TaskContext.get(); /* 027 */ range_inputMetrics = range_taskContext.taskMetrics().inputMetrics(); /* 028 */ range_mutableStateArray[0] = new UnsafeRow(1); /* 029 */ range_mutableStateArray1[0] = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder(range_mutableStateArray[0], 0); /* 030 */ range_mutableStateArray2[0] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(range_mutableStateArray1[0], 1); /* 031 */ range_mutableStateArray[1] = new UnsafeRow(1); /* 032 */ range_mutableStateArray1[1] = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder(range_mutableStateArray[1], 0); /* 033 */ range_mutableStateArray2[1] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(range_mutableStateArray1[1], 1); /* 034 */ range_mutableStateArray[2] = new UnsafeRow(1); /* 035 */ range_mutableStateArray1[2] = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder(range_mutableStateArray[2], 0); /* 036 */ range_mutableStateArray2[2] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(range_mutableStateArray1[2], 1); /* 037 */ /* 038 */ } /* 039 */ /* 040 */ private void initRange(int idx) { /* 041 */ java.math.BigInteger index = java.math.BigInteger.valueOf(idx); /* 042 */ java.math.BigInteger numSlice = java.math.BigInteger.valueOf(8L); /* 043 */ java.math.BigInteger numElement = java.math.BigInteger.valueOf(3L); /* 044 */ java.math.BigInteger step = java.math.BigInteger.valueOf(1L); /* 045 */ java.math.BigInteger start = java.math.BigInteger.valueOf(0L); /* 046 */ long partitionEnd; /* 047 */ /* 048 */ java.math.BigInteger st = index.multiply(numElement).divide(numSlice).multiply(step).add(start); /* 049 */ if (st.compareTo(java.math.BigInteger.valueOf(Long.MAX_VALUE)) > 0) { /* 050 */ range_number = Long.MAX_VALUE; /* 051 */ } else if (st.compareTo(java.math.BigInteger.valueOf(Long.MIN_VALUE)) < 0) { /* 052 */ range_number = Long.MIN_VALUE; /* 053 */ } else { /* 054 */ range_number = st.longValue(); /* 055 */ } /* 056 */ range_batchEnd = range_number; /* 057 */ /* 058 */ java.math.BigInteger end = index.add(java.math.BigInteger.ONE).multiply(numElement).divide(numSlice) /* 059 */ .multiply(step).add(start); /* 060 */ if (end.compareTo(java.math.BigInteger.valueOf(Long.MAX_VALUE)) > 0) { /* 061 */ partitionEnd = Long.MAX_VALUE; /* 062 */ } else if (end.compareTo(java.math.BigInteger.valueOf(Long.MIN_VALUE)) < 0) { /* 063 */ partitionEnd = Long.MIN_VALUE; /* 064 */ } else { /* 065 */ partitionEnd = end.longValue(); /* 066 */ } /* 067 */ /* 068 */ java.math.BigInteger startToEnd = java.math.BigInteger.valueOf(partitionEnd).subtract( /* 069 */ java.math.BigInteger.valueOf(range_number)); /* 070 */ range_numElementsTodo = startToEnd.divide(step).longValue(); /* 071 */ if (range_numElementsTodo < 0) { /* 072 */ range_numElementsTodo = 0; /* 073 */ } else if (startToEnd.remainder(step).compareTo(java.math.BigInteger.valueOf(0L)) != 0) { /* 074 */ range_numElementsTodo++; /* 075 */ } /* 076 */ } /* 077 */ /* 078 */ protected void processNext() throws java.io.IOException { /* 079 */ // initialize Range /* 080 */ if (!range_initRange) { /* 081 */ range_initRange = true; /* 082 */ initRange(partitionIndex); /* 083 */ } /* 084 */ /* 085 */ while (true) { /* 086 */ long range_range = range_batchEnd - range_number; /* 087 */ if (range_range != 0L) { /* 088 */ int range_localEnd = (int)(range_range / 1L); /* 089 */ for (int range_localIdx = 0; range_localIdx < range_localEnd; range_localIdx++) { /* 090 */ long range_value = ((long)range_localIdx * 1L) + range_number; /* 091 */ /* 092 */ do { /* 093 */ boolean filter_isNull1 = false; /* 094 */ long filter_value1 = -1L; /* 095 */ if (2L == 0) { /* 096 */ filter_isNull1 = true; /* 097 */ } else { /* 098 */ filter_value1 = (long)(range_value % 2L); /* 099 */ } /* 100 */ if (!(!(filter_isNull1))) continue; /* 101 */ /* 102 */ ((org.apache.spark.sql.execution.metric.SQLMetric) references[1] /* numOutputRows */).add(1); /* 103 */ /* 104 */ boolean project_isNull = false; /* 105 */ long project_value = -1L; /* 106 */ if (2L == 0) { /* 107 */ project_isNull = true; /* 108 */ } else { /* 109 */ project_value = (long)(range_value % 2L); /* 110 */ } /* 111 */ range_mutableStateArray2[2].zeroOutNullBytes(); /* 112 */ /* 113 */ if (project_isNull) { /* 114 */ range_mutableStateArray2[2].setNullAt(0); /* 115 */ } else { /* 116 */ range_mutableStateArray2[2].write(0, project_value); /* 117 */ } /* 118 */ append(range_mutableStateArray[2]); /* 119 */ /* 120 */ } while(false); /* 121 */ /* 122 */ if (shouldStop()) { range_number = range_value + 1L; return; } /* 123 */ } /* 124 */ range_number = range_batchEnd; /* 125 */ } /* 126 */ /* 127 */ range_taskContext.killTaskIfInterrupted(); /* 128 */ /* 129 */ long range_nextBatchTodo; /* 130 */ if (range_numElementsTodo > 1000L) { /* 131 */ range_nextBatchTodo = 1000L; /* 132 */ range_numElementsTodo -= 1000L; /* 133 */ } else { /* 134 */ range_nextBatchTodo = range_numElementsTodo; /* 135 */ range_numElementsTodo = 0; /* 136 */ if (range_nextBatchTodo == 0) break; /* 137 */ } /* 138 */ ((org.apache.spark.sql.execution.metric.SQLMetric) references[0] /* numOutputRows */).add(range_nextBatchTodo); /* 139 */ range_inputMetrics.incRecordsRead(range_nextBatchTodo); /* 140 */ /* 141 */ range_batchEnd += range_nextBatchTodo * 1L; /* 142 */ } /* 143 */ } /* 144 */ /* 145 */ }
Changed text
Open file
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 scala.collection.Iterator[] inputs; /* 008 */ private boolean range_initRange; /* 009 */ private long range_number; /* 010 */ private TaskContext range_taskContext; /* 011 */ private InputMetrics range_inputMetrics; /* 012 */ private long range_batchEnd; /* 013 */ private long range_numElementsTodo; /* 014 */ private org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder[] range_mutableStateArray1 = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder[3]; /* 015 */ private org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[] range_mutableStateArray2 = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[3]; /* 016 */ private UnsafeRow[] range_mutableStateArray = new UnsafeRow[3]; /* 017 */ /* 018 */ public GeneratedIterator(Object[] references) { /* 019 */ this.references = references; /* 020 */ } /* 021 */ /* 022 */ public void init(int index, scala.collection.Iterator[] inputs) { /* 023 */ partitionIndex = index; /* 024 */ this.inputs = inputs; /* 025 */ /* 026 */ range_taskContext = TaskContext.get(); /* 027 */ range_inputMetrics = range_taskContext.taskMetrics().inputMetrics(); /* 028 */ range_mutableStateArray[0] = new UnsafeRow(1); /* 029 */ range_mutableStateArray1[0] = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder(range_mutableStateArray[0], 0); /* 030 */ range_mutableStateArray2[0] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(range_mutableStateArray1[0], 1); /* 031 */ range_mutableStateArray[1] = new UnsafeRow(1); /* 032 */ range_mutableStateArray1[1] = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder(range_mutableStateArray[1], 0); /* 033 */ range_mutableStateArray2[1] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(range_mutableStateArray1[1], 1); /* 034 */ range_mutableStateArray[2] = new UnsafeRow(1); /* 035 */ range_mutableStateArray1[2] = new org.apache.spark.sql.catalyst.expressions.codegen.BufferHolder(range_mutableStateArray[2], 0); /* 036 */ range_mutableStateArray2[2] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(range_mutableStateArray1[2], 1); /* 037 */ /* 038 */ } /* 039 */ /* 040 */ private void initRange(int idx) { /* 041 */ java.math.BigInteger index = java.math.BigInteger.valueOf(idx); /* 042 */ java.math.BigInteger numSlice = java.math.BigInteger.valueOf(8L); /* 043 */ java.math.BigInteger numElement = java.math.BigInteger.valueOf(5L); /* 044 */ java.math.BigInteger step = java.math.BigInteger.valueOf(1L); /* 045 */ java.math.BigInteger start = java.math.BigInteger.valueOf(0L); /* 046 */ long partitionEnd; /* 047 */ /* 048 */ java.math.BigInteger st = index.multiply(numElement).divide(numSlice).multiply(step).add(start); /* 049 */ if (st.compareTo(java.math.BigInteger.valueOf(Long.MAX_VALUE)) > 0) { /* 050 */ range_number = Long.MAX_VALUE; /* 051 */ } else if (st.compareTo(java.math.BigInteger.valueOf(Long.MIN_VALUE)) < 0) { /* 052 */ range_number = Long.MIN_VALUE; /* 053 */ } else { /* 054 */ range_number = st.longValue(); /* 055 */ } /* 056 */ range_batchEnd = range_number; /* 057 */ /* 058 */ java.math.BigInteger end = index.add(java.math.BigInteger.ONE).multiply(numElement).divide(numSlice) /* 059 */ .multiply(step).add(start); /* 060 */ if (end.compareTo(java.math.BigInteger.valueOf(Long.MAX_VALUE)) > 0) { /* 061 */ partitionEnd = Long.MAX_VALUE; /* 062 */ } else if (end.compareTo(java.math.BigInteger.valueOf(Long.MIN_VALUE)) < 0) { /* 063 */ partitionEnd = Long.MIN_VALUE; /* 064 */ } else { /* 065 */ partitionEnd = end.longValue(); /* 066 */ } /* 067 */ /* 068 */ java.math.BigInteger startToEnd = java.math.BigInteger.valueOf(partitionEnd).subtract( /* 069 */ java.math.BigInteger.valueOf(range_number)); /* 070 */ range_numElementsTodo = startToEnd.divide(step).longValue(); /* 071 */ if (range_numElementsTodo < 0) { /* 072 */ range_numElementsTodo = 0; /* 073 */ } else if (startToEnd.remainder(step).compareTo(java.math.BigInteger.valueOf(0L)) != 0) { /* 074 */ range_numElementsTodo++; /* 075 */ } /* 076 */ } /* 077 */ /* 078 */ protected void processNext() throws java.io.IOException { /* 079 */ // initialize Range /* 080 */ if (!range_initRange) { /* 081 */ range_initRange = true; /* 082 */ initRange(partitionIndex); /* 083 */ } /* 084 */ /* 085 */ while (true) { /* 086 */ long range_range = range_batchEnd - range_number; /* 087 */ if (range_range != 0L) { /* 088 */ int range_localEnd = (int)(range_range / 1L); /* 089 */ for (int range_localIdx = 0; range_localIdx < range_localEnd; range_localIdx++) { /* 090 */ long range_value = ((long)range_localIdx * 1L) + range_number; /* 091 */ /* 092 */ do { /* 093 */ boolean filter_isNull1 = false; /* 094 */ long filter_value1 = -1L; /* 095 */ if (2L == 0) { /* 096 */ filter_isNull1 = true; /* 097 */ } else { /* 098 */ filter_value1 = (long)(range_value % 2L); /* 099 */ } /* 100 */ if (!(!(filter_isNull1))) continue; /* 101 */ /* 102 */ ((org.apache.spark.sql.execution.metric.SQLMetric) references[1] /* numOutputRows */).add(1); /* 103 */ /* 104 */ boolean project_isNull = false; /* 105 */ long project_value = -1L; /* 106 */ if (2L == 0) { /* 107 */ project_isNull = true; /* 108 */ } else { /* 109 */ project_value = (long)(range_value % 2L); /* 110 */ } /* 111 */ range_mutableStateArray2[2].zeroOutNullBytes(); /* 112 */ /* 113 */ if (project_isNull) { /* 114 */ range_mutableStateArray2[2].setNullAt(0); /* 115 */ } else { /* 116 */ range_mutableStateArray2[2].write(0, project_value); /* 117 */ } /* 118 */ append(range_mutableStateArray[2]); /* 119 */ /* 120 */ } while(false); /* 121 */ /* 122 */ if (shouldStop()) { range_number = range_value + 1L; return; } /* 123 */ } /* 124 */ range_number = range_batchEnd; /* 125 */ } /* 126 */ /* 127 */ range_taskContext.killTaskIfInterrupted(); /* 128 */ /* 129 */ long range_nextBatchTodo; /* 130 */ if (range_numElementsTodo > 1000L) { /* 131 */ range_nextBatchTodo = 1000L; /* 132 */ range_numElementsTodo -= 1000L; /* 133 */ } else { /* 134 */ range_nextBatchTodo = range_numElementsTodo; /* 135 */ range_numElementsTodo = 0; /* 136 */ if (range_nextBatchTodo == 0) break; /* 137 */ } /* 138 */ ((org.apache.spark.sql.execution.metric.SQLMetric) references[0] /* numOutputRows */).add(range_nextBatchTodo); /* 139 */ range_inputMetrics.incRecordsRead(range_nextBatchTodo); /* 140 */ /* 141 */ range_batchEnd += range_nextBatchTodo * 1L; /* 142 */ } /* 143 */ } /* 144 */ /* 145 */ }
Find difference