snuyanzin commented on code in PR #28170: URL: https://github.com/apache/flink/pull/28170#discussion_r3409380128
########## flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java: ########## @@ -0,0 +1,2553 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.calcite.sql.fun; + +import com.google.common.base.Suppliers; +import com.google.common.collect.ImmutableList; +import org.apache.calcite.avatica.util.TimeUnit; +import org.apache.calcite.sql.SqlAggFunction; +import org.apache.calcite.sql.SqlAsOperator; +import org.apache.calcite.sql.SqlBasicCall; +import org.apache.calcite.sql.SqlBasicFunction; +import org.apache.calcite.sql.SqlBinaryOperator; +import org.apache.calcite.sql.SqlCall; +import org.apache.calcite.sql.SqlDescriptorOperator; +import org.apache.calcite.sql.SqlFilterOperator; +import org.apache.calcite.sql.SqlFunction; +import org.apache.calcite.sql.SqlFunctionCategory; +import org.apache.calcite.sql.SqlGroupedWindowFunction; +import org.apache.calcite.sql.SqlHopTableFunction; +import org.apache.calcite.sql.SqlInternalOperator; +import org.apache.calcite.sql.SqlJsonConstructorNullClause; +import org.apache.calcite.sql.SqlKind; +import org.apache.calcite.sql.SqlLateralOperator; +import org.apache.calcite.sql.SqlLiteral; +import org.apache.calcite.sql.SqlMatchFunction; +import org.apache.calcite.sql.SqlNode; +import org.apache.calcite.sql.SqlNullTreatmentOperator; +import org.apache.calcite.sql.SqlNumericLiteral; +import org.apache.calcite.sql.SqlOperandCountRange; +import org.apache.calcite.sql.SqlOperator; +import org.apache.calcite.sql.SqlOverOperator; +import org.apache.calcite.sql.SqlPostfixOperator; +import org.apache.calcite.sql.SqlPrefixOperator; +import org.apache.calcite.sql.SqlProcedureCallOperator; +import org.apache.calcite.sql.SqlRankFunction; +import org.apache.calcite.sql.SqlSampleSpec; +import org.apache.calcite.sql.SqlSessionTableFunction; +import org.apache.calcite.sql.SqlSetOperator; +import org.apache.calcite.sql.SqlSetSemanticsTableOperator; +import org.apache.calcite.sql.SqlSpecialOperator; +import org.apache.calcite.sql.SqlSyntax; +import org.apache.calcite.sql.SqlTumbleTableFunction; +import org.apache.calcite.sql.SqlUnnestOperator; +import org.apache.calcite.sql.SqlUtil; +import org.apache.calcite.sql.SqlValuesOperator; +import org.apache.calcite.sql.SqlWindow; +import org.apache.calcite.sql.SqlWithinDistinctOperator; +import org.apache.calcite.sql.SqlWithinGroupOperator; +import org.apache.calcite.sql.SqlWriter; +import org.apache.calcite.sql.type.InferTypes; +import org.apache.calcite.sql.type.OperandTypes; +import org.apache.calcite.sql.type.ReturnTypes; +import org.apache.calcite.sql.type.SqlOperandCountRanges; +import org.apache.calcite.sql.type.SqlReturnTypeInference; +import org.apache.calcite.sql.type.SqlTypeFamily; +import org.apache.calcite.sql.type.SqlTypeName; +import org.apache.calcite.sql.util.ReflectiveSqlOperatorTable; +import org.apache.calcite.sql.validate.SqlConformance; +import org.apache.calcite.sql.validate.SqlConformanceEnum; +import org.apache.calcite.sql.validate.SqlModality; +import org.apache.calcite.sql2rel.AuxiliaryConverter; +import org.apache.calcite.util.Litmus; +import org.apache.calcite.util.Optionality; +import org.apache.calcite.util.Pair; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.util.List; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.function.Supplier; + +import static java.util.Objects.requireNonNull; +import static org.apache.calcite.linq4j.Nullness.castNonNull; + +/** + * Implementation of {@link org.apache.calcite.sql.SqlOperatorTable} containing the standard + * operators and functions. + * + * <p>Lines 765 ~ 767, 785 ~ 787, 796 ~ 798, 807 ~ 809, 818 ~ 820, 829 ~ 831, 840 ~ 842, Flink + * changes the return type of the {@code IS [NOT] JSON ...} predicates from {@link + * ReturnTypes#BOOLEAN_NULLABLE} to {@link ReturnTypes#BOOLEAN} so that they always return a + * non-nullable {@code BOOLEAN}. Review Comment: the reason we have this class is keeping old nullability behavior for `IS [NOT ]JSON` functions probably could be resolved separately -- 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]
