caicancai commented on code in PR #3812:
URL: https://github.com/apache/calcite/pull/3812#discussion_r1626829656
##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -635,6 +635,18 @@ static RelDataType deriveTypeSplit(SqlOperatorBinding
operatorBinding,
public static final SqlAggFunction BOOL_OR =
new SqlMinMaxAggFunction("BOOL_OR", SqlKind.MAX, OperandTypes.BOOLEAN);
+ /** The "BOOLAND_AGG(condition)" aggregate function, Snowflake's
+ * equivalent to {@link SqlStdOperatorTable#EVERY}. */
+ @LibraryOperator(libraries = {SNOWFLAKE})
+ public static final SqlAggFunction BOOLAND_AGG =
Review Comment:
If it is SqlLibraryOperators, I have the same opinion as yiwenwu, can it be
added to SqlOperatorTest
##########
core/src/main/java/org/apache/calcite/sql/dialect/SnowflakeSqlDialect.java:
##########
@@ -73,6 +80,30 @@ public SnowflakeSqlDialect(Context context) {
}
}
+ @Override public SqlNode rewriteMaxMinExpr(SqlNode aggCall, RelDataType
relDataType) {
+ return rewriteMaxMin(aggCall, relDataType);
+ }
+
+ /**
+ * Helper for rewrites of MAX/MIN.
+ * Snowflake, rewrite as
+ * BOOLOR_AGG/BOOLAND_AGG if the return type is BOOLEAN.
+ */
+ public static SqlNode rewriteMaxMin(SqlNode aggCall, RelDataType
relDataType) {
Review Comment:
You should add your jira link or add description where you tested
--
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]