zhztheplayer commented on PR #5435:
URL:
https://github.com/apache/incubator-gluten/pull/5435#issuecomment-2065631327
Example Velox bf with vanilla code-gen
```java
public Object generate(Object[] references) {
return new GeneratedIteratorForCodegenStage1(references);
}
/*wsc_codegenStageId*/
final class GeneratedIteratorForCodegenStage1 extends
org.apache.spark.sql.execution.BufferedRowIterator {
private Object[] references;
private scala.collection.Iterator[] inputs;
private scala.collection.Iterator localtablescan_input_0;
private org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[]
filter_mutableStateArray_1 = new
org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[1];
private org.apache.spark.util.sketch.VeloxBloomFilter[]
filter_mutableStateArray_0 = new
org.apache.spark.util.sketch.VeloxBloomFilter[1];
public GeneratedIteratorForCodegenStage1(Object[] references) {
this.references = references;
}
public void init(int index, scala.collection.Iterator[] inputs) {
partitionIndex = index;
this.inputs = inputs;
localtablescan_input_0 = inputs[0];
filter_mutableStateArray_1[0] = new
org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(1, 0);
filter_mutableStateArray_0[0] =
org.apache.spark.util.sketch.VeloxBloomFilter.readFrom(((byte[]) references[2]
/* bloomFilterData */));
}
protected void processNext() throws java.io.IOException {
while ( localtablescan_input_0.hasNext()) {
InternalRow localtablescan_row_0 = (InternalRow)
localtablescan_input_0.next();
((org.apache.spark.sql.execution.metric.SQLMetric) references[0] /*
numOutputRows */).add(1);
do {
long localtablescan_value_0 = localtablescan_row_0.getLong(0);
boolean filter_isNull_0 = false;
boolean filter_value_0 = false;
if (!filter_isNull_0) {
filter_value_0 =
filter_mutableStateArray_0[0].mightContainLong((Long)localtablescan_value_0);
}
if (filter_isNull_0 || !filter_value_0) continue;
((org.apache.spark.sql.execution.metric.SQLMetric) references[1] /*
numOutputRows */).add(1);
filter_mutableStateArray_1[0].reset();
filter_mutableStateArray_1[0].write(0, localtablescan_value_0);
append((filter_mutableStateArray_1[0].getRow()));
} while(false);
if (shouldStop()) return;
}
}
}
```
--
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]