diff --git a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/OverWindowPartitionedOrdered.java b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/OverWindowPartitionedOrdered.java index 04b3e75e1ee80..6c83fc5b11941 100644 --- a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/OverWindowPartitionedOrdered.java +++ b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/OverWindowPartitionedOrdered.java @@ -19,10 +19,10 @@ package org.apache.flink.table.api; import org.apache.flink.annotation.PublicEvolving; -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions; import org.apache.flink.table.expressions.CallExpression; import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.ExpressionParser; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; import java.util.Collections; import java.util.List; diff --git a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/FunctionCatalog.java b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/FunctionCatalog.java index aa384d3846dcc..49f0202eea39e 100644 --- a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/FunctionCatalog.java +++ b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/FunctionCatalog.java @@ -20,14 +20,14 @@ import org.apache.flink.annotation.Internal; import org.apache.flink.api.common.typeinfo.TypeInformation; -import org.apache.flink.table.expressions.AggregateFunctionDefinition; -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions; -import org.apache.flink.table.expressions.FunctionDefinition; -import org.apache.flink.table.expressions.ScalarFunctionDefinition; -import org.apache.flink.table.expressions.TableFunctionDefinition; import org.apache.flink.table.expressions.catalog.FunctionDefinitionCatalog; +import org.apache.flink.table.functions.AggregateFunctionDefinition; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; +import org.apache.flink.table.functions.FunctionDefinition; import org.apache.flink.table.functions.ScalarFunction; +import org.apache.flink.table.functions.ScalarFunctionDefinition; import org.apache.flink.table.functions.TableFunction; +import org.apache.flink.table.functions.TableFunctionDefinition; import org.apache.flink.table.functions.UserDefinedAggregateFunction; import org.apache.flink.table.functions.UserFunctionsTypeHelper; diff --git a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/ApiExpressionUtils.java b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/ApiExpressionUtils.java index 24834bcd5ad67..eb25f601f4c37 100644 --- a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/ApiExpressionUtils.java +++ b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/ApiExpressionUtils.java @@ -22,6 +22,7 @@ import org.apache.flink.table.api.DataTypes; import org.apache.flink.table.api.Table; import org.apache.flink.table.api.ValidationException; +import org.apache.flink.table.functions.FunctionDefinition; import org.apache.flink.table.types.DataType; import java.util.Arrays; diff --git a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/LookupCallExpression.java b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/LookupCallExpression.java index a1512d0ad4130..fae558e70ec99 100644 --- a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/LookupCallExpression.java +++ b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/LookupCallExpression.java @@ -19,6 +19,7 @@ package org.apache.flink.table.expressions; import org.apache.flink.annotation.PublicEvolving; +import org.apache.flink.table.functions.FunctionDefinition; import org.apache.flink.util.Preconditions; import java.util.ArrayList; diff --git a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/LookupCallResolver.java b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/LookupCallResolver.java index e82185e45c4df..095ec84ef17eb 100644 --- a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/LookupCallResolver.java +++ b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/LookupCallResolver.java @@ -21,6 +21,7 @@ import org.apache.flink.annotation.Internal; import org.apache.flink.table.api.ValidationException; import org.apache.flink.table.expressions.catalog.FunctionDefinitionCatalog; +import org.apache.flink.table.functions.FunctionDefinition; import java.util.List; import java.util.stream.Collectors; diff --git a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/catalog/FunctionDefinitionCatalog.java b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/catalog/FunctionDefinitionCatalog.java index e8708f80e8dd4..05f54d8d2e6b4 100644 --- a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/catalog/FunctionDefinitionCatalog.java +++ b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/catalog/FunctionDefinitionCatalog.java @@ -19,7 +19,7 @@ package org.apache.flink.table.expressions.catalog; import org.apache.flink.annotation.Internal; -import org.apache.flink.table.expressions.FunctionDefinition; +import org.apache.flink.table.functions.FunctionDefinition; import java.util.Optional; diff --git a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/OperationExpressionsUtils.java b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/OperationExpressionsUtils.java index 9105077a14af9..332aa71b86f87 100644 --- a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/OperationExpressionsUtils.java +++ b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/OperationExpressionsUtils.java @@ -23,10 +23,11 @@ import org.apache.flink.table.expressions.CallExpression; import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.FieldReferenceExpression; -import org.apache.flink.table.expressions.FunctionDefinition; import org.apache.flink.table.expressions.LocalReferenceExpression; import org.apache.flink.table.expressions.LookupCallExpression; import org.apache.flink.table.expressions.TableReferenceExpression; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; +import org.apache.flink.table.functions.FunctionDefinition; import java.util.LinkedHashMap; import java.util.List; @@ -37,11 +38,11 @@ import static org.apache.flink.table.expressions.ApiExpressionUtils.call; import static org.apache.flink.table.expressions.ApiExpressionUtils.unresolvedRef; import static org.apache.flink.table.expressions.ApiExpressionUtils.valueLiteral; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.AS; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.WINDOW_PROPERTIES; import static org.apache.flink.table.expressions.ExpressionUtils.extractValue; import static org.apache.flink.table.expressions.ExpressionUtils.isFunctionOfType; -import static org.apache.flink.table.expressions.FunctionDefinition.Type.AGGREGATE_FUNCTION; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.AS; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.WINDOW_PROPERTIES; +import static org.apache.flink.table.functions.FunctionDefinition.Type.AGGREGATE_FUNCTION; /** * Utility methods for transforming {@link Expression} to use them in {@link QueryOperation}s. @@ -110,7 +111,7 @@ public static CategorizedExpressions extractAggregationsAndProperties(List{@link FieldReferenceExpression} *
  • {@link TableReferenceExpression}
  • *
  • {@link LocalReferenceExpression}
  • - *
  • {@link org.apache.flink.table.expressions.BuiltInFunctionDefinitions#AS}
  • + *
  • {@link BuiltInFunctionDefinitions#AS}
  • * * * @param expressions list of expressions to extract names from @@ -126,7 +127,7 @@ public static List> extractNames(List expressions) *
  • {@link FieldReferenceExpression}
  • *
  • {@link TableReferenceExpression}
  • *
  • {@link LocalReferenceExpression}
  • - *
  • {@link org.apache.flink.table.expressions.BuiltInFunctionDefinitions#AS}
  • + *
  • {@link BuiltInFunctionDefinitions#AS}
  • * * * @param expression expression to extract name from diff --git a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/typeutils/FieldInfoUtils.java b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/typeutils/FieldInfoUtils.java index 1804891681c0c..4e982fc570c20 100644 --- a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/typeutils/FieldInfoUtils.java +++ b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/typeutils/FieldInfoUtils.java @@ -29,11 +29,11 @@ import org.apache.flink.table.api.Types; import org.apache.flink.table.api.ValidationException; import org.apache.flink.table.expressions.ApiExpressionDefaultVisitor; -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions; import org.apache.flink.table.expressions.CallExpression; import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.ExpressionUtils; import org.apache.flink.table.expressions.UnresolvedReferenceExpression; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; import org.apache.flink.table.types.AtomicDataType; import org.apache.flink.table.types.DataType; import org.apache.flink.table.types.logical.LogicalTypeRoot; diff --git a/flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/operations/QueryOperationTest.java b/flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/operations/QueryOperationTest.java index 5253165b11e36..29c1a4262070f 100644 --- a/flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/operations/QueryOperationTest.java +++ b/flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/operations/QueryOperationTest.java @@ -20,9 +20,9 @@ import org.apache.flink.table.api.DataTypes; import org.apache.flink.table.api.TableSchema; -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions; import org.apache.flink.table.expressions.CallExpression; import org.apache.flink.table.expressions.FieldReferenceExpression; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; import org.junit.Test; diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/CallExpression.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/CallExpression.java index 6b8ae48027b40..396867db8b3af 100644 --- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/CallExpression.java +++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/CallExpression.java @@ -19,6 +19,7 @@ package org.apache.flink.table.expressions; import org.apache.flink.annotation.PublicEvolving; +import org.apache.flink.table.functions.FunctionDefinition; import org.apache.flink.util.Preconditions; import java.util.ArrayList; diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/ExpressionUtils.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/ExpressionUtils.java index 05797bd8b4744..29ef3b60c6b0d 100644 --- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/ExpressionUtils.java +++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/ExpressionUtils.java @@ -19,6 +19,7 @@ package org.apache.flink.table.expressions; import org.apache.flink.annotation.Internal; +import org.apache.flink.table.functions.FunctionDefinition; import java.util.Optional; diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/AggregateFunctionDefinition.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/AggregateFunctionDefinition.java similarity index 90% rename from flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/AggregateFunctionDefinition.java rename to flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/AggregateFunctionDefinition.java index 690f64eb6f8f9..a6440f8b691c7 100644 --- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/AggregateFunctionDefinition.java +++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/AggregateFunctionDefinition.java @@ -16,14 +16,13 @@ * limitations under the License. */ -package org.apache.flink.table.expressions; +package org.apache.flink.table.functions; import org.apache.flink.annotation.PublicEvolving; import org.apache.flink.api.common.typeinfo.TypeInformation; -import org.apache.flink.table.functions.UserDefinedAggregateFunction; import org.apache.flink.util.Preconditions; -import static org.apache.flink.table.expressions.FunctionDefinition.Type.AGGREGATE_FUNCTION; +import static org.apache.flink.table.functions.FunctionDefinition.Type.AGGREGATE_FUNCTION; /** * The function definition of an user-defined aggregate function. diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/BuiltInFunctionDefinitions.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/BuiltInFunctionDefinitions.java similarity index 98% rename from flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/BuiltInFunctionDefinitions.java rename to flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/BuiltInFunctionDefinitions.java index e74e1294ab3d9..6e4bc0f5a9333 100644 --- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/BuiltInFunctionDefinitions.java +++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/BuiltInFunctionDefinitions.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.flink.table.expressions; +package org.apache.flink.table.functions; import org.apache.flink.annotation.PublicEvolving; import org.apache.flink.table.api.TableException; @@ -29,9 +29,9 @@ import java.util.List; import java.util.Set; -import static org.apache.flink.table.expressions.FunctionDefinition.Type.AGGREGATE_FUNCTION; -import static org.apache.flink.table.expressions.FunctionDefinition.Type.OTHER_FUNCTION; -import static org.apache.flink.table.expressions.FunctionDefinition.Type.SCALAR_FUNCTION; +import static org.apache.flink.table.functions.FunctionDefinition.Type.AGGREGATE_FUNCTION; +import static org.apache.flink.table.functions.FunctionDefinition.Type.OTHER_FUNCTION; +import static org.apache.flink.table.functions.FunctionDefinition.Type.SCALAR_FUNCTION; /** * Dictionary of function definitions for all built-in functions. diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/FunctionDefinition.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/FunctionDefinition.java similarity index 97% rename from flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/FunctionDefinition.java rename to flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/FunctionDefinition.java index 4e5c91a7a9d4a..ac5249f9c040e 100644 --- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/FunctionDefinition.java +++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/FunctionDefinition.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.flink.table.expressions; +package org.apache.flink.table.functions; import org.apache.flink.annotation.PublicEvolving; import org.apache.flink.util.Preconditions; diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/ScalarFunctionDefinition.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/ScalarFunctionDefinition.java similarity index 87% rename from flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/ScalarFunctionDefinition.java rename to flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/ScalarFunctionDefinition.java index 6e488de08dac5..3cb14cd89f322 100644 --- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/ScalarFunctionDefinition.java +++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/ScalarFunctionDefinition.java @@ -16,13 +16,12 @@ * limitations under the License. */ -package org.apache.flink.table.expressions; +package org.apache.flink.table.functions; import org.apache.flink.annotation.PublicEvolving; -import org.apache.flink.table.functions.ScalarFunction; import org.apache.flink.util.Preconditions; -import static org.apache.flink.table.expressions.FunctionDefinition.Type.SCALAR_FUNCTION; +import static org.apache.flink.table.functions.FunctionDefinition.Type.SCALAR_FUNCTION; /** * The function definition of an user-defined scalar function. diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/TableFunctionDefinition.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/TableFunctionDefinition.java similarity index 89% rename from flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/TableFunctionDefinition.java rename to flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/TableFunctionDefinition.java index 0f195127d18b4..d6b42c05c8068 100644 --- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/expressions/TableFunctionDefinition.java +++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/TableFunctionDefinition.java @@ -16,14 +16,13 @@ * limitations under the License. */ -package org.apache.flink.table.expressions; +package org.apache.flink.table.functions; import org.apache.flink.annotation.PublicEvolving; import org.apache.flink.api.common.typeinfo.TypeInformation; -import org.apache.flink.table.functions.TableFunction; import org.apache.flink.util.Preconditions; -import static org.apache.flink.table.expressions.FunctionDefinition.Type.TABLE_FUNCTION; +import static org.apache.flink.table.functions.FunctionDefinition.Type.TABLE_FUNCTION; /** * The function definition of an user-defined table function. diff --git a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/expressions/ExpressionTest.java b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/expressions/ExpressionTest.java index fed4ce4a27a9f..3b92b79e97ab3 100644 --- a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/expressions/ExpressionTest.java +++ b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/expressions/ExpressionTest.java @@ -21,6 +21,7 @@ import org.apache.flink.table.api.DataTypes; import org.apache.flink.table.api.ValidationException; import org.apache.flink.table.functions.ScalarFunction; +import org.apache.flink.table.functions.ScalarFunctionDefinition; import org.junit.Rule; import org.junit.Test; @@ -32,8 +33,8 @@ import static java.util.Arrays.asList; import static java.util.Collections.singletonList; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.AND; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.EQUALS; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.AND; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.EQUALS; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/expressions/ExpressionBuilder.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/expressions/ExpressionBuilder.java index c8e4600aa481c..34580b190d540 100644 --- a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/expressions/ExpressionBuilder.java +++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/expressions/ExpressionBuilder.java @@ -18,29 +18,30 @@ package org.apache.flink.table.expressions; +import org.apache.flink.table.functions.FunctionDefinition; import org.apache.flink.table.types.DataType; import java.util.Arrays; import java.util.Collections; import java.util.List; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.AND; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.CAST; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.CONCAT; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.DIVIDE; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.EQUALS; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.GREATER_THAN; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.IF; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.IS_NULL; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.LESS_THAN; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.MINUS; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.MOD; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.NOT; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.OR; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.PLUS; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.REINTERPRET_CAST; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.TIMES; -import static org.apache.flink.table.expressions.InternalFunctionDefinitions.THROW_EXCEPTION; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.AND; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.CAST; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.CONCAT; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.DIVIDE; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.EQUALS; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.GREATER_THAN; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.IF; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.IS_NULL; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.LESS_THAN; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.MINUS; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.MOD; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.NOT; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.OR; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.PLUS; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.REINTERPRET_CAST; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.TIMES; +import static org.apache.flink.table.functions.InternalFunctionDefinitions.THROW_EXCEPTION; /** * Builder for {@link Expression}s. diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/expressions/RexNodeConverter.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/expressions/RexNodeConverter.java index e0c2c2759fa0e..e67c08af66c1c 100644 --- a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/expressions/RexNodeConverter.java +++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/expressions/RexNodeConverter.java @@ -23,6 +23,9 @@ import org.apache.flink.table.calcite.RexAggLocalVariable; import org.apache.flink.table.calcite.RexDistinctKeyVariable; import org.apache.flink.table.dataformat.Decimal; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; +import org.apache.flink.table.functions.FunctionDefinition; +import org.apache.flink.table.functions.InternalFunctionDefinitions; import org.apache.flink.table.functions.sql.FlinkSqlOperatorTable; import org.apache.flink.table.types.logical.BigIntType; import org.apache.flink.table.types.logical.DateType; diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/expressions/InternalFunctionDefinitions.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/functions/InternalFunctionDefinitions.java similarity index 88% rename from flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/expressions/InternalFunctionDefinitions.java rename to flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/functions/InternalFunctionDefinitions.java index 406a7444e7d14..80a3fd43531ea 100644 --- a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/expressions/InternalFunctionDefinitions.java +++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/functions/InternalFunctionDefinitions.java @@ -16,9 +16,9 @@ * limitations under the License. */ -package org.apache.flink.table.expressions; +package org.apache.flink.table.functions; -import static org.apache.flink.table.expressions.FunctionDefinition.Type.SCALAR_FUNCTION; +import static org.apache.flink.table.functions.FunctionDefinition.Type.SCALAR_FUNCTION; /** * Dictionary of function definitions for all internal used functions. diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/sources/TableSourceUtil.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/sources/TableSourceUtil.scala index 44aeb3c3ec3a4..8f084c2629ce1 100644 --- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/sources/TableSourceUtil.scala +++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/sources/TableSourceUtil.scala @@ -18,27 +18,27 @@ package org.apache.flink.table.sources +import java.sql.Timestamp + +import com.google.common.collect.ImmutableList +import org.apache.calcite.plan.RelOptCluster +import org.apache.calcite.rel.RelNode +import org.apache.calcite.rel.`type`.RelDataType +import org.apache.calcite.rel.logical.LogicalValues +import org.apache.calcite.rex.{RexLiteral, RexNode} +import org.apache.calcite.tools.RelBuilder import org.apache.flink.api.common.typeinfo.TypeInformation import org.apache.flink.api.common.typeutils.CompositeType import org.apache.flink.table.api.{DataTypes, ValidationException} import org.apache.flink.table.calcite.FlinkTypeFactory -import org.apache.flink.table.expressions.{BuiltInFunctionDefinitions, CallExpression, PlannerResolvedFieldReference, ResolvedFieldReference, RexNodeConverter, TypeLiteralExpression} +import org.apache.flink.table.expressions._ +import org.apache.flink.table.functions.BuiltInFunctionDefinitions import org.apache.flink.table.types.LogicalTypeDataTypeConverter import org.apache.flink.table.types.TypeInfoLogicalTypeConverter.fromTypeInfoToLogicalType import org.apache.flink.table.types.logical.{LogicalType, TimestampKind, TimestampType, TinyIntType} import org.apache.flink.table.types.utils.TypeConversions.fromDataTypeToLegacyInfo import org.apache.flink.table.typeutils.TimeIndicatorTypeInfo -import com.google.common.collect.ImmutableList -import org.apache.calcite.plan.RelOptCluster -import org.apache.calcite.rel.RelNode -import org.apache.calcite.rel.`type`.RelDataType -import org.apache.calcite.rel.logical.LogicalValues -import org.apache.calcite.rex.{RexLiteral, RexNode} -import org.apache.calcite.tools.RelBuilder - -import java.sql.Timestamp - import scala.collection.JavaConversions._ /** Util class for [[TableSource]]. */ diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/sources/tsextractors/ExistingField.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/sources/tsextractors/ExistingField.scala index 7e872d054050c..70796a3725b4f 100644 --- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/sources/tsextractors/ExistingField.scala +++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/sources/tsextractors/ExistingField.scala @@ -22,6 +22,7 @@ import org.apache.flink.api.common.typeinfo.TypeInformation import org.apache.flink.table.api.{Types, ValidationException} import org.apache.flink.table.descriptors.Rowtime import org.apache.flink.table.expressions._ +import org.apache.flink.table.functions.BuiltInFunctionDefinitions import org.apache.flink.table.types.utils.TypeConversions.fromLegacyInfoToDataType import java.util diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/validate/FunctionCatalog.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/validate/FunctionCatalog.scala index c48c4e6e14d35..3118e09c4c7e6 100644 --- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/validate/FunctionCatalog.scala +++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/validate/FunctionCatalog.scala @@ -18,17 +18,15 @@ package org.apache.flink.table.validate +import java.util + +import org.apache.calcite.sql._ import org.apache.flink.table.calcite.FlinkTypeFactory -import org.apache.flink.table.expressions._ import org.apache.flink.table.functions.utils.UserDefinedFunctionUtils.{createAggregateSqlFunction, createScalarSqlFunction, createTableSqlFunction} -import org.apache.flink.table.functions.{AggregateFunction, ScalarFunction, TableFunction} +import org.apache.flink.table.functions.{AggregateFunction, ScalarFunction, TableFunction, _} import org.apache.flink.table.types.DataType import org.apache.flink.table.types.TypeInfoDataTypeConverter.fromDataTypeToTypeInfo -import org.apache.calcite.sql._ - -import java.util - import _root_.scala.collection.JavaConversions._ /** diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/catalog/FunctionCatalogOperatorTable.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/catalog/FunctionCatalogOperatorTable.java index 8267b3633f1ab..fd81ae1a42986 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/catalog/FunctionCatalogOperatorTable.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/catalog/FunctionCatalogOperatorTable.java @@ -20,10 +20,10 @@ import org.apache.flink.annotation.Internal; import org.apache.flink.table.calcite.FlinkTypeFactory; -import org.apache.flink.table.expressions.AggregateFunctionDefinition; -import org.apache.flink.table.expressions.FunctionDefinition; -import org.apache.flink.table.expressions.ScalarFunctionDefinition; -import org.apache.flink.table.expressions.TableFunctionDefinition; +import org.apache.flink.table.functions.AggregateFunctionDefinition; +import org.apache.flink.table.functions.FunctionDefinition; +import org.apache.flink.table.functions.ScalarFunctionDefinition; +import org.apache.flink.table.functions.TableFunctionDefinition; import org.apache.flink.table.functions.utils.UserDefinedFunctionUtils; import org.apache.calcite.sql.SqlFunction; diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/ExpressionResolver.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/ExpressionResolver.java index 125a88b0fce01..8668646ffa149 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/ExpressionResolver.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/ExpressionResolver.java @@ -32,6 +32,7 @@ import org.apache.flink.table.expressions.lookups.TableReferenceLookup; import org.apache.flink.table.expressions.rules.ResolverRule; import org.apache.flink.table.expressions.rules.ResolverRules; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; import org.apache.flink.table.operations.QueryOperation; import org.apache.flink.table.plan.logical.LogicalOverWindow; import org.apache.flink.table.plan.logical.LogicalWindow; diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/ExpandColumnFunctionsRule.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/ExpandColumnFunctionsRule.java index 5f63857986e83..622c3ab7fc952 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/ExpandColumnFunctionsRule.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/ExpandColumnFunctionsRule.java @@ -34,10 +34,10 @@ import java.util.List; import java.util.stream.Collectors; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.AS; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.RANGE_TO; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.WITHOUT_COLUMNS; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.WITH_COLUMNS; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.AS; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.RANGE_TO; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.WITHOUT_COLUMNS; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.WITH_COLUMNS; /** * Replaces column functions with all available {@link org.apache.flink.table.expressions.UnresolvedReferenceExpression}s diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/FlattenCallRule.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/FlattenCallRule.java index 5a4020f65219a..c6a041b62786e 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/FlattenCallRule.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/FlattenCallRule.java @@ -21,10 +21,10 @@ import org.apache.flink.annotation.Internal; import org.apache.flink.api.common.typeinfo.TypeInformation; import org.apache.flink.api.common.typeutils.CompositeType; -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions; import org.apache.flink.table.expressions.CallExpression; import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.PlannerExpression; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; import java.util.List; import java.util.stream.Collectors; @@ -33,7 +33,7 @@ import static java.util.Arrays.asList; import static java.util.Collections.singletonList; import static org.apache.flink.table.expressions.ApiExpressionUtils.valueLiteral; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.GET; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.GET; /** * Replaces {@link BuiltInFunctionDefinitions#FLATTEN} with calls to {@link BuiltInFunctionDefinitions#GET} for all diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/LookupCallByNameRule.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/LookupCallByNameRule.java index 4f76f08e30bce..ce6cf977c92e9 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/LookupCallByNameRule.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/LookupCallByNameRule.java @@ -21,13 +21,14 @@ import org.apache.flink.annotation.Internal; import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.LookupCallResolver; +import org.apache.flink.table.functions.FunctionDefinition; import java.util.List; import java.util.stream.Collectors; /** * Resolves {@link org.apache.flink.table.expressions.LookupCallExpression} to - * a corresponding {@link org.apache.flink.table.expressions.FunctionDefinition}. + * a corresponding {@link FunctionDefinition}. */ @Internal final class LookupCallByNameRule implements ResolverRule { diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/OverWindowResolverRule.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/OverWindowResolverRule.java index ca726c0c977f8..edea300bdcefd 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/OverWindowResolverRule.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/OverWindowResolverRule.java @@ -21,10 +21,10 @@ import org.apache.flink.annotation.Internal; import org.apache.flink.api.common.typeinfo.BasicTypeInfo; import org.apache.flink.table.api.ValidationException; -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions; import org.apache.flink.table.expressions.CallExpression; import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.PlannerExpression; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; import org.apache.flink.table.plan.logical.LogicalOverWindow; import java.util.ArrayList; diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/ResolveCallByArgumentsRule.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/ResolveCallByArgumentsRule.java index 46c18344f01f3..b1165a4413985 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/ResolveCallByArgumentsRule.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/ResolveCallByArgumentsRule.java @@ -21,11 +21,11 @@ import org.apache.flink.annotation.Internal; import org.apache.flink.api.common.typeinfo.TypeInformation; import org.apache.flink.table.api.ValidationException; -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions; import org.apache.flink.table.expressions.CallExpression; import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.InputTypeSpec; import org.apache.flink.table.expressions.PlannerExpression; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; import org.apache.flink.table.typeutils.TypeCoercion; import org.apache.flink.table.validate.ValidationFailure; import org.apache.flink.table.validate.ValidationResult; diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/ResolverRule.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/ResolverRule.java index 119ae63eb41ec..5c446facc6120 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/ResolverRule.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/ResolverRule.java @@ -25,6 +25,7 @@ import org.apache.flink.table.expressions.catalog.FunctionDefinitionCatalog; import org.apache.flink.table.expressions.lookups.FieldReferenceLookup; import org.apache.flink.table.expressions.lookups.TableReferenceLookup; +import org.apache.flink.table.functions.FunctionDefinition; import org.apache.flink.table.plan.logical.LogicalOverWindow; import java.util.List; @@ -57,7 +58,7 @@ interface ResolutionContext { TableReferenceLookup tableLookup(); /** - * Access to available {@link org.apache.flink.table.expressions.FunctionDefinition}s. + * Access to available {@link FunctionDefinition}s. */ FunctionDefinitionCatalog functionDefinitionLookup(); diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/VerifyNoUnresolvedExpressionsRule.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/VerifyNoUnresolvedExpressionsRule.java index f184ef0d0f4e6..81b549818bab3 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/VerifyNoUnresolvedExpressionsRule.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/VerifyNoUnresolvedExpressionsRule.java @@ -25,20 +25,21 @@ import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.LookupCallExpression; import org.apache.flink.table.expressions.UnresolvedReferenceExpression; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; import java.util.List; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.FLATTEN; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.OVER; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.FLATTEN; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.OVER; /** * Verifies that there is no more unresolved expressions. Checks for expression like: *
      *
    • {@link UnresolvedReferenceExpression}
    • *
    • {@link LookupCallExpression}
    • - *
    • {@link org.apache.flink.table.expressions.BuiltInFunctionDefinitions#OVER} that still contains + *
    • {@link BuiltInFunctionDefinitions#OVER} that still contains * just alias to corresponding window
    • - *
    • {@link org.apache.flink.table.expressions.BuiltInFunctionDefinitions#FLATTEN}
    • + *
    • {@link BuiltInFunctionDefinitions#FLATTEN}
    • *
    */ @Internal diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/AggregateOperationFactory.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/AggregateOperationFactory.java index bdc289b8306e3..89ddbb6978f8e 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/AggregateOperationFactory.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/AggregateOperationFactory.java @@ -31,20 +31,20 @@ import org.apache.flink.table.api.TumbleWithSizeOnTimeWithAlias; import org.apache.flink.table.api.ValidationException; import org.apache.flink.table.expressions.AggFunctionCall; -import org.apache.flink.table.expressions.AggregateFunctionDefinition; import org.apache.flink.table.expressions.ApiExpressionDefaultVisitor; -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions; import org.apache.flink.table.expressions.CallExpression; import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.ExpressionBridge; import org.apache.flink.table.expressions.ExpressionResolver; import org.apache.flink.table.expressions.ExpressionUtils; import org.apache.flink.table.expressions.FieldReferenceExpression; -import org.apache.flink.table.expressions.FunctionDefinition; import org.apache.flink.table.expressions.PlannerExpression; import org.apache.flink.table.expressions.UnresolvedReferenceExpression; import org.apache.flink.table.expressions.ValueLiteralExpression; import org.apache.flink.table.functions.AggregateFunction; +import org.apache.flink.table.functions.AggregateFunctionDefinition; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; +import org.apache.flink.table.functions.FunctionDefinition; import org.apache.flink.table.functions.TableAggregateFunction; import org.apache.flink.table.functions.utils.UserDefinedFunctionUtils; import org.apache.flink.table.operations.WindowAggregateQueryOperation.ResolvedGroupWindow; @@ -62,9 +62,9 @@ import static java.util.Collections.singletonList; import static java.util.stream.Collectors.toList; import static org.apache.flink.api.common.typeinfo.BasicTypeInfo.LONG_TYPE_INFO; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.AS; import static org.apache.flink.table.expressions.ExpressionUtils.isFunctionOfType; -import static org.apache.flink.table.expressions.FunctionDefinition.Type.AGGREGATE_FUNCTION; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.AS; +import static org.apache.flink.table.functions.FunctionDefinition.Type.AGGREGATE_FUNCTION; import static org.apache.flink.table.operations.OperationExpressionsUtils.extractName; import static org.apache.flink.table.operations.WindowAggregateQueryOperation.ResolvedGroupWindow.WindowType.SLIDE; import static org.apache.flink.table.operations.WindowAggregateQueryOperation.ResolvedGroupWindow.WindowType.TUMBLE; diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/AliasOperationUtils.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/AliasOperationUtils.java index 9ac9fe9998f08..8be8e7ad950bc 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/AliasOperationUtils.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/AliasOperationUtils.java @@ -22,12 +22,12 @@ import org.apache.flink.table.api.TableSchema; import org.apache.flink.table.api.ValidationException; import org.apache.flink.table.expressions.ApiExpressionDefaultVisitor; -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions; import org.apache.flink.table.expressions.CallExpression; import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.ExpressionUtils; import org.apache.flink.table.expressions.UnresolvedReferenceExpression; import org.apache.flink.table.expressions.ValueLiteralExpression; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; import java.util.Arrays; import java.util.List; diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/CalculatedTableFactory.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/CalculatedTableFactory.java index 332afd925de2f..fdc889e31f64b 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/CalculatedTableFactory.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/CalculatedTableFactory.java @@ -26,17 +26,17 @@ import org.apache.flink.table.expressions.CallExpression; import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.ExpressionUtils; -import org.apache.flink.table.expressions.FunctionDefinition; -import org.apache.flink.table.expressions.TableFunctionDefinition; +import org.apache.flink.table.functions.FunctionDefinition; +import org.apache.flink.table.functions.TableFunctionDefinition; import org.apache.flink.table.typeutils.FieldInfoUtils; import java.util.Collections; import java.util.List; import static java.util.stream.Collectors.toList; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.AS; import static org.apache.flink.table.expressions.ExpressionUtils.isFunctionOfType; -import static org.apache.flink.table.expressions.FunctionDefinition.Type.TABLE_FUNCTION; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.AS; +import static org.apache.flink.table.functions.FunctionDefinition.Type.TABLE_FUNCTION; /** * Utility class for creating a valid {@link CalculatedQueryOperation} operation. diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ColumnOperationUtils.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ColumnOperationUtils.java index 40932e90f936f..236cad20ab19d 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ColumnOperationUtils.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ColumnOperationUtils.java @@ -33,7 +33,7 @@ import java.util.stream.Collectors; import static java.lang.String.format; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.AS; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.AS; import static org.apache.flink.table.operations.OperationExpressionsUtils.extractName; /** diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/JoinOperationFactory.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/JoinOperationFactory.java index 11105a0eced4f..757600432d017 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/JoinOperationFactory.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/JoinOperationFactory.java @@ -23,13 +23,13 @@ import org.apache.flink.api.common.typeinfo.Types; import org.apache.flink.table.api.ValidationException; import org.apache.flink.table.expressions.ApiExpressionDefaultVisitor; -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions; import org.apache.flink.table.expressions.CallExpression; import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.ExpressionBridge; import org.apache.flink.table.expressions.ExpressionUtils; import org.apache.flink.table.expressions.FieldReferenceExpression; import org.apache.flink.table.expressions.PlannerExpression; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; import org.apache.flink.table.operations.JoinQueryOperation.JoinType; import java.util.HashSet; diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ProjectionOperationFactory.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ProjectionOperationFactory.java index c5fd686e32716..4f9c73a3ccda5 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ProjectionOperationFactory.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/ProjectionOperationFactory.java @@ -24,16 +24,16 @@ import org.apache.flink.table.api.TableSchema; import org.apache.flink.table.api.ValidationException; import org.apache.flink.table.expressions.ApiExpressionDefaultVisitor; -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions; import org.apache.flink.table.expressions.CallExpression; import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.ExpressionBridge; import org.apache.flink.table.expressions.FieldReferenceExpression; -import org.apache.flink.table.expressions.FunctionDefinition; import org.apache.flink.table.expressions.LocalReferenceExpression; import org.apache.flink.table.expressions.PlannerExpression; import org.apache.flink.table.expressions.TableReferenceExpression; import org.apache.flink.table.expressions.ValueLiteralExpression; +import org.apache.flink.table.functions.BuiltInFunctionDefinitions; +import org.apache.flink.table.functions.FunctionDefinition; import org.apache.flink.table.types.logical.LogicalType; import java.util.Arrays; @@ -45,9 +45,9 @@ import java.util.stream.IntStream; import static org.apache.flink.table.expressions.ApiExpressionUtils.valueLiteral; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.AS; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.CAST; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.GET; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.AS; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.CAST; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.GET; import static org.apache.flink.table.operations.OperationExpressionsUtils.extractName; import static org.apache.flink.table.operations.OperationExpressionsUtils.extractNames; import static org.apache.flink.table.types.logical.LogicalTypeRoot.INTEGER; diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/SortOperationFactory.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/SortOperationFactory.java index 7fe3947590045..c710bfcaa3040 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/SortOperationFactory.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/SortOperationFactory.java @@ -28,8 +28,8 @@ import java.util.stream.Collectors; import static java.util.Collections.singletonList; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.ORDERING; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.ORDER_ASC; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.ORDERING; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.ORDER_ASC; /** * Utility class for creating a valid {@link SortQueryOperation} operation. diff --git a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/plan/QueryOperationConverter.java b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/plan/QueryOperationConverter.java index 5bc820629f248..94eb829295df8 100644 --- a/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/plan/QueryOperationConverter.java +++ b/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/plan/QueryOperationConverter.java @@ -91,10 +91,10 @@ import static java.util.Arrays.asList; import static java.util.stream.Collectors.toList; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.AS; import static org.apache.flink.table.expressions.ExpressionUtils.extractValue; import static org.apache.flink.table.expressions.ExpressionUtils.isFunctionOfType; -import static org.apache.flink.table.expressions.FunctionDefinition.Type.AGGREGATE_FUNCTION; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.AS; +import static org.apache.flink.table.functions.FunctionDefinition.Type.AGGREGATE_FUNCTION; import static org.apache.flink.table.types.utils.TypeConversions.fromDataTypeToLegacyInfo; /** diff --git a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/BatchTableEnvImpl.scala b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/BatchTableEnvImpl.scala index e7900c36c22ac..6073598bc98b1 100644 --- a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/BatchTableEnvImpl.scala +++ b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/BatchTableEnvImpl.scala @@ -29,8 +29,8 @@ import org.apache.flink.table.calcite.{CalciteConfig, FlinkTypeFactory} import org.apache.flink.table.catalog.CatalogManager import org.apache.flink.table.descriptors.{BatchTableDescriptor, ConnectorDescriptor} import org.apache.flink.table.explain.PlanJsonParser -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions.TIME_ATTRIBUTES import org.apache.flink.table.expressions.{CallExpression, Expression, ExpressionDefaultVisitor} +import org.apache.flink.table.functions.BuiltInFunctionDefinitions.TIME_ATTRIBUTES import org.apache.flink.table.operations.DataSetQueryOperation import org.apache.flink.table.plan.BatchOptimizer import org.apache.flink.table.plan.nodes.dataset.DataSetRel diff --git a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala index 4cf6e3d3c5c10..bf3d8a379d2be 100644 --- a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala +++ b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala @@ -25,9 +25,9 @@ import java.time.{LocalDate, LocalDateTime} import org.apache.flink.api.common.typeinfo.{SqlTimeTypeInfo, TypeInformation} import org.apache.flink.table.api.{DataTypes, Over, Table, ValidationException} import org.apache.flink.table.expressions.ApiExpressionUtils._ -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions.{RANGE_TO, WITH_COLUMNS, E => FDE, UUID => FDUUID, _} import org.apache.flink.table.expressions._ -import org.apache.flink.table.functions.{ScalarFunction, TableFunction, UserDefinedAggregateFunction, UserFunctionsTypeHelper} +import org.apache.flink.table.functions.BuiltInFunctionDefinitions.{RANGE_TO, WITH_COLUMNS, E => FDE, UUID => FDUUID, _} +import org.apache.flink.table.functions.{ScalarFunction, TableFunction, UserDefinedAggregateFunction, UserFunctionsTypeHelper, _} import org.apache.flink.table.types.DataType import org.apache.flink.table.types.utils.TypeConversions import org.apache.flink.table.types.utils.TypeConversions.fromLegacyInfoToDataType diff --git a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionConverter.scala b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionConverter.scala index 2b90dbbd3a319..7c046f78a666a 100644 --- a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionConverter.scala +++ b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionConverter.scala @@ -20,8 +20,9 @@ package org.apache.flink.table.expressions import org.apache.flink.api.common.typeinfo.{TypeInformation, Types} import org.apache.flink.table.api.{TableException, ValidationException} -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions._ +import org.apache.flink.table.functions.BuiltInFunctionDefinitions._ import org.apache.flink.table.expressions.{E => PlannerE, UUID => PlannerUUID} +import org.apache.flink.table.functions._ import org.apache.flink.table.types.logical.LogicalTypeRoot.{CHAR, DECIMAL, SYMBOL, TIMESTAMP_WITHOUT_TIME_ZONE} import org.apache.flink.table.types.logical.utils.LogicalTypeChecks._ import org.apache.flink.table.types.utils.TypeConversions.fromDataTypeToLegacyInfo diff --git a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionParserImpl.scala b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionParserImpl.scala index 169c27cf0e482..c615aa305e1ec 100644 --- a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionParserImpl.scala +++ b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/expressions/PlannerExpressionParserImpl.scala @@ -23,6 +23,7 @@ import _root_.java.util.{List => JList} import org.apache.flink.api.common.typeinfo.{SqlTimeTypeInfo, TypeInformation} import org.apache.flink.table.api._ import org.apache.flink.table.expressions.ApiExpressionUtils._ +import org.apache.flink.table.functions.BuiltInFunctionDefinitions import org.apache.flink.table.types.utils.TypeConversions.fromLegacyInfoToDataType import _root_.scala.collection.JavaConversions._ diff --git a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/operations/OperationTreeBuilder.scala b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/operations/OperationTreeBuilder.scala index 17e97918eecb1..bfa4218f38206 100644 --- a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/operations/OperationTreeBuilder.scala +++ b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/operations/OperationTreeBuilder.scala @@ -24,7 +24,7 @@ import org.apache.flink.table.api._ import org.apache.flink.table.expressions.ApiExpressionUtils.{call, valueLiteral} import org.apache.flink.table.expressions.ExpressionResolver.resolverFor import org.apache.flink.table.expressions.ExpressionUtils.isFunctionOfType -import org.apache.flink.table.expressions.FunctionDefinition.Type.{SCALAR_FUNCTION, TABLE_FUNCTION} +import org.apache.flink.table.functions.FunctionDefinition.Type.{SCALAR_FUNCTION, TABLE_FUNCTION} import org.apache.flink.table.expressions._ import org.apache.flink.table.expressions.catalog.FunctionDefinitionCatalog import org.apache.flink.table.expressions.lookups.TableReferenceLookup @@ -33,6 +33,7 @@ import org.apache.flink.table.operations.AliasOperationUtils.createAliasList import JoinQueryOperation.JoinType import org.apache.flink.table.operations.OperationExpressionsUtils.extractAggregationsAndProperties import SetQueryOperation.SetQueryOperationType._ +import org.apache.flink.table.functions.{AggregateFunctionDefinition, BuiltInFunctionDefinitions, TableFunctionDefinition} import org.apache.flink.table.util.JavaScalaConversionUtil import org.apache.flink.table.util.JavaScalaConversionUtil.toScala import org.apache.flink.util.Preconditions diff --git a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/util/RexProgramExtractor.scala b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/util/RexProgramExtractor.scala index 1f708a987bd85..a18d4564174f0 100644 --- a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/util/RexProgramExtractor.scala +++ b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/util/RexProgramExtractor.scala @@ -38,7 +38,7 @@ import org.slf4j.{Logger, LoggerFactory} import scala.collection.JavaConversions._ import scala.collection.JavaConverters._ import scala.collection.mutable -import scala.util.{Failure, Success, Try} +import scala.util.Try object RexProgramExtractor { diff --git a/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/expressions/rules/VerifyNoUnresolvedExpressionsRuleTest.java b/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/expressions/rules/VerifyNoUnresolvedExpressionsRuleTest.java index e4f7b59b5ad0b..46ef273f5e80b 100644 --- a/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/expressions/rules/VerifyNoUnresolvedExpressionsRuleTest.java +++ b/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/expressions/rules/VerifyNoUnresolvedExpressionsRuleTest.java @@ -35,10 +35,10 @@ import static org.apache.flink.table.expressions.ApiExpressionUtils.lookupCall; import static org.apache.flink.table.expressions.ApiExpressionUtils.unresolvedRef; import static org.apache.flink.table.expressions.ApiExpressionUtils.valueLiteral; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.AS; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.COUNT; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.FLATTEN; -import static org.apache.flink.table.expressions.BuiltInFunctionDefinitions.OVER; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.AS; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.COUNT; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.FLATTEN; +import static org.apache.flink.table.functions.BuiltInFunctionDefinitions.OVER; import static org.mockito.Mockito.mock; /** diff --git a/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/sql/AggregateTest.scala b/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/sql/AggregateTest.scala index 50d9c673c9c3e..85ed34557755b 100644 --- a/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/sql/AggregateTest.scala +++ b/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/sql/AggregateTest.scala @@ -24,8 +24,7 @@ import org.apache.flink.api.scala._ import org.apache.flink.api.scala.typeutils.CaseClassTypeInfo import org.apache.flink.table.api.Types import org.apache.flink.table.api.scala._ -import org.apache.flink.table.expressions.AggregateFunctionDefinition -import org.apache.flink.table.functions.AggregateFunction +import org.apache.flink.table.functions.{AggregateFunction, AggregateFunctionDefinition} import org.apache.flink.table.utils.TableTestUtil.{streamTableNode, term, unaryNode} import org.apache.flink.table.utils.{StreamTableTestUtil, TableTestBase} import org.apache.flink.types.Row diff --git a/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/validation/ColumnFunctionsValidationTest.scala b/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/validation/ColumnFunctionsValidationTest.scala index 09f962bd4045f..39aa182583bd6 100644 --- a/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/validation/ColumnFunctionsValidationTest.scala +++ b/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/validation/ColumnFunctionsValidationTest.scala @@ -20,7 +20,7 @@ package org.apache.flink.table.api.validation import org.apache.flink.api.scala._ import org.apache.flink.table.api.{Slide, TableException, ValidationException} import org.apache.flink.table.api.scala._ -import org.apache.flink.table.expressions.BuiltInFunctionDefinitions +import org.apache.flink.table.functions.BuiltInFunctionDefinitions import org.apache.flink.table.utils.{StreamTableTestUtil, TableTestBase} import org.junit.Test diff --git a/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/expressions/KeywordParseTest.scala b/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/expressions/KeywordParseTest.scala index 5b7bb7e426d70..9a7ff7590907d 100644 --- a/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/expressions/KeywordParseTest.scala +++ b/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/expressions/KeywordParseTest.scala @@ -18,7 +18,8 @@ package org.apache.flink.table.expressions -import org.apache.flink.table.expressions.ApiExpressionUtils.{call, unresolvedRef, lookupCall} +import org.apache.flink.table.expressions.ApiExpressionUtils.{call, lookupCall, unresolvedRef} +import org.apache.flink.table.functions.BuiltInFunctionDefinitions import org.junit.Assert.assertEquals import org.junit.Test diff --git a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/types/TypeInfoDataTypeConverter.java b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/types/TypeInfoDataTypeConverter.java index 52ac272080787..5d984d2e302c1 100644 --- a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/types/TypeInfoDataTypeConverter.java +++ b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/types/TypeInfoDataTypeConverter.java @@ -28,8 +28,8 @@ import org.apache.flink.table.dataformat.BaseRow; import org.apache.flink.table.dataformat.BinaryString; import org.apache.flink.table.dataformat.Decimal; -import org.apache.flink.table.expressions.AggregateFunctionDefinition; -import org.apache.flink.table.expressions.TableFunctionDefinition; +import org.apache.flink.table.functions.AggregateFunctionDefinition; +import org.apache.flink.table.functions.TableFunctionDefinition; import org.apache.flink.table.types.logical.DecimalType; import org.apache.flink.table.types.logical.LogicalType; import org.apache.flink.table.types.logical.RowType; @@ -54,9 +54,9 @@ * 3.Deal with Decimal. * *

    This class is for: - * 1.See {@link TableFunctionDefinition#resultType}. - * 2.See {@link AggregateFunctionDefinition#accumulatorTypeInfo}. - * 3.See {@link MapViewTypeInfo#keyType}. + * 1.See {@link TableFunctionDefinition#getResultType()}. + * 2.See {@link AggregateFunctionDefinition#getAccumulatorTypeInfo()}. + * 3.See {@link MapViewTypeInfo#getKeyType()}. */ @Deprecated public class TypeInfoDataTypeConverter {