-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Optimize row constructor code #15732
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
base: master
Are you sure you want to change the base?
Conversation
6b53e1a
to
bb65dec
Compare
bb65dec
to
39a90f1
Compare
block.append(context.wasNull().set(constantFalse())); | ||
Variable index = scope.createTempVariable(int.class); | ||
BytecodeBlock loopBody = new BytecodeBlock(); | ||
BytecodeNode forLoop = new ForLoop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add comment to each block with the corresponding java code so it would be easier to read / review? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
query.append("ROW(obj.name, obj.value, obj.version, obj.matched_content_count, " + (i % 2 == 0 ? "1" : "false") + "),"); | ||
} | ||
query.append("null, 1) AS x,"); | ||
//query.append("ROW(" + query + "1), "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -5662,4 +5662,19 @@ public void testMapUnionSumOverflow() | |||
"select y, map_union_sum(x) from (select 1 y, map(array['x', 'z', 'y'], cast(array[null,30, 32760] as array<smallint>)) x " + | |||
"union all select 1 y, map(array['x', 'y'], cast(array[1,100] as array<smallint>))x) group by y", ".*Value 32860 exceeds MAX_SHORT.*"); | |||
} | |||
|
|||
@Test | |||
public void testSingleItemCSE() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to just name this as testLargeRow
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
07d441f
to
223f00f
Compare
223f00f
to
4842650
Compare
This pull request has been automatically marked as stale because it has not had recent activity. If you'd still like this PR merged, please comment on the task, make sure you've addressed reviewer comments, and rebase on the latest master. Thank you for your contributions! |
@rongrong Friendly ping. Please review this PR. Thank you! |
Test plan - Added a test in AbstractTestQueries
We now generate a single variable for each distinct primitive type and one Object type variable for all non-primitives. This helps in reducing the bytecode size dramatically. We can now process the 1250 field row that's in the test just added - that was failing before this optimization.
We also generate a single field add code per field type and a single null handling block. This is the minimal code that we can generate in our current framework.