-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Only Test][Don't Review] Make FilterExec
to support subexpressionElimination
in the codegen scenario
#49573
Draft
panbingkun
wants to merge
3
commits into
apache:master
Choose a base branch
from
panbingkun:FilterExec_Codegen_SubexpressionElimination
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[Only Test][Don't Review] Make FilterExec
to support subexpressionElimination
in the codegen scenario
#49573
panbingkun
wants to merge
3
commits into
apache:master
from
panbingkun:FilterExec_Codegen_SubexpressionElimination
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
panbingkun
changed the title
[Only Test][Don't Review] FilterExec Codegen SubexpressionElimination
[Only Test][Don't Review] Make Jan 22, 2025
FilterExec
to support subexpressionElimination
in the codegen scenario
/* 001 */ public Object generate(Object[] references) {
/* 002 */ return new GeneratedIteratorForCodegenStage1(references);
/* 003 */ }
/* 004 */
/* 005 */ // codegenStageId=1
/* 006 */ final class GeneratedIteratorForCodegenStage1 extends org.apache.spark.sql.execution.BufferedRowIterator {
/* 007 */ private Object[] references;
/* 008 */ private scala.collection.Iterator[] inputs;
/* 009 */ private boolean hashAgg_initAgg_0;
/* 010 */ private org.apache.spark.unsafe.KVIterator hashAgg_mapIter_0;
/* 011 */ private org.apache.spark.sql.execution.UnsafeFixedWidthAggregationMap hashAgg_hashMap_0;
/* 012 */ private org.apache.spark.sql.execution.UnsafeKVExternalSorter hashAgg_sorter_0;
/* 013 */ private scala.collection.Iterator localtablescan_input_0;
/* 014 */ private boolean expand_resultIsNull_0;
/* 015 */ private long filter_subExprValue_0;
/* 016 */ private boolean filter_subExprIsNull_0;
/* 017 */ private long filter_subExprValue_1;
/* 018 */ private boolean filter_subExprIsNull_1;
/* 019 */ private long filter_subExprValue_2;
/* 020 */ private boolean filter_subExprIsNull_2;
/* 021 */ private org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[] filter_mutableStateArray_0 = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[15];
/* 022 */ private InternalRow[] expand_mutableStateArray_0 = new InternalRow[1];
/* 023 */
/* 024 */ public GeneratedIteratorForCodegenStage1(Object[] references) {
/* 025 */ this.references = references;
/* 026 */ }
/* 027 */
/* 028 */ public void init(int index, scala.collection.Iterator[] inputs) {
/* 029 */ partitionIndex = index;
/* 030 */ this.inputs = inputs;
/* 031 */ wholestagecodegen_init_0_0();
/* 032 */ wholestagecodegen_init_0_1();
/* 033 */
/* 034 */ }
/* 035 */
/* 036 */ private void wholestagecodegen_init_0_1() {
/* 037 */ filter_mutableStateArray_0[8] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(filter_mutableStateArray_0[7], 2);
/* 038 */ filter_mutableStateArray_0[9] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(1, 32);
/* 039 */ filter_mutableStateArray_0[10] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(filter_mutableStateArray_0[9], 2);
/* 040 */ filter_mutableStateArray_0[11] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(1, 32);
/* 041 */ filter_mutableStateArray_0[12] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(filter_mutableStateArray_0[11], 2);
/* 042 */ filter_mutableStateArray_0[13] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(2, 32);
/* 043 */ filter_mutableStateArray_0[14] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(filter_mutableStateArray_0[13], 2);
/* 044 */
/* 045 */ }
/* 046 */
/* 047 */ private void wholestagecodegen_init_0_0() {
/* 048 */ localtablescan_input_0 = inputs[0];
/* 049 */ filter_mutableStateArray_0[0] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(3, 64);
/* 050 */ filter_mutableStateArray_0[1] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(1, 32);
/* 051 */ filter_mutableStateArray_0[2] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(1, 32);
/* 052 */ expand_resultIsNull_0 = true;
/* 053 */ expand_mutableStateArray_0[0] = null;
/* 054 */ filter_mutableStateArray_0[3] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(2, 64);
/* 055 */ filter_mutableStateArray_0[4] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(filter_mutableStateArray_0[3], 2);
/* 056 */ filter_mutableStateArray_0[5] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(2, 64);
/* 057 */ filter_mutableStateArray_0[6] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(filter_mutableStateArray_0[5], 2);
/* 058 */ filter_mutableStateArray_0[7] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(1, 32);
/* 059 */
/* 060 */ }
/* 061 */
/* 062 */ private void filter_subExpr_0(boolean expand_resultIsNull_0, org.apache.spark.sql.catalyst.InternalRow expand_mutableStateArray_0[0]) {
/* 063 */ // 1...
/* 064 */ boolean filter_isNull_11 = expand_resultIsNull_0;
/* 065 */ long filter_value_12 = -1L;
/* 066 */
/* 067 */ if (!expand_resultIsNull_0) {
/* 068 */ if (expand_mutableStateArray_0[0].isNullAt(0)) {
/* 069 */ filter_isNull_11 = true;
/* 070 */ } else {
/* 071 */ filter_value_12 = expand_mutableStateArray_0[0].getLong(0);
/* 072 */ }
/* 073 */
/* 074 */ }
/* 075 */ // 2...
/* 076 */ filter_subExprIsNull_0 = filter_isNull_11;
/* 077 */ // 3...
/* 078 */ filter_subExprValue_0 = filter_value_12;
/* 079 */ }
/* 080 */
/* 081 */ protected void processNext() throws java.io.IOException {
/* 082 */ if (!hashAgg_initAgg_0) {
/* 083 */ hashAgg_initAgg_0 = true;
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
The pr aims to make
FilterExec
to supportsubexpressionElimination
in thecodegen
scenario.Why are the changes needed?
Improve performance.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Pass GA.
Was this patch authored or co-authored using generative AI tooling?
No.