LuciferYang commented on code in PR #13202:
URL: https://github.com/apache/gluten/pull/13202#discussion_r4190733285
##########
gluten-substrait/src/main/java/org/apache/gluten/substrait/expression/WindowFunctionNode.java:
##########
@@ -72,6 +73,23 @@ public class WindowFunctionNode implements Serializable {
this.originalInputAttributes = originalInputAttributes;
}
+ // A bound that does not parse as a long, such as the -1.50 of RANGE BETWEEN
1.5 PRECEDING on a
+ // decimal key, throws GlutenNotSupportException so the window falls back; a
+ // NumberFormatException would fail the query instead.
+ private static Long
parseOffset(org.apache.spark.sql.catalyst.expressions.Expression boundType) {
+ String raw = String.valueOf(boundType.eval(null));
+ try {
+ return Long.parseLong(raw);
+ } catch (NumberFormatException e) {
+ throw new GlutenNotSupportException(
Review Comment:
Done in 7464ada2f. ClickHouse's `supportWindowExec` now rejects a literal
frame bound that does not parse as a long, through
`WindowFunctionsBuilder.isLongOffset`, which applies the same rule as the
conversion, so a `decimal(10,0)` `10` is still offloaded. The ClickHouse test
now runs with native validation both on and off.
--
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]