Support common sub-expression optimization in CursorProcessorCompiler#14696
Support common sub-expression optimization in CursorProcessorCompiler#14696rongrong merged 1 commit intoprestodb:masterfrom frankobe:cse-cursorprocessor
Conversation
presto-main/src/main/java/com/facebook/presto/sql/gen/PageFunctionCompiler.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/gen/CursorProcessorCompiler.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/gen/CursorProcessorCompiler.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/gen/CursorProcessorCompiler.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/gen/CommonSubExpressionFields.java
Outdated
Show resolved
Hide resolved
rongrong
left a comment
There was a problem hiding this comment.
Looks good! Just some nits. Thanks for the contribution!
There was a problem hiding this comment.
This change is unnecessary right?
presto-main/src/main/java/com/facebook/presto/sql/gen/PageFunctionCompiler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
rewriteRowExpressionsWithCSE(rowExpressions, commonSubExpressions)? You might want to rename rowExpressions to projections to be clear.
There was a problem hiding this comment.
Lambda is not needed here right?
There was a problem hiding this comment.
Let's call the variable METADATA to be consistent with the codebase.
There was a problem hiding this comment.
All static final variables should be UPPER_CASE.
There was a problem hiding this comment.
I think these variables can be defined within testRewriteRowExpressionWithCSE though.
There was a problem hiding this comment.
Would be interesting to make the filter and projection share some cse.
There was a problem hiding this comment.
@rongrong mk sense. add ADD_X_Y to the projections so "X+Y" is shared between projections & filter
Signed-off-by: frank.hu <mua08p@gmail.com>

Reuse common subexpression optimization in #14303 to avoid generating cse methods for projection and filter expressions in CursorProcessorCompiler
Initial benchmark from
CommonSubExpressionBenchmark