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
[GLUTEN-5625][VL] Support window range frame #5626
base: main
Are you sure you want to change the base?
Conversation
Run Gluten Clickhouse CI |
5 similar comments
Run Gluten Clickhouse CI |
Run Gluten Clickhouse CI |
Run Gluten Clickhouse CI |
Run Gluten Clickhouse CI |
Run Gluten Clickhouse CI |
f5d363b
to
0484902
Compare
Run Gluten Clickhouse CI |
@PHILO-HE is the PR offload SQL like below?
|
Let me do a test once merged. Thank you! |
@WangGuangxin can you help to resolve conflicts? |
0484902
to
7d570fb
Compare
Run Gluten Clickhouse CI |
@FelixYBW done |
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.
Will spare some time to review in next week. Sorry for late response.
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.
Thanks! Just added several comments.
return std::make_tuple( | ||
core::WindowNode::BoundType::kFollowing, | ||
exprConverter_->toVeloxExpr(boundType.following().ref(), inputType)); | ||
} |
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.
It seems the only difference of the two branches is the expression. Can we differentiate the expressions only and reuse the rest of code?
return std::make_tuple( | ||
core::WindowNode::BoundType::kPreceding, | ||
exprConverter_->toVeloxExpr(boundType.preceding().ref(), inputType)); | ||
} |
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.
ditto
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.
I tried to reuse the logic here, but since the type of boundType.preceding()
and boundType.following()
are different, so I have to pass the offset
and ref
instead of the expression itself
String upperBound, | ||
String lowerBound, | ||
org.apache.spark.sql.catalyst.expressions.Expression upperBound, | ||
org.apache.spark.sql.catalyst.expressions.Expression lowerBound, |
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 import org.apache.spark.sql.catalyst.expressions.Expression
and use it here?
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.
The Expression
is conflict with io.substrait.proto.Expression
which alreay imported in this class, and Java doen't have the alias grammer like scala
if (offset < 0) { | ||
Expression.WindowFunction.Bound.Preceding.Builder offsetPrecedingBuilder = | ||
Expression.WindowFunction.Bound.Preceding.newBuilder(); | ||
offsetPrecedingBuilder.setOffset(0 - offset); |
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.
Do we need -offset?
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.
No need. In fact, this branch is the existing logic
|
||
// the reference to pre-project range frame boundary. | ||
Expression ref = 2; | ||
} |
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.
Would you document this change to Substrait in https://github.com/apache/incubator-gluten/blob/main/docs/developers/SubstraitModifications.md?
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.
added
7d570fb
to
d5195af
Compare
Run Gluten Clickhouse CI |
Run Gluten Clickhouse CI |
Run Gluten Clickhouse CI |
What changes were proposed in this pull request?
Support window range frame by pre-project frame offset for non-SpecialFrameBoundary, based on the discussion facebookincubator/velox#7557
(Fixes: #5625)
How was this patch tested?
UT