diff --git a/core/src/main/codegen/templates/Parser.jj b/core/src/main/codegen/templates/Parser.jj index 822f6a407b0d..1ea1cebcf12e 100644 --- a/core/src/main/codegen/templates/Parser.jj +++ b/core/src/main/codegen/templates/Parser.jj @@ -7364,7 +7364,7 @@ SqlNode StandardFloorCeilOptions(Span s, boolean floorFlag) : } )? { - SqlOperator op = SqlStdOperatorTable.floorCeil(floorFlag, (SqlConformanceEnum) this.conformance); + SqlOperator op = SqlStdOperatorTable.floorCeil(floorFlag, this.conformance); function = op.createCall(s.end(this), args); } ( diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java index c4c8afd3a871..86a7cb0a0acc 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java @@ -2701,11 +2701,10 @@ public static SqlOperator like(boolean negated, boolean caseSensitive) { /** Returns the operator for {@code FLOOR} and {@code CEIL} with given floor flag * and library. */ - public static SqlOperator floorCeil(boolean floor, SqlConformanceEnum conformance) { - switch (conformance) { - case BIG_QUERY: + public static SqlOperator floorCeil(boolean floor, SqlConformance conformance) { + if (SqlConformanceEnum.BIG_QUERY.equals(conformance)) { return floor ? SqlLibraryOperators.FLOOR_BIG_QUERY : SqlLibraryOperators.CEIL_BIG_QUERY; - default: + } else { return floor ? SqlStdOperatorTable.FLOOR : SqlStdOperatorTable.CEIL; } }