itiels commented on code in PR #2868:
URL: https://github.com/apache/calcite/pull/2868#discussion_r985491360
##########
core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java:
##########
@@ -988,4 +990,15 @@ public static SqlCall stripSeparator(SqlCall call) {
return relDataType;
}
};
+
+ public static final SqlReturnTypeInference PERCENTILE_DISC = opBinding -> {
+ if (opBinding instanceof SqlWithinGroupOperator.PercentileDiscCallBinding)
{
Review Comment:
I can't implement `getCollationExpression` in
`PercentileDiscAggCallBinding`, as I don't have the collation expression there.
(maybe i'm missing something). I can however implement `getCollationType`
which will remove the need to use the `instance of` pattern here.
##########
core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java:
##########
@@ -988,4 +990,15 @@ public static SqlCall stripSeparator(SqlCall call) {
return relDataType;
}
};
+
+ public static final SqlReturnTypeInference PERCENTILE_DISC = opBinding -> {
+ if (opBinding instanceof SqlWithinGroupOperator.PercentileDiscCallBinding)
{
Review Comment:
I can't implement `getCollationExpression` in
`PercentileDiscAggCallBinding`, as I don't have the collation expression there.
(maybe i'm missing something).
I can however implement `getCollationType` which will remove the need to use
the `instance of` pattern here.
##########
core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java:
##########
@@ -988,4 +990,15 @@ public static SqlCall stripSeparator(SqlCall call) {
return relDataType;
}
};
+
+ public static final SqlReturnTypeInference PERCENTILE_DISC = opBinding -> {
+ if (opBinding instanceof SqlWithinGroupOperator.PercentileDiscCallBinding)
{
Review Comment:
I can't implement `getCollationExpression` in
`PercentileDiscAggCallBinding`, as I don't have the collation expression there.
(maybe i'm missing something).
I can however add `getCollationType` to the base class which will remove the
need to use the `instance of` pattern here.
--
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]