You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tw...@apache.org on 2019/11/26 11:54:06 UTC
[flink] branch master updated: [FLINK-14904][table] Rename ANY type
to RAW type
This is an automated email from the ASF dual-hosted git repository.
twalthr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new d95e2c1 [FLINK-14904][table] Rename ANY type to RAW type
d95e2c1 is described below
commit d95e2c15e3289ddec3823e386b33ae50737143e4
Author: Timo Walther <tw...@apache.org>
AuthorDate: Sat Nov 23 07:49:57 2019 +0100
[FLINK-14904][table] Rename ANY type to RAW type
Note: "RAW" is a reserved keyword now.
This closes #10308.
---
docs/dev/table/sql.md | 4 +--
docs/dev/table/types.md | 18 +++++-----
.../src/main/codegen/data/Parser.tdd | 1 +
.../utils/factories/AggregateOperationFactory.java | 4 +--
.../java/org/apache/flink/table/api/DataTypes.java | 36 ++++++++++++++------
.../types/logical/LegacyTypeInformationType.java | 4 +--
.../flink/table/types/logical/LogicalTypeRoot.java | 4 +--
.../table/types/logical/LogicalTypeVisitor.java | 4 +--
.../types/logical/{AnyType.java => RawType.java} | 22 ++++++-------
...ionAnyType.java => TypeInformationRawType.java} | 30 ++++++++---------
.../types/logical/utils/LogicalTypeCasts.java | 6 ++--
.../logical/utils/LogicalTypeDefaultVisitor.java | 6 ++--
.../logical/utils/LogicalTypeGeneralization.java | 16 ++++-----
.../types/logical/utils/LogicalTypeParser.java | 16 ++++-----
.../utils/LegacyTypeInfoDataTypeConverter.java | 20 ++++++------
.../types/utils/LogicalTypeDataTypeConverter.java | 6 ++--
.../apache/flink/table/types/DataTypesTest.java | 14 ++++----
.../types/LegacyTypeInfoDataTypeConverterTest.java | 2 +-
.../flink/table/types/LogicalTypeCastsTest.java | 10 +++---
.../types/LogicalTypeCompatibleCheckTest.java | 6 ++--
.../flink/table/types/LogicalTypeParserTest.java | 14 ++++----
.../apache/flink/table/types/LogicalTypesTest.java | 30 ++++++++---------
.../FirstValueWithRetractAggFunction.java | 6 ++--
.../LastValueWithRetractAggFunction.java | 6 ++--
.../table/planner/calcite/FlinkTypeFactory.scala | 12 +++----
.../flink/table/planner/codegen/CodeGenUtils.scala | 12 +++----
.../table/planner/codegen/ExprCodeGenerator.scala | 4 +--
.../table/planner/codegen/GenerateUtils.scala | 12 +++----
.../planner/codegen/calls/FunctionGenerator.scala | 38 +++++++++++-----------
.../planner/codegen/calls/ScalarOperatorGens.scala | 2 +-
.../functions/utils/UserDefinedFunctionUtils.scala | 6 ++--
.../plan/nodes/common/CommonLookupJoin.scala | 6 ++--
.../planner/plan/schema/GenericRelDataType.scala | 13 ++++----
.../planner/plan/utils/AggFunctionFactory.scala | 2 +-
.../planner/codegen/SortCodeGeneratorTest.java | 16 ++++-----
.../flink/table/calcite/FlinkTypeFactory.scala | 4 +--
.../flink/table/dataformat/BinaryWriter.java | 2 +-
.../table/dataformat/DataFormatConverters.java | 6 ++--
.../flink/table/dataformat/TypeGetterSetters.java | 2 +-
.../runtime/types/ClassLogicalTypeConverter.java | 2 +-
.../table/runtime/types/InternalSerializers.java | 6 ++--
.../types/LogicalTypeDataTypeConverter.java | 4 +--
.../table/runtime/typeutils/TypeCheckUtils.java | 10 +++---
.../flink/table/dataformat/NestedRowTest.java | 2 +-
.../runtime/types/LogicalTypeAssignableTest.java | 6 ++--
.../runtime/typeutils/BaseArraySerializerTest.java | 2 +-
.../runtime/typeutils/BaseMapSerializerTest.java | 4 +--
47 files changed, 237 insertions(+), 221 deletions(-)
diff --git a/docs/dev/table/sql.md b/docs/dev/table/sql.md
index f40c706..1895ba6 100644
--- a/docs/dev/table/sql.md
+++ b/docs/dev/table/sql.md
@@ -1446,7 +1446,7 @@ Generic types are treated as a black box and can be passed on or processed by [u
For DDLs, we support full data types defined in page [Data Types]({{ site.baseurl }}/dev/table/types.html).
-**Notes:** Some of the data types are not supported in the sql query(the cast expression or literals). E.G. `STRING`, `BYTES`, `TIME(p) WITHOUT TIME ZONE`, `TIME(p) WITH LOCAL TIME ZONE`, `TIMESTAMP(p) WITHOUT TIME ZONE`, `TIMESTAMP(p) WITH LOCAL TIME ZONE`, `ARRAY`, `MULTISET`, `ROW`.
+**Notes:** Some of the data types are not supported in SQL queries yet (i.e. in cast expressions or literals). E.g. `STRING`, `BYTES`, `RAW`, `TIME(p) WITHOUT TIME ZONE`, `TIME(p) WITH LOCAL TIME ZONE`, `TIMESTAMP(p) WITHOUT TIME ZONE`, `TIMESTAMP(p) WITH LOCAL TIME ZONE`, `ARRAY`, `MULTISET`, `ROW`.
{% top %}
@@ -1456,7 +1456,7 @@ Although not every SQL feature is implemented yet, some string combinations are
{% highlight sql %}
-A, ABS, ABSOLUTE, ACTION, ADA, ADD, ADMIN, AFTER, ALL, ALLOCATE, ALLOW, ALTER, ALWAYS, AND, ANY, ARE, ARRAY, AS, ASC, ASENSITIVE, ASSERTION, ASSIGNMENT, ASYMMETRIC, AT, ATOMIC, ATTRIBUTE, ATTRIBUTES, AUTHORIZATION, AVG, BEFORE, BEGIN, BERNOULLI, BETWEEN, BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOTH, BREADTH, BY, BYTES, C, CALL, CALLED, CARDINALITY, CASCADE, CASCADED, CASE, CAST, CATALOG, CATALOG_NAME, CEIL, CEILING, CENTURY, CHAIN, CHAR, CHARACTER, CHARACTERISTICS, CHARACTERS, CHARACTER_LENG [...]
+A, ABS, ABSOLUTE, ACTION, ADA, ADD, ADMIN, AFTER, ALL, ALLOCATE, ALLOW, ALTER, ALWAYS, AND, ANY, ARE, ARRAY, AS, ASC, ASENSITIVE, ASSERTION, ASSIGNMENT, ASYMMETRIC, AT, ATOMIC, ATTRIBUTE, ATTRIBUTES, AUTHORIZATION, AVG, BEFORE, BEGIN, BERNOULLI, BETWEEN, BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOTH, BREADTH, BY, BYTES, C, CALL, CALLED, CARDINALITY, CASCADE, CASCADED, CASE, CAST, CATALOG, CATALOG_NAME, CEIL, CEILING, CENTURY, CHAIN, CHAR, CHARACTER, CHARACTERISTICS, CHARACTERS, CHARACTER_LENG [...]
{% endhighlight %}
diff --git a/docs/dev/table/types.md b/docs/dev/table/types.md
index 8a913bc..bc91038 100644
--- a/docs/dev/table/types.md
+++ b/docs/dev/table/types.md
@@ -185,7 +185,7 @@ For the *Data Type Representation* column the table omits the prefix `org.apache
| `OBJECT_ARRAY(...)` | `OBJECT_ARRAY<...>` | `ARRAY(`<br>`DATATYPE.bridgedTo(OBJECT.class))` | |
| `MULTISET(...)` | | `MULTISET(...)` | |
| `MAP(..., ...)` | `MAP<...,...>` | `MAP(...)` | |
-| other generic types | | `ANY(...)` | |
+| other generic types | | `RAW(...)` | |
<span class="label label-danger">Attention</span> If there is a problem with the new type system. Users
can fallback to type information defined in `org.apache.flink.table.api.Types` at any time.
@@ -218,7 +218,7 @@ The following data types are supported:
| `MULTISET` | |
| `MAP` | |
| `ROW` | |
-| `ANY` | |
+| `RAW` | |
Limitations
-----------
@@ -1197,12 +1197,12 @@ DataTypes.NULL()
|`java.lang.Object` | X | X | *Default* |
|*any class* | | (X) | Any non-primitive type. |
-#### `ANY`
+#### `RAW`
Data type of an arbitrary serialized type. This type is a black box within the table ecosystem
and is only deserialized at the edges.
-The any type is an extension to the SQL standard.
+The raw type is an extension to the SQL standard.
**Declaration**
@@ -1210,25 +1210,25 @@ The any type is an extension to the SQL standard.
<div data-lang="SQL" markdown="1">
{% highlight text %}
-ANY('class', 'snapshot')
+RAW('class', 'snapshot')
{% endhighlight %}
</div>
<div data-lang="Java/Scala" markdown="1">
{% highlight java %}
-DataTypes.ANY(class, serializer)
+DataTypes.RAW(class, serializer)
-DataTypes.ANY(typeInfo)
+DataTypes.RAW(typeInfo)
{% endhighlight %}
</div>
</div>
-The type can be declared using `ANY('class', 'snapshot')` where `class` is the originating class and
+The type can be declared using `RAW('class', 'snapshot')` where `class` is the originating class and
`snapshot` is the serialized `TypeSerializerSnapshot` in Base64 encoding. Usually, the type string is not
declared directly but is generated while persisting the type.
-In the API, the `ANY` type can be declared either by directly supplying a `Class` + `TypeSerializer` or
+In the API, the `RAW` type can be declared either by directly supplying a `Class` + `TypeSerializer` or
by passing `TypeInformation` and let the framework extract `Class` + `TypeSerializer` from there.
**Bridging to JVM Types**
diff --git a/flink-table/flink-sql-parser/src/main/codegen/data/Parser.tdd b/flink-table/flink-sql-parser/src/main/codegen/data/Parser.tdd
index 768aa38..9ef85bf 100644
--- a/flink-table/flink-sql-parser/src/main/codegen/data/Parser.tdd
+++ b/flink-table/flink-sql-parser/src/main/codegen/data/Parser.tdd
@@ -72,6 +72,7 @@
"OVERWRITE",
"STRING",
"BYTES",
+ "RAW",
"CATALOGS",
"USE",
"DATABASES",
diff --git a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/utils/factories/AggregateOperationFactory.java b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/utils/factories/AggregateOperationFactory.java
index 6b7134d..cb51ad3 100644
--- a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/utils/factories/AggregateOperationFactory.java
+++ b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/utils/factories/AggregateOperationFactory.java
@@ -503,8 +503,8 @@ public final class AggregateOperationFactory {
@Override
protected Boolean defaultMethod(LogicalType logicalType) {
- if (logicalType.getTypeRoot() == LogicalTypeRoot.ANY) {
- // we don't know anything about the ANY type, we don't know if it is comparable and hashable.
+ if (logicalType.getTypeRoot() == LogicalTypeRoot.RAW) {
+ // we don't know anything about the RAW type, we don't know if it is comparable and hashable.
return false;
} else if (logicalType instanceof LegacyTypeInformationType) {
return ((LegacyTypeInformationType) logicalType).getTypeInformation().isKeyType();
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
index 9a4ab06..386c641 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
@@ -27,7 +27,6 @@ import org.apache.flink.table.types.CollectionDataType;
import org.apache.flink.table.types.DataType;
import org.apache.flink.table.types.FieldsDataType;
import org.apache.flink.table.types.KeyValueDataType;
-import org.apache.flink.table.types.logical.AnyType;
import org.apache.flink.table.types.logical.ArrayType;
import org.apache.flink.table.types.logical.BigIntType;
import org.apache.flink.table.types.logical.BinaryType;
@@ -45,12 +44,13 @@ import org.apache.flink.table.types.logical.LogicalType;
import org.apache.flink.table.types.logical.MapType;
import org.apache.flink.table.types.logical.MultisetType;
import org.apache.flink.table.types.logical.NullType;
+import org.apache.flink.table.types.logical.RawType;
import org.apache.flink.table.types.logical.RowType;
import org.apache.flink.table.types.logical.SmallIntType;
import org.apache.flink.table.types.logical.TimeType;
import org.apache.flink.table.types.logical.TimestampType;
import org.apache.flink.table.types.logical.TinyIntType;
-import org.apache.flink.table.types.logical.TypeInformationAnyType;
+import org.apache.flink.table.types.logical.TypeInformationRawType;
import org.apache.flink.table.types.logical.VarBinaryType;
import org.apache.flink.table.types.logical.VarCharType;
import org.apache.flink.table.types.logical.YearMonthIntervalType;
@@ -546,35 +546,51 @@ public final class DataTypes {
* Data type of an arbitrary serialized type. This type is a black box within the table ecosystem
* and is only deserialized at the edges.
*
- * <p>The any type is an extension to the SQL standard.
+ * <p>The raw type is an extension to the SQL standard.
*
- * <p>This method assumes that a {@link TypeSerializer} instance is present. Use {@link #ANY(TypeInformation)}
+ * <p>This method assumes that a {@link TypeSerializer} instance is present. Use {@link #RAW(TypeInformation)}
* for generating a serializer from Flink's core type system automatically in subsequent layers.
*
* @param clazz originating value class
* @param serializer type serializer
*
- * @see AnyType
+ * @see RawType
*/
+ public static <T> DataType RAW(Class<T> clazz, TypeSerializer<T> serializer) {
+ return new AtomicDataType(new RawType<>(clazz, serializer));
+ }
+
+ /**
+ * @deprecated Use {@link #RAW(Class, TypeSerializer)} instead.
+ */
+ @Deprecated
public static <T> DataType ANY(Class<T> clazz, TypeSerializer<T> serializer) {
- return new AtomicDataType(new AnyType<>(clazz, serializer));
+ return RAW(clazz, serializer);
}
/**
* Data type of an arbitrary serialized type backed by {@link TypeInformation}. This type is
* a black box within the table ecosystem and is only deserialized at the edges.
*
- * <p>The any type is an extension to the SQL standard.
+ * <p>The raw type is an extension to the SQL standard.
*
- * <p>Compared to an {@link #ANY(Class, TypeSerializer)}, this type does not contain a {@link TypeSerializer}
+ * <p>Compared to an {@link #RAW(Class, TypeSerializer)}, this type does not contain a {@link TypeSerializer}
* yet. The serializer will be generated from the enclosed {@link TypeInformation} but needs access
* to the {@link ExecutionConfig} of the current execution environment. Thus, this type is just a
* placeholder.
*
- * @see TypeInformationAnyType
+ * @see TypeInformationRawType
+ */
+ public static <T> DataType RAW(TypeInformation<T> typeInformation) {
+ return new AtomicDataType(new TypeInformationRawType<>(typeInformation));
+ }
+
+ /**
+ * @deprecated Use {@link #RAW(TypeInformation)} instead.
*/
+ @Deprecated
public static <T> DataType ANY(TypeInformation<T> typeInformation) {
- return new AtomicDataType(new TypeInformationAnyType<>(typeInformation));
+ return RAW(typeInformation);
}
// --------------------------------------------------------------------------------------------
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/LegacyTypeInformationType.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/LegacyTypeInformationType.java
index a6d6a20..ad5a60f 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/LegacyTypeInformationType.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/LegacyTypeInformationType.java
@@ -33,8 +33,8 @@ import java.util.Objects;
* stack. Many types can be mapped directly to the new type system, however, some types such as
* {@code DECIMAL}, POJOs, or case classes need special handling.
*
- * <p>This type differs from {@link TypeInformationAnyType}. This type is allowed to travel through
- * the stack whereas {@link TypeInformationAnyType} should be resolved eagerly to {@link AnyType} by
+ * <p>This type differs from {@link TypeInformationRawType}. This type is allowed to travel through
+ * the stack whereas {@link TypeInformationRawType} should be resolved eagerly to {@link RawType} by
* the planner.
*
* <p>This class can be removed once we have removed all deprecated methods that take or return
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/LogicalTypeRoot.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/LogicalTypeRoot.java
index 6ff360a..0079a8d 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/LogicalTypeRoot.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/LogicalTypeRoot.java
@@ -34,7 +34,7 @@ import java.util.Set;
*
* <p>The enumeration is very close to the SQL standard in terms of naming and completeness. However,
* it reflects just a subset of the evolving standard and contains some extensions (such as {@code NULL},
- * {@code SYMBOL}, or {@code ANY}).
+ * {@code SYMBOL}, or {@code RAW}).
*
* <p>See the type-implementing classes for a more detailed description of each type.
*/
@@ -152,7 +152,7 @@ public enum LogicalTypeRoot {
NULL(
LogicalTypeFamily.EXTENSION),
- ANY(
+ RAW(
LogicalTypeFamily.EXTENSION),
SYMBOL(
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/LogicalTypeVisitor.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/LogicalTypeVisitor.java
index 810174f..c7ed0b7 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/LogicalTypeVisitor.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/LogicalTypeVisitor.java
@@ -24,7 +24,7 @@ import org.apache.flink.annotation.PublicEvolving;
* The visitor definition of {@link LogicalType}. The visitor transforms a logical type into
* instances of {@code R}.
*
- * <p>Incomplete types such as the {@link TypeInformationAnyType} or {@link UnresolvedUserDefinedType} are visited
+ * <p>Incomplete types such as the {@link TypeInformationRawType} or {@link UnresolvedUserDefinedType} are visited
* through the generic {@link #visit(LogicalType)}.
*
* @param <R> result type
@@ -84,7 +84,7 @@ public interface LogicalTypeVisitor<R> {
R visit(NullType nullType);
- R visit(AnyType<?> anyType);
+ R visit(RawType<?> rawType);
R visit(SymbolType<?> symbolType);
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/AnyType.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/RawType.java
similarity index 87%
rename from flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/AnyType.java
rename to flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/RawType.java
index 82e805d..c795464 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/AnyType.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/RawType.java
@@ -33,17 +33,17 @@ import java.util.Set;
/**
* Logical type of an arbitrary serialized type. This type is a black box within the table ecosystem
- * and is only deserialized at the edges. The any type is an extension to the SQL standard.
+ * and is only deserialized at the edges. The raw type is an extension to the SQL standard.
*
- * <p>The serialized string representation is {@code ANY('c', 's')} where {@code c} is the originating
+ * <p>The serialized string representation is {@code RAW('c', 's')} where {@code c} is the originating
* class and {@code s} is the serialized {@link TypeSerializerSnapshot} in Base64 encoding.
*
* @param <T> originating class for this type
*/
@PublicEvolving
-public final class AnyType<T> extends LogicalType {
+public final class RawType<T> extends LogicalType {
- private static final String FORMAT = "ANY('%s', '%s')";
+ private static final String FORMAT = "RAW('%s', '%s')";
private static final Set<String> INPUT_OUTPUT_CONVERSION = conversionSet(
byte[].class.getName(),
@@ -55,13 +55,13 @@ public final class AnyType<T> extends LogicalType {
private transient String serializerString;
- public AnyType(boolean isNullable, Class<T> clazz, TypeSerializer<T> serializer) {
- super(isNullable, LogicalTypeRoot.ANY);
+ public RawType(boolean isNullable, Class<T> clazz, TypeSerializer<T> serializer) {
+ super(isNullable, LogicalTypeRoot.RAW);
this.clazz = Preconditions.checkNotNull(clazz, "Class must not be null.");
this.serializer = Preconditions.checkNotNull(serializer, "Serializer must not be null.");
}
- public AnyType(Class<T> clazz, TypeSerializer<T> serializer) {
+ public RawType(Class<T> clazz, TypeSerializer<T> serializer) {
this(true, clazz, serializer);
}
@@ -75,7 +75,7 @@ public final class AnyType<T> extends LogicalType {
@Override
public LogicalType copy(boolean isNullable) {
- return new AnyType<>(isNullable, clazz, serializer.duplicate());
+ return new RawType<>(isNullable, clazz, serializer.duplicate());
}
@Override
@@ -126,8 +126,8 @@ public final class AnyType<T> extends LogicalType {
if (!super.equals(o)) {
return false;
}
- AnyType<?> anyType = (AnyType<?>) o;
- return clazz.equals(anyType.clazz) && serializer.equals(anyType.serializer);
+ RawType<?> rawType = (RawType<?>) o;
+ return clazz.equals(rawType.clazz) && serializer.equals(rawType.serializer);
}
@Override
@@ -147,7 +147,7 @@ public final class AnyType<T> extends LogicalType {
} catch (Exception e) {
throw new TableException(String.format(
"Unable to generate a string representation of the serializer snapshot of '%s' " +
- "describing the class '%s' for the ANY type.",
+ "describing the class '%s' for the RAW type.",
serializer.getClass().getName(),
clazz.toString()), e);
}
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/TypeInformationAnyType.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/TypeInformationRawType.java
similarity index 81%
rename from flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/TypeInformationAnyType.java
rename to flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/TypeInformationRawType.java
index 9e64044..97cff52 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/TypeInformationAnyType.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/TypeInformationRawType.java
@@ -34,22 +34,22 @@ import java.util.Set;
/**
* Placeholder type of an arbitrary serialized type backed by {@link TypeInformation}. This type is
- * a black box within the table ecosystem and is only deserialized at the edges. The any type is an
+ * a black box within the table ecosystem and is only deserialized at the edges. The raw type is an
* extension to the SQL standard.
*
- * <p>Compared to an {@link AnyType}, this type does not contain a {@link TypeSerializer} yet. The
+ * <p>Compared to an {@link RawType}, this type does not contain a {@link TypeSerializer} yet. The
* serializer will be generated from the enclosed {@link TypeInformation} but needs access to the
* {@link ExecutionConfig} of the current execution environment. Thus, this type is just a placeholder
- * for the fully resolved {@link AnyType} returned by {@link #resolve(ExecutionConfig)}.
+ * for the fully resolved {@link RawType} returned by {@link #resolve(ExecutionConfig)}.
*
* <p>This type has no serializable string representation.
*
* <p>If no type information is supplied, generic type serialization for {@link Object} is used.
*/
@PublicEvolving
-public final class TypeInformationAnyType<T> extends LogicalType {
+public final class TypeInformationRawType<T> extends LogicalType {
- private static final String FORMAT = "ANY('%s', ?)";
+ private static final String FORMAT = "RAW('%s', ?)";
private static final Set<String> INPUT_OUTPUT_CONVERSION = conversionSet(
byte[].class.getName(),
@@ -59,17 +59,17 @@ public final class TypeInformationAnyType<T> extends LogicalType {
private final TypeInformation<T> typeInfo;
- public TypeInformationAnyType(boolean isNullable, TypeInformation<T> typeInfo) {
- super(isNullable, LogicalTypeRoot.ANY);
+ public TypeInformationRawType(boolean isNullable, TypeInformation<T> typeInfo) {
+ super(isNullable, LogicalTypeRoot.RAW);
this.typeInfo = Preconditions.checkNotNull(typeInfo, "Type information must not be null.");
}
- public TypeInformationAnyType(TypeInformation<T> typeInfo) {
+ public TypeInformationRawType(TypeInformation<T> typeInfo) {
this(true, typeInfo);
}
@SuppressWarnings("unchecked")
- public TypeInformationAnyType() {
+ public TypeInformationRawType() {
this(true, (TypeInformation<T>) DEFAULT_TYPE_INFO);
}
@@ -78,13 +78,13 @@ public final class TypeInformationAnyType<T> extends LogicalType {
}
@Internal
- public AnyType<T> resolve(ExecutionConfig config) {
- return new AnyType<>(isNullable(), typeInfo.getTypeClass(), typeInfo.createSerializer(config));
+ public RawType<T> resolve(ExecutionConfig config) {
+ return new RawType<>(isNullable(), typeInfo.getTypeClass(), typeInfo.createSerializer(config));
}
@Override
public LogicalType copy(boolean isNullable) {
- return new TypeInformationAnyType<>(isNullable, typeInfo); // we must assume immutability here
+ return new TypeInformationRawType<>(isNullable, typeInfo); // we must assume immutability here
}
@Override
@@ -95,8 +95,8 @@ public final class TypeInformationAnyType<T> extends LogicalType {
@Override
public String asSerializableString() {
throw new TableException(
- "An any type backed by type information has no serializable string representation. It " +
- "needs to be resolved into a proper any type.");
+ "A raw type backed by type information has no serializable string representation. It " +
+ "needs to be resolved into a proper raw type.");
}
@Override
@@ -137,7 +137,7 @@ public final class TypeInformationAnyType<T> extends LogicalType {
if (!super.equals(o)) {
return false;
}
- TypeInformationAnyType<?> that = (TypeInformationAnyType<?>) o;
+ TypeInformationRawType<?> that = (TypeInformationRawType<?>) o;
return typeInfo.equals(that.typeInfo);
}
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeCasts.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeCasts.java
index efb888f..d46288c 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeCasts.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeCasts.java
@@ -42,7 +42,6 @@ import static org.apache.flink.table.types.logical.LogicalTypeFamily.NUMERIC;
import static org.apache.flink.table.types.logical.LogicalTypeFamily.PREDEFINED;
import static org.apache.flink.table.types.logical.LogicalTypeFamily.TIME;
import static org.apache.flink.table.types.logical.LogicalTypeFamily.TIMESTAMP;
-import static org.apache.flink.table.types.logical.LogicalTypeRoot.ANY;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.BIGINT;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.BINARY;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.BOOLEAN;
@@ -56,6 +55,7 @@ import static org.apache.flink.table.types.logical.LogicalTypeRoot.INTEGER;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.INTERVAL_DAY_TIME;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.INTERVAL_YEAR_MONTH;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.NULL;
+import static org.apache.flink.table.types.logical.LogicalTypeRoot.RAW;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.SMALLINT;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.STRUCTURED_TYPE;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.SYMBOL;
@@ -268,8 +268,8 @@ public final class LogicalTypeCasts {
} else if (sourceRoot == NULL) {
// null can be cast to an arbitrary type
return true;
- } else if (sourceRoot == ANY || targetRoot == ANY) {
- // the two any types are not equal (from initial invariant), casting is not possible
+ } else if (sourceRoot == RAW || targetRoot == RAW) {
+ // the two raw types are not equal (from initial invariant), casting is not possible
return false;
} else if (sourceRoot == SYMBOL || targetRoot == SYMBOL) {
// the two symbol types are not equal (from initial invariant), casting is not possible
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeDefaultVisitor.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeDefaultVisitor.java
index 2f9224b..4a268d8 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeDefaultVisitor.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeDefaultVisitor.java
@@ -19,7 +19,6 @@
package org.apache.flink.table.types.logical.utils;
import org.apache.flink.annotation.Internal;
-import org.apache.flink.table.types.logical.AnyType;
import org.apache.flink.table.types.logical.ArrayType;
import org.apache.flink.table.types.logical.BigIntType;
import org.apache.flink.table.types.logical.BinaryType;
@@ -38,6 +37,7 @@ import org.apache.flink.table.types.logical.LogicalTypeVisitor;
import org.apache.flink.table.types.logical.MapType;
import org.apache.flink.table.types.logical.MultisetType;
import org.apache.flink.table.types.logical.NullType;
+import org.apache.flink.table.types.logical.RawType;
import org.apache.flink.table.types.logical.RowType;
import org.apache.flink.table.types.logical.SmallIntType;
import org.apache.flink.table.types.logical.StructuredType;
@@ -188,8 +188,8 @@ public abstract class LogicalTypeDefaultVisitor<R> implements LogicalTypeVisitor
}
@Override
- public R visit(AnyType<?> anyType) {
- return defaultMethod(anyType);
+ public R visit(RawType<?> rawType) {
+ return defaultMethod(rawType);
}
@Override
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeGeneralization.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeGeneralization.java
index c9d6e25..21efe4e 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeGeneralization.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeGeneralization.java
@@ -74,7 +74,6 @@ import static org.apache.flink.table.types.logical.LogicalTypeFamily.INTERVAL;
import static org.apache.flink.table.types.logical.LogicalTypeFamily.NUMERIC;
import static org.apache.flink.table.types.logical.LogicalTypeFamily.TIME;
import static org.apache.flink.table.types.logical.LogicalTypeFamily.TIMESTAMP;
-import static org.apache.flink.table.types.logical.LogicalTypeRoot.ANY;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.ARRAY;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.BINARY;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.CHAR;
@@ -86,6 +85,7 @@ import static org.apache.flink.table.types.logical.LogicalTypeRoot.INTERVAL_YEAR
import static org.apache.flink.table.types.logical.LogicalTypeRoot.MAP;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.MULTISET;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.NULL;
+import static org.apache.flink.table.types.logical.LogicalTypeRoot.RAW;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.ROW;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.TIMESTAMP_WITHOUT_TIME_ZONE;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.TIMESTAMP_WITH_LOCAL_TIME_ZONE;
@@ -158,13 +158,13 @@ public final class LogicalTypeGeneralization {
Preconditions.checkArgument(types.size() > 0, "List of types must not be empty.");
// collect statistics first
- boolean hasAnyType = false;
+ boolean hasRawType = false;
boolean hasNullType = false;
boolean hasNullableTypes = false;
for (LogicalType type : types) {
final LogicalTypeRoot typeRoot = type.getTypeRoot();
- if (typeRoot == ANY) {
- hasAnyType = true;
+ if (typeRoot == RAW) {
+ hasRawType = true;
} else if (typeRoot == NULL) {
hasNullType = true;
}
@@ -177,7 +177,7 @@ public final class LogicalTypeGeneralization {
.map(t -> t.copy(true))
.collect(Collectors.toList());
- LogicalType foundType = findCommonNullableType(normalizedTypes, hasAnyType, hasNullType);
+ LogicalType foundType = findCommonNullableType(normalizedTypes, hasRawType, hasNullType);
if (foundType == null) {
foundType = findCommonCastableType(normalizedTypes);
}
@@ -215,11 +215,11 @@ public final class LogicalTypeGeneralization {
@SuppressWarnings("ConstantConditions")
private static @Nullable LogicalType findCommonNullableType(
List<LogicalType> normalizedTypes,
- boolean hasAnyType,
+ boolean hasRawType,
boolean hasNullType) {
- // all ANY types must be equal
- if (hasAnyType) {
+ // all RAW types must be equal
+ if (hasRawType) {
return findExactlySameType(normalizedTypes);
}
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeParser.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeParser.java
index 9e35e5d..6976216 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeParser.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/utils/LogicalTypeParser.java
@@ -23,7 +23,6 @@ import org.apache.flink.api.common.typeutils.TypeSerializerSnapshot;
import org.apache.flink.core.memory.DataInputDeserializer;
import org.apache.flink.table.api.ValidationException;
import org.apache.flink.table.catalog.UnresolvedIdentifier;
-import org.apache.flink.table.types.logical.AnyType;
import org.apache.flink.table.types.logical.ArrayType;
import org.apache.flink.table.types.logical.BigIntType;
import org.apache.flink.table.types.logical.BinaryType;
@@ -41,6 +40,7 @@ import org.apache.flink.table.types.logical.LogicalType;
import org.apache.flink.table.types.logical.MapType;
import org.apache.flink.table.types.logical.MultisetType;
import org.apache.flink.table.types.logical.NullType;
+import org.apache.flink.table.types.logical.RawType;
import org.apache.flink.table.types.logical.RowType;
import org.apache.flink.table.types.logical.SmallIntType;
import org.apache.flink.table.types.logical.TimeType;
@@ -93,7 +93,7 @@ public final class LogicalTypeParser {
* Parses a type string. All types will be fully resolved except for {@link UnresolvedUserDefinedType}s.
*
* @param typeString a string like "ROW(field1 INT, field2 BOOLEAN)"
- * @param classLoader class loader for loading classes of the ANY type
+ * @param classLoader class loader for loading classes of the RAW type
* @throws ValidationException in case of parsing errors.
*/
public static LogicalType parse(String typeString, ClassLoader classLoader) {
@@ -301,7 +301,7 @@ public final class LogicalTypeParser {
MAP,
ROW,
NULL,
- ANY,
+ RAW,
NOT
}
@@ -538,8 +538,8 @@ public final class LogicalTypeParser {
return parseRowType();
case NULL:
return new NullType();
- case ANY:
- return parseAnyType();
+ case RAW:
+ return parseRawType();
default:
throw parsingError("Unsupported type: " + token().value);
}
@@ -874,7 +874,7 @@ public final class LogicalTypeParser {
}
@SuppressWarnings("unchecked")
- private LogicalType parseAnyType() {
+ private LogicalType parseRawType() {
nextToken(TokenType.BEGIN_PARAMETER);
nextToken(TokenType.LITERAL_STRING);
final String className = tokenAsString();
@@ -891,10 +891,10 @@ public final class LogicalTypeParser {
final TypeSerializerSnapshot<?> snapshot = TypeSerializerSnapshot.readVersionedSnapshot(
inputDeserializer,
classLoader);
- return new AnyType(clazz, snapshot.restoreSerializer());
+ return new RawType(clazz, snapshot.restoreSerializer());
} catch (Throwable t) {
throw parsingError(
- "Unable to restore the ANY type of class '" + className + "' with " +
+ "Unable to restore the RAW type of class '" + className + "' with " +
"serializer snapshot '" + serializer + "'.", t);
}
}
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/LegacyTypeInfoDataTypeConverter.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/LegacyTypeInfoDataTypeConverter.java
index 20b6db8..0639f21 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/LegacyTypeInfoDataTypeConverter.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/LegacyTypeInfoDataTypeConverter.java
@@ -41,7 +41,7 @@ import org.apache.flink.table.types.logical.LogicalTypeRoot;
import org.apache.flink.table.types.logical.RowType;
import org.apache.flink.table.types.logical.TimestampKind;
import org.apache.flink.table.types.logical.TimestampType;
-import org.apache.flink.table.types.logical.TypeInformationAnyType;
+import org.apache.flink.table.types.logical.TypeInformationRawType;
import org.apache.flink.table.types.logical.utils.LogicalTypeChecks;
import org.apache.flink.table.typeutils.TimeIndicatorTypeInfo;
import org.apache.flink.table.typeutils.TimeIntervalTypeInfo;
@@ -181,7 +181,7 @@ public final class LegacyTypeInfoDataTypeConverter {
return createLegacyType(LogicalTypeRoot.STRUCTURED_TYPE, typeInfo);
}
- return createLegacyType(LogicalTypeRoot.ANY, typeInfo);
+ return createLegacyType(LogicalTypeRoot.RAW, typeInfo);
}
public static TypeInformation<?> toLegacyTypeInfo(DataType dataType) {
@@ -237,9 +237,9 @@ public final class LegacyTypeInfoDataTypeConverter {
return convertToMapTypeInfo((KeyValueDataType) dataType);
}
- // makes the any type accessible in the legacy planner
- else if (canConvertToAnyTypeInfo(dataType)) {
- return convertToAnyTypeInfo(dataType);
+ // makes the raw type accessible in the legacy planner
+ else if (canConvertToRawTypeInfo(dataType)) {
+ return convertToRawTypeInfo(dataType);
}
throw new TableException(
@@ -380,14 +380,14 @@ public final class LegacyTypeInfoDataTypeConverter {
return ((LegacyTypeInformationType) dataType.getLogicalType()).getTypeInformation();
}
- private static boolean canConvertToAnyTypeInfo(DataType dataType) {
- return dataType.getLogicalType() instanceof TypeInformationAnyType &&
+ private static boolean canConvertToRawTypeInfo(DataType dataType) {
+ return dataType.getLogicalType() instanceof TypeInformationRawType &&
dataType.getConversionClass().equals(
- ((TypeInformationAnyType) dataType.getLogicalType()).getTypeInformation().getTypeClass());
+ ((TypeInformationRawType) dataType.getLogicalType()).getTypeInformation().getTypeClass());
}
- private static TypeInformation<?> convertToAnyTypeInfo(DataType dataType) {
- return ((TypeInformationAnyType) dataType.getLogicalType()).getTypeInformation();
+ private static TypeInformation<?> convertToRawTypeInfo(DataType dataType) {
+ return ((TypeInformationRawType) dataType.getLogicalType()).getTypeInformation();
}
private LegacyTypeInfoDataTypeConverter() {
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/LogicalTypeDataTypeConverter.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/LogicalTypeDataTypeConverter.java
index b941a0b..0a2c83f 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/LogicalTypeDataTypeConverter.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/LogicalTypeDataTypeConverter.java
@@ -23,7 +23,6 @@ import org.apache.flink.table.types.CollectionDataType;
import org.apache.flink.table.types.DataType;
import org.apache.flink.table.types.FieldsDataType;
import org.apache.flink.table.types.KeyValueDataType;
-import org.apache.flink.table.types.logical.AnyType;
import org.apache.flink.table.types.logical.ArrayType;
import org.apache.flink.table.types.logical.BigIntType;
import org.apache.flink.table.types.logical.BinaryType;
@@ -42,6 +41,7 @@ import org.apache.flink.table.types.logical.LogicalTypeVisitor;
import org.apache.flink.table.types.logical.MapType;
import org.apache.flink.table.types.logical.MultisetType;
import org.apache.flink.table.types.logical.NullType;
+import org.apache.flink.table.types.logical.RawType;
import org.apache.flink.table.types.logical.RowType;
import org.apache.flink.table.types.logical.SmallIntType;
import org.apache.flink.table.types.logical.StructuredType;
@@ -231,8 +231,8 @@ public final class LogicalTypeDataTypeConverter {
}
@Override
- public DataType visit(AnyType<?> anyType) {
- return new AtomicDataType(anyType);
+ public DataType visit(RawType<?> rawType) {
+ return new AtomicDataType(rawType);
}
@Override
diff --git a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/DataTypesTest.java b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/DataTypesTest.java
index 3945fb5..1c7e50c 100644
--- a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/DataTypesTest.java
+++ b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/DataTypesTest.java
@@ -21,7 +21,6 @@ package org.apache.flink.table.types;
import org.apache.flink.api.common.typeinfo.Types;
import org.apache.flink.api.common.typeutils.base.VoidSerializer;
import org.apache.flink.table.api.DataTypes;
-import org.apache.flink.table.types.logical.AnyType;
import org.apache.flink.table.types.logical.ArrayType;
import org.apache.flink.table.types.logical.BigIntType;
import org.apache.flink.table.types.logical.BinaryType;
@@ -38,12 +37,13 @@ import org.apache.flink.table.types.logical.LogicalType;
import org.apache.flink.table.types.logical.MapType;
import org.apache.flink.table.types.logical.MultisetType;
import org.apache.flink.table.types.logical.NullType;
+import org.apache.flink.table.types.logical.RawType;
import org.apache.flink.table.types.logical.RowType;
import org.apache.flink.table.types.logical.SmallIntType;
import org.apache.flink.table.types.logical.TimeType;
import org.apache.flink.table.types.logical.TimestampType;
import org.apache.flink.table.types.logical.TinyIntType;
-import org.apache.flink.table.types.logical.TypeInformationAnyType;
+import org.apache.flink.table.types.logical.TypeInformationRawType;
import org.apache.flink.table.types.logical.VarBinaryType;
import org.apache.flink.table.types.logical.VarCharType;
import org.apache.flink.table.types.logical.YearMonthIntervalType;
@@ -63,7 +63,6 @@ import java.util.Arrays;
import java.util.List;
import java.util.Map;
-import static org.apache.flink.table.api.DataTypes.ANY;
import static org.apache.flink.table.api.DataTypes.ARRAY;
import static org.apache.flink.table.api.DataTypes.BIGINT;
import static org.apache.flink.table.api.DataTypes.BINARY;
@@ -82,6 +81,7 @@ import static org.apache.flink.table.api.DataTypes.MINUTE;
import static org.apache.flink.table.api.DataTypes.MONTH;
import static org.apache.flink.table.api.DataTypes.MULTISET;
import static org.apache.flink.table.api.DataTypes.NULL;
+import static org.apache.flink.table.api.DataTypes.RAW;
import static org.apache.flink.table.api.DataTypes.ROW;
import static org.apache.flink.table.api.DataTypes.SECOND;
import static org.apache.flink.table.api.DataTypes.SMALLINT;
@@ -195,12 +195,12 @@ public class DataTypesTest {
{NULL(), new NullType(), Object.class},
- {ANY(Types.GENERIC(DataTypesTest.class)),
- new TypeInformationAnyType<>(Types.GENERIC(DataTypesTest.class)),
+ {RAW(Types.GENERIC(DataTypesTest.class)),
+ new TypeInformationRawType<>(Types.GENERIC(DataTypesTest.class)),
DataTypesTest.class},
- {ANY(Void.class, VoidSerializer.INSTANCE),
- new AnyType<>(Void.class, VoidSerializer.INSTANCE),
+ {RAW(Void.class, VoidSerializer.INSTANCE),
+ new RawType<>(Void.class, VoidSerializer.INSTANCE),
Void.class}
}
);
diff --git a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LegacyTypeInfoDataTypeConverterTest.java b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LegacyTypeInfoDataTypeConverterTest.java
index a8edb90..436e2d1 100644
--- a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LegacyTypeInfoDataTypeConverterTest.java
+++ b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LegacyTypeInfoDataTypeConverterTest.java
@@ -65,7 +65,7 @@ public class LegacyTypeInfoDataTypeConverterTest {
Types.GENERIC(LegacyTypeInfoDataTypeConverterTest.class),
new AtomicDataType(
new LegacyTypeInformationType<>(
- LogicalTypeRoot.ANY,
+ LogicalTypeRoot.RAW,
Types.GENERIC(LegacyTypeInfoDataTypeConverterTest.class)))
},
diff --git a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypeCastsTest.java b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypeCastsTest.java
index b65a026..03fb1b7 100644
--- a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypeCastsTest.java
+++ b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypeCastsTest.java
@@ -30,7 +30,7 @@ import org.apache.flink.table.types.logical.NullType;
import org.apache.flink.table.types.logical.RowType;
import org.apache.flink.table.types.logical.RowType.RowField;
import org.apache.flink.table.types.logical.SmallIntType;
-import org.apache.flink.table.types.logical.TypeInformationAnyType;
+import org.apache.flink.table.types.logical.TypeInformationRawType;
import org.apache.flink.table.types.logical.VarCharType;
import org.apache.flink.table.types.logical.YearMonthIntervalType;
import org.apache.flink.table.types.logical.utils.LogicalTypeCasts;
@@ -91,15 +91,15 @@ public class LogicalTypeCastsTest {
{new DecimalType(3, 2), new VarCharType(Integer.MAX_VALUE), false, true},
{
- new TypeInformationAnyType<>(Types.GENERIC(LogicalTypesTest.class)),
- new TypeInformationAnyType<>(Types.GENERIC(LogicalTypesTest.class)),
+ new TypeInformationRawType<>(Types.GENERIC(LogicalTypesTest.class)),
+ new TypeInformationRawType<>(Types.GENERIC(LogicalTypesTest.class)),
true,
true
},
{
- new TypeInformationAnyType<>(Types.GENERIC(LogicalTypesTest.class)),
- new TypeInformationAnyType<>(Types.GENERIC(Object.class)),
+ new TypeInformationRawType<>(Types.GENERIC(LogicalTypesTest.class)),
+ new TypeInformationRawType<>(Types.GENERIC(Object.class)),
false,
false
},
diff --git a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypeCompatibleCheckTest.java b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypeCompatibleCheckTest.java
index 06e3949..cd1bd5f 100644
--- a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypeCompatibleCheckTest.java
+++ b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypeCompatibleCheckTest.java
@@ -43,7 +43,7 @@ import org.apache.flink.table.types.logical.TimeType;
import org.apache.flink.table.types.logical.TimestampKind;
import org.apache.flink.table.types.logical.TimestampType;
import org.apache.flink.table.types.logical.TinyIntType;
-import org.apache.flink.table.types.logical.TypeInformationAnyType;
+import org.apache.flink.table.types.logical.TypeInformationRawType;
import org.apache.flink.table.types.logical.VarBinaryType;
import org.apache.flink.table.types.logical.VarCharType;
import org.apache.flink.table.types.logical.YearMonthIntervalType;
@@ -235,8 +235,8 @@ public class LogicalTypeCompatibleCheckTest {
},
{
- new TypeInformationAnyType<>(Types.GENERIC(LogicalTypesTest.class)),
- new TypeInformationAnyType<>(Types.GENERIC(Object.class)),
+ new TypeInformationRawType<>(Types.GENERIC(LogicalTypesTest.class)),
+ new TypeInformationRawType<>(Types.GENERIC(Object.class)),
false
},
diff --git a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypeParserTest.java b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypeParserTest.java
index 1da75f0..2b1806b 100644
--- a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypeParserTest.java
+++ b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypeParserTest.java
@@ -22,7 +22,6 @@ import org.apache.flink.api.common.ExecutionConfig;
import org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer;
import org.apache.flink.table.api.ValidationException;
import org.apache.flink.table.catalog.UnresolvedIdentifier;
-import org.apache.flink.table.types.logical.AnyType;
import org.apache.flink.table.types.logical.ArrayType;
import org.apache.flink.table.types.logical.BigIntType;
import org.apache.flink.table.types.logical.BinaryType;
@@ -40,6 +39,7 @@ import org.apache.flink.table.types.logical.LogicalType;
import org.apache.flink.table.types.logical.MapType;
import org.apache.flink.table.types.logical.MultisetType;
import org.apache.flink.table.types.logical.NullType;
+import org.apache.flink.table.types.logical.RawType;
import org.apache.flink.table.types.logical.RowType;
import org.apache.flink.table.types.logical.SmallIntType;
import org.apache.flink.table.types.logical.TimeType;
@@ -393,8 +393,8 @@ public class LogicalTypeParserTest {
.expectType(new NullType()),
TestSpec
- .forString(createAnyType(LogicalTypeParserTest.class).asSerializableString())
- .expectType(createAnyType(LogicalTypeParserTest.class)),
+ .forString(createRawType(LogicalTypeParserTest.class).asSerializableString())
+ .expectType(createRawType(LogicalTypeParserTest.class)),
TestSpec
.forString("cat.db.MyType")
@@ -443,8 +443,8 @@ public class LogicalTypeParserTest {
.expectErrorMessage("<KEYWORD> expected"),
TestSpec
- .forString("ANY('unknown.class', '')")
- .expectErrorMessage("Unable to restore the ANY type")
+ .forString("RAW('unknown.class', '')")
+ .expectErrorMessage("Unable to restore the RAW type")
);
}
@@ -514,7 +514,7 @@ public class LogicalTypeParserTest {
}
}
- private static <T> AnyType<T> createAnyType(Class<T> clazz) {
- return new AnyType<>(clazz, new KryoSerializer<>(clazz, new ExecutionConfig()));
+ private static <T> RawType<T> createRawType(Class<T> clazz) {
+ return new RawType<>(clazz, new KryoSerializer<>(clazz, new ExecutionConfig()));
}
}
diff --git a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypesTest.java b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypesTest.java
index b887625..ef6e441 100644
--- a/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypesTest.java
+++ b/flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/LogicalTypesTest.java
@@ -29,7 +29,6 @@ import org.apache.flink.table.catalog.ObjectIdentifier;
import org.apache.flink.table.catalog.UnresolvedIdentifier;
import org.apache.flink.table.expressions.TimeIntervalUnit;
import org.apache.flink.table.expressions.TimePointUnit;
-import org.apache.flink.table.types.logical.AnyType;
import org.apache.flink.table.types.logical.ArrayType;
import org.apache.flink.table.types.logical.BigIntType;
import org.apache.flink.table.types.logical.BinaryType;
@@ -47,6 +46,7 @@ import org.apache.flink.table.types.logical.LogicalType;
import org.apache.flink.table.types.logical.MapType;
import org.apache.flink.table.types.logical.MultisetType;
import org.apache.flink.table.types.logical.NullType;
+import org.apache.flink.table.types.logical.RawType;
import org.apache.flink.table.types.logical.RowType;
import org.apache.flink.table.types.logical.SmallIntType;
import org.apache.flink.table.types.logical.StructuredType;
@@ -55,7 +55,7 @@ import org.apache.flink.table.types.logical.TimeType;
import org.apache.flink.table.types.logical.TimestampKind;
import org.apache.flink.table.types.logical.TimestampType;
import org.apache.flink.table.types.logical.TinyIntType;
-import org.apache.flink.table.types.logical.TypeInformationAnyType;
+import org.apache.flink.table.types.logical.TypeInformationRawType;
import org.apache.flink.table.types.logical.UnresolvedUserDefinedType;
import org.apache.flink.table.types.logical.VarBinaryType;
import org.apache.flink.table.types.logical.VarCharType;
@@ -556,27 +556,27 @@ public class LogicalTypesTest {
}
@Test
- public void testTypeInformationAnyType() {
- final TypeInformationAnyType<?> anyType = new TypeInformationAnyType<>(Types.TUPLE(Types.STRING, Types.INT));
+ public void testTypeInformationRawType() {
+ final TypeInformationRawType<?> rawType = new TypeInformationRawType<>(Types.TUPLE(Types.STRING, Types.INT));
- testEquality(anyType, new TypeInformationAnyType<>(Types.TUPLE(Types.STRING, Types.LONG)));
+ testEquality(rawType, new TypeInformationRawType<>(Types.TUPLE(Types.STRING, Types.LONG)));
- testStringSummary(anyType, "ANY('org.apache.flink.api.java.tuple.Tuple2', ?)");
+ testStringSummary(rawType, "RAW('org.apache.flink.api.java.tuple.Tuple2', ?)");
- testNullability(anyType);
+ testNullability(rawType);
- testJavaSerializability(anyType);
+ testJavaSerializability(rawType);
- testConversions(anyType, new Class[]{Tuple2.class}, new Class[]{Tuple.class});
+ testConversions(rawType, new Class[]{Tuple2.class}, new Class[]{Tuple.class});
- testInvalidStringSerializability(anyType);
+ testInvalidStringSerializability(rawType);
}
@Test
- public void testAnyType() {
+ public void testRawType() {
testAll(
- new AnyType<>(Human.class, new KryoSerializer<>(Human.class, new ExecutionConfig())),
- "ANY('org.apache.flink.table.types.LogicalTypesTest$Human', " +
+ new RawType<>(Human.class, new KryoSerializer<>(Human.class, new ExecutionConfig())),
+ "RAW('org.apache.flink.table.types.LogicalTypesTest$Human', " +
"'AEdvcmcuYXBhY2hlLmZsaW5rLmFwaS5qYXZhLnR5cGV1dGlscy5ydW50aW1lLmtyeW8uS3J5b1Nlcml" +
"hbGl6ZXJTbmFwc2hvdAAAAAIAM29yZy5hcGFjaGUuZmxpbmsudGFibGUudHlwZXMuTG9naWNhbFR5cG" +
"VzVGVzdCRIdW1hbgAABPLGmj1wAAAAAgAzb3JnLmFwYWNoZS5mbGluay50YWJsZS50eXBlcy5Mb2dpY" +
@@ -588,11 +588,11 @@ public class LogicalTypesTest {
"RHVtbXlBdnJvUmVnaXN0ZXJlZENsYXNzAAAAAQBZb3JnLmFwYWNoZS5mbGluay5hcGkuamF2YS50eXB" +
"ldXRpbHMucnVudGltZS5rcnlvLlNlcmlhbGl6ZXJzJER1bW15QXZyb0tyeW9TZXJpYWxpemVyQ2xhc3" +
"MAAATyxpo9cAAAAAAAAATyxpo9cAAAAAA=')",
- "ANY('org.apache.flink.table.types.LogicalTypesTest$Human', '...')",
+ "RAW('org.apache.flink.table.types.LogicalTypesTest$Human', '...')",
new Class[]{Human.class, User.class}, // every User is Human
new Class[]{Human.class},
new LogicalType[]{},
- new AnyType<>(User.class, new KryoSerializer<>(User.class, new ExecutionConfig()))
+ new RawType<>(User.class, new KryoSerializer<>(User.class, new ExecutionConfig()))
);
}
diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/functions/aggfunctions/FirstValueWithRetractAggFunction.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/functions/aggfunctions/FirstValueWithRetractAggFunction.java
index a81d1d8..21b74c1 100644
--- a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/functions/aggfunctions/FirstValueWithRetractAggFunction.java
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/functions/aggfunctions/FirstValueWithRetractAggFunction.java
@@ -46,7 +46,7 @@ import org.apache.flink.table.runtime.typeutils.DecimalSerializer;
import org.apache.flink.table.runtime.typeutils.DecimalTypeInfo;
import org.apache.flink.table.types.logical.BigIntType;
import org.apache.flink.table.types.logical.LogicalType;
-import org.apache.flink.table.types.logical.TypeInformationAnyType;
+import org.apache.flink.table.types.logical.TypeInformationRawType;
import java.util.ArrayList;
import java.util.Iterator;
@@ -189,8 +189,8 @@ public abstract class FirstValueWithRetractAggFunction<T> extends AggregateFunct
LogicalType[] fieldTypes = new LogicalType[] {
fromTypeInfoToLogicalType(getResultType()),
new BigIntType(),
- new TypeInformationAnyType<>(new MapViewTypeInfo<>(getResultType(), new ListTypeInfo<>(Types.LONG), false, false)),
- new TypeInformationAnyType<>(new MapViewTypeInfo<>(Types.LONG, new ListTypeInfo<>(getResultType()), false, false))
+ new TypeInformationRawType<>(new MapViewTypeInfo<>(getResultType(), new ListTypeInfo<>(Types.LONG), false, false)),
+ new TypeInformationRawType<>(new MapViewTypeInfo<>(Types.LONG, new ListTypeInfo<>(getResultType()), false, false))
};
String[] fieldNames = new String[] {
diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/functions/aggfunctions/LastValueWithRetractAggFunction.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/functions/aggfunctions/LastValueWithRetractAggFunction.java
index cd250a4..94dfb6c 100644
--- a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/functions/aggfunctions/LastValueWithRetractAggFunction.java
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/functions/aggfunctions/LastValueWithRetractAggFunction.java
@@ -46,7 +46,7 @@ import org.apache.flink.table.runtime.typeutils.DecimalSerializer;
import org.apache.flink.table.runtime.typeutils.DecimalTypeInfo;
import org.apache.flink.table.types.logical.BigIntType;
import org.apache.flink.table.types.logical.LogicalType;
-import org.apache.flink.table.types.logical.TypeInformationAnyType;
+import org.apache.flink.table.types.logical.TypeInformationRawType;
import java.util.ArrayList;
import java.util.Iterator;
@@ -190,8 +190,8 @@ public abstract class LastValueWithRetractAggFunction<T> extends AggregateFuncti
LogicalType[] fieldTypes = new LogicalType[] {
fromTypeInfoToLogicalType(getResultType()),
new BigIntType(),
- new TypeInformationAnyType<>(new MapViewTypeInfo<>(getResultType(), new ListTypeInfo<>(Types.LONG), false, false)),
- new TypeInformationAnyType<>(new MapViewTypeInfo<>(Types.LONG, new ListTypeInfo<>(getResultType()), false, false))
+ new TypeInformationRawType<>(new MapViewTypeInfo<>(getResultType(), new ListTypeInfo<>(Types.LONG), false, false)),
+ new TypeInformationRawType<>(new MapViewTypeInfo<>(Types.LONG, new ListTypeInfo<>(getResultType()), false, false))
};
String[] fieldNames = new String[] {
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/calcite/FlinkTypeFactory.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/calcite/FlinkTypeFactory.scala
index 1c61c00..5230eaa 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/calcite/FlinkTypeFactory.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/calcite/FlinkTypeFactory.scala
@@ -116,9 +116,9 @@ class FlinkTypeFactory(typeSystem: RelDataTypeSystem) extends JavaTypeFactoryImp
val multisetType = t.asInstanceOf[MultisetType]
createMultisetType(createFieldTypeFromLogicalType(multisetType.getElementType), -1)
- case LogicalTypeRoot.ANY =>
+ case LogicalTypeRoot.RAW =>
new GenericRelDataType(
- t.asInstanceOf[TypeInformationAnyType[_]],
+ t.asInstanceOf[TypeInformationRawType[_]],
true,
getTypeSystem)
@@ -314,9 +314,9 @@ class FlinkTypeFactory(typeSystem: RelDataTypeSystem) extends JavaTypeFactoryImp
} else {
// types are not all the same
if (allTypes.exists(_.getSqlTypeName == SqlTypeName.ANY)) {
- // one of the type was ANY.
+ // one of the type was RAW.
// we cannot generate a common type if it differs from other types.
- throw new TableException("Generic ANY types must have a common type information.")
+ throw new TableException("Generic RAW types must have a common type information.")
} else {
// cannot resolve a common type for different input types
None
@@ -451,7 +451,7 @@ object FlinkTypeFactory {
// symbol for special flags e.g. TRIM's BOTH, LEADING, TRAILING
// are represented as Enum
- case SYMBOL => new TypeInformationAnyType[Enum[_]](
+ case SYMBOL => new TypeInformationRawType[Enum[_]](
TypeExtractor.createTypeInfo(classOf[Enum[_]]))
// extract encapsulated Type
@@ -473,7 +473,7 @@ object FlinkTypeFactory {
toLogicalType(mapRelDataType.getValueType))
// CURSOR for UDTF case, whose type info will never be used, just a placeholder
- case CURSOR => new TypeInformationAnyType[Nothing](new NothingTypeInfo)
+ case CURSOR => new TypeInformationRawType[Nothing](new NothingTypeInfo)
case _@t =>
throw new TableException(s"Type is not supported: $t")
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/CodeGenUtils.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/CodeGenUtils.scala
index 2d2b43c..34b69ea 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/CodeGenUtils.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/CodeGenUtils.scala
@@ -163,7 +163,7 @@ object CodeGenUtils {
case MULTISET | MAP => className[BaseMap]
case ROW => className[BaseRow]
- case ANY => className[BinaryGeneric[_]]
+ case RAW => className[BinaryGeneric[_]]
}
/**
@@ -239,8 +239,8 @@ object CodeGenUtils {
ctx.addReusableMember(s"${classOf[HashFunction].getCanonicalName} $hashFunc;")
ctx.addReusableInitStatement(s"$hashFunc = new ${genHash.getClassName}($refs);")
s"$hashFunc.hashCode($term)"
- case ANY =>
- val gt = t.asInstanceOf[TypeInformationAnyType[_]]
+ case RAW =>
+ val gt = t.asInstanceOf[TypeInformationRawType[_]]
val serTerm = ctx.addReusableObject(
gt.getTypeInformation.createSerializer(new ExecutionConfig), "serializer")
s"$BINARY_GENERIC.getJavaObjectFromBinaryGeneric($term, $serTerm).hashCode()"
@@ -322,7 +322,7 @@ object CodeGenUtils {
def getEnum(genExpr: GeneratedExpression): Enum[_] = {
val split = genExpr.resultTerm.split('.')
val value = split.last
- val clazz = genExpr.resultType.asInstanceOf[TypeInformationAnyType[_]]
+ val clazz = genExpr.resultType.asInstanceOf[TypeInformationRawType[_]]
.getTypeInformation.getTypeClass
enumValueOf(clazz, value)
}
@@ -424,7 +424,7 @@ object CodeGenUtils {
case MULTISET | MAP => s"$rowTerm.getMap($indexTerm)"
case ROW => s"$rowTerm.getRow($indexTerm, ${t.asInstanceOf[RowType].getFieldCount})"
- case ANY => s"$rowTerm.getGeneric($indexTerm)"
+ case RAW => s"$rowTerm.getGeneric($indexTerm)"
}
// -------------------------- BaseRow Set Field -------------------------------
@@ -655,7 +655,7 @@ object CodeGenUtils {
case ROW =>
val ser = ctx.addReusableTypeSerializer(t)
s"$writerTerm.writeRow($indexTerm, $fieldValTerm, $ser)"
- case ANY =>
+ case RAW =>
val ser = ctx.addReusableTypeSerializer(t)
s"$writerTerm.writeGeneric($indexTerm, $fieldValTerm, $ser)"
}
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/ExprCodeGenerator.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/ExprCodeGenerator.scala
index f73abfc..b4145f7 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/ExprCodeGenerator.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/ExprCodeGenerator.scala
@@ -270,10 +270,10 @@ class ExprCodeGenerator(ctx: CodeGeneratorContext, nullableInput: Boolean)
fieldExprs.zipWithIndex foreach {
// timestamp type(Include TimeIndicator) and generic type can compatible with each other.
case (fieldExpr, i)
- if fieldExpr.resultType.isInstanceOf[TypeInformationAnyType[_]] ||
+ if fieldExpr.resultType.isInstanceOf[TypeInformationRawType[_]] ||
fieldExpr.resultType.isInstanceOf[TimestampType] =>
if (returnType.getTypeAt(i).getClass != fieldExpr.resultType.getClass
- && !returnType.getTypeAt(i).isInstanceOf[TypeInformationAnyType[_]]) {
+ && !returnType.getTypeAt(i).isInstanceOf[TypeInformationRawType[_]]) {
throw new CodeGenException(
s"Incompatible types of expression and result type, Expression[$fieldExpr] type is " +
s"[${fieldExpr.resultType}], result type is [${returnType.getTypeAt(i)}]")
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala
index 3656ca0..0b14b3f 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala
@@ -401,7 +401,7 @@ object GenerateUtils {
}
// Symbol type for special flags e.g. TRIM's BOTH, LEADING, TRAILING
- case ANY if literalType.asInstanceOf[TypeInformationAnyType[_]]
+ case RAW if literalType.asInstanceOf[TypeInformationRawType[_]]
.getTypeInformation.getTypeClass.isAssignableFrom(classOf[Enum[_]]) =>
generateSymbol(literalValue.asInstanceOf[Enum[_]])
@@ -415,7 +415,7 @@ object GenerateUtils {
qualifyEnum(enum),
NEVER_NULL,
NO_CODE,
- new TypeInformationAnyType[AnyRef](new GenericTypeInfo[AnyRef](
+ new TypeInformationRawType[AnyRef](new GenericTypeInfo[AnyRef](
enum.getDeclaringClass.asInstanceOf[Class[AnyRef]])),
literalValue = Some(enum))
}
@@ -700,12 +700,12 @@ object GenerateUtils {
"""
ctx.addReusableMember(funcCode)
s"$compareFunc($leftTerm, $rightTerm)"
- case ANY =>
- val anyType = t.asInstanceOf[TypeInformationAnyType[_]]
+ case RAW =>
+ val rawType = t.asInstanceOf[TypeInformationRawType[_]]
val ser = ctx.addReusableObject(
- anyType.getTypeInformation.createSerializer(new ExecutionConfig), "serializer")
+ rawType.getTypeInformation.createSerializer(new ExecutionConfig), "serializer")
val comp = ctx.addReusableObject(
- anyType.getTypeInformation.asInstanceOf[AtomicTypeInfo[_]]
+ rawType.getTypeInformation.asInstanceOf[AtomicTypeInfo[_]]
.createComparator(true, new ExecutionConfig),
"comparator")
s"""
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/FunctionGenerator.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/FunctionGenerator.scala
index a9544ff..4754005 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/FunctionGenerator.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/FunctionGenerator.scala
@@ -366,86 +366,86 @@ object FunctionGenerator {
addSqlFunction(
EXTRACT,
- Seq(ANY, BIGINT),
+ Seq(RAW, BIGINT),
new ExtractCallGen(BuiltInMethod.UNIX_DATE_EXTRACT.method))
addSqlFunction(
EXTRACT,
- Seq(ANY, DATE),
+ Seq(RAW, DATE),
new ExtractCallGen(BuiltInMethod.UNIX_DATE_EXTRACT.method))
addSqlFunction(
EXTRACT,
- Seq(ANY, TIME_WITHOUT_TIME_ZONE),
+ Seq(RAW, TIME_WITHOUT_TIME_ZONE),
new ExtractCallGen(BuiltInMethod.UNIX_DATE_EXTRACT.method))
addSqlFunction(
EXTRACT,
- Seq(ANY, TIMESTAMP_WITHOUT_TIME_ZONE),
+ Seq(RAW, TIMESTAMP_WITHOUT_TIME_ZONE),
new ExtractCallGen(BuiltInMethod.UNIX_DATE_EXTRACT.method))
addSqlFunction(
EXTRACT,
- Seq(ANY, TIMESTAMP_WITH_LOCAL_TIME_ZONE),
+ Seq(RAW, TIMESTAMP_WITH_LOCAL_TIME_ZONE),
new MethodCallGen(BuiltInMethods.EXTRACT_FROM_TIMESTAMP_TIME_ZONE))
addSqlFunction(
EXTRACT,
- Seq(ANY, INTERVAL_DAY_TIME),
+ Seq(RAW, INTERVAL_DAY_TIME),
new ExtractCallGen(BuiltInMethod.UNIX_DATE_EXTRACT.method))
addSqlFunction(
EXTRACT,
- Seq(ANY, INTERVAL_YEAR_MONTH),
+ Seq(RAW, INTERVAL_YEAR_MONTH),
new ExtractCallGen(BuiltInMethod.UNIX_DATE_EXTRACT.method))
addSqlFunction(
TIMESTAMP_DIFF,
Seq(
- ANY,
+ RAW,
TIMESTAMP_WITHOUT_TIME_ZONE,
TIMESTAMP_WITHOUT_TIME_ZONE),
new TimestampDiffCallGen)
addSqlFunction(
TIMESTAMP_DIFF,
- Seq(ANY, TIMESTAMP_WITHOUT_TIME_ZONE, DATE),
+ Seq(RAW, TIMESTAMP_WITHOUT_TIME_ZONE, DATE),
new TimestampDiffCallGen)
addSqlFunction(
TIMESTAMP_DIFF,
- Seq(ANY, DATE, TIMESTAMP_WITHOUT_TIME_ZONE),
+ Seq(RAW, DATE, TIMESTAMP_WITHOUT_TIME_ZONE),
new TimestampDiffCallGen)
addSqlFunction(
TIMESTAMP_DIFF,
- Seq(ANY, DATE, DATE),
+ Seq(RAW, DATE, DATE),
new TimestampDiffCallGen)
addSqlFunction(
FLOOR,
- Seq(DATE, ANY),
+ Seq(DATE, RAW),
new FloorCeilCallGen(
BuiltInMethod.FLOOR.method,
Some(BuiltInMethod.UNIX_DATE_FLOOR.method)))
addSqlFunction(
FLOOR,
- Seq(TIME_WITHOUT_TIME_ZONE, ANY),
+ Seq(TIME_WITHOUT_TIME_ZONE, RAW),
new FloorCeilCallGen(
BuiltInMethod.FLOOR.method,
Some(BuiltInMethod.UNIX_DATE_FLOOR.method)))
addSqlFunction(
FLOOR,
- Seq(TIMESTAMP_WITHOUT_TIME_ZONE, ANY),
+ Seq(TIMESTAMP_WITHOUT_TIME_ZONE, RAW),
new FloorCeilCallGen(
BuiltInMethod.FLOOR.method,
Some(BuiltInMethod.UNIX_TIMESTAMP_FLOOR.method)))
addSqlFunction(
FLOOR,
- Seq(TIMESTAMP_WITH_LOCAL_TIME_ZONE, ANY),
+ Seq(TIMESTAMP_WITH_LOCAL_TIME_ZONE, RAW),
new FloorCeilCallGen(
BuiltInMethod.FLOOR.method,
Some(BuiltInMethods.TIMESTAMP_FLOOR_TIME_ZONE)))
@@ -454,28 +454,28 @@ object FunctionGenerator {
// https://issues.apache.org/jira/browse/CALCITE-3199
addSqlFunction(
CEIL,
- Seq(DATE, ANY),
+ Seq(DATE, RAW),
new FloorCeilCallGen(
BuiltInMethod.CEIL.method,
Some(BuiltInMethods.UNIX_DATE_CEIL)))
addSqlFunction(
CEIL,
- Seq(TIME_WITHOUT_TIME_ZONE, ANY),
+ Seq(TIME_WITHOUT_TIME_ZONE, RAW),
new FloorCeilCallGen(
BuiltInMethod.CEIL.method,
Some(BuiltInMethod.UNIX_DATE_CEIL.method)))
addSqlFunction(
CEIL,
- Seq(TIMESTAMP_WITHOUT_TIME_ZONE, ANY),
+ Seq(TIMESTAMP_WITHOUT_TIME_ZONE, RAW),
new FloorCeilCallGen(
BuiltInMethod.CEIL.method,
Some(BuiltInMethod.UNIX_TIMESTAMP_CEIL.method)))
addSqlFunction(
CEIL,
- Seq(TIMESTAMP_WITH_LOCAL_TIME_ZONE, ANY),
+ Seq(TIMESTAMP_WITH_LOCAL_TIME_ZONE, RAW),
new FloorCeilCallGen(
BuiltInMethod.CEIL.method,
Some(BuiltInMethods.TIMESTAMP_CEIL_TIME_ZONE)))
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala
index 14a9c70..50d4f78 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala
@@ -848,7 +848,7 @@ object ScalarOperatorGens {
case (ROW, VARCHAR | CHAR) =>
generateCastBaseRowToString(ctx, operand, operand.resultType.asInstanceOf[RowType])
- case (ANY, VARCHAR | CHAR) =>
+ case (RAW, VARCHAR | CHAR) =>
generateStringResultCallIfArgsNotNull(ctx, Seq(operand)) {
terms =>
val converter = DataFormatConverters.getConverterForDataType(
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/functions/utils/UserDefinedFunctionUtils.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/functions/utils/UserDefinedFunctionUtils.scala
index f1f782d..8322063 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/functions/utils/UserDefinedFunctionUtils.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/functions/utils/UserDefinedFunctionUtils.scala
@@ -32,7 +32,7 @@ import org.apache.flink.table.runtime.types.ClassLogicalTypeConverter.{getDefaul
import org.apache.flink.table.runtime.types.LogicalTypeDataTypeConverter.{fromDataTypeToLogicalType, fromLogicalTypeToDataType}
import org.apache.flink.table.runtime.types.TypeInfoDataTypeConverter.fromDataTypeToTypeInfo
import org.apache.flink.table.runtime.types.TypeInfoLogicalTypeConverter.fromTypeInfoToLogicalType
-import org.apache.flink.table.runtime.typeutils.TypeCheckUtils.isAny
+import org.apache.flink.table.runtime.typeutils.TypeCheckUtils.isRaw
import org.apache.flink.table.types.DataType
import org.apache.flink.table.types.logical.{LogicalType, LogicalTypeRoot, RowType}
import org.apache.flink.table.types.utils.TypeConversions.fromLegacyInfoToDataType
@@ -170,7 +170,7 @@ object UserDefinedFunctionUtils {
udiTypes.zipWithIndex.map {
case (t: DataType, i) =>
// we don't trust GenericType.
- if (fromDataTypeToLogicalType(t).getTypeRoot == LogicalTypeRoot.ANY) {
+ if (fromDataTypeToLogicalType(t).getTypeRoot == LogicalTypeRoot.RAW) {
val returnType = fromLogicalTypeToDataType(expectedTypes(i))
if (expectedTypes(i).supportsOutputConversion(t.getConversionClass)) {
returnType.bridgedTo(t.getConversionClass)
@@ -747,7 +747,7 @@ object UserDefinedFunctionUtils {
internal: LogicalType,
parameterType: DataType): Boolean = {
val paraInternalType = fromDataTypeToLogicalType(parameterType)
- if (isAny(internal) && isAny(paraInternalType)) {
+ if (isRaw(internal) && isRaw(paraInternalType)) {
getDefaultExternalClassForType(internal) == getDefaultExternalClassForType(paraInternalType)
} else {
// There is a special equal to GenericType. We need rewrite type extract to BaseRow etc...
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/common/CommonLookupJoin.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/common/CommonLookupJoin.scala
index 6dcda8d..3131521 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/common/CommonLookupJoin.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/common/CommonLookupJoin.scala
@@ -46,7 +46,7 @@ import org.apache.flink.table.runtime.types.LogicalTypeDataTypeConverter.fromDat
import org.apache.flink.table.runtime.types.PlannerTypeUtils.isInteroperable
import org.apache.flink.table.runtime.typeutils.BaseRowTypeInfo
import org.apache.flink.table.sources.{LookupableTableSource, TableSource}
-import org.apache.flink.table.types.logical.{LogicalType, RowType, TypeInformationAnyType}
+import org.apache.flink.table.types.logical.{LogicalType, RowType, TypeInformationRawType}
import org.apache.flink.table.types.utils.TypeConversions.fromDataTypeToLegacyInfo
import org.apache.flink.types.Row
@@ -215,7 +215,7 @@ abstract class CommonLookupJoin(
producedTypeInfo,
udtfResultType,
extractedResultTypeInfo)
- val futureType = new TypeInformationAnyType(
+ val futureType = new TypeInformationRawType(
new GenericTypeInfo(classOf[CompletableFuture[_]]))
val parameters = Array(futureType) ++ lookupFieldTypesInOrder
checkEvalMethodSignature(
@@ -375,7 +375,7 @@ abstract class CommonLookupJoin(
} else {
expectedTypes.map {
// special case for generic type
- case gt: TypeInformationAnyType[_] => gt.getTypeInformation.getTypeClass
+ case gt: TypeInformationRawType[_] => gt.getTypeInformation.getTypeClass
case t@_ => getInternalClassForType(t)
}
}
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/GenericRelDataType.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/GenericRelDataType.scala
index 2143fa7..3a533cb 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/GenericRelDataType.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/GenericRelDataType.scala
@@ -18,22 +18,21 @@
package org.apache.flink.table.planner.plan.schema
-import org.apache.flink.table.types.logical.TypeInformationAnyType
-
import org.apache.calcite.rel.`type`.RelDataTypeSystem
import org.apache.calcite.sql.`type`.{ArraySqlType, BasicSqlType, MapSqlType, SqlTypeName}
-
import java.lang
+import org.apache.flink.table.types.logical.TypeInformationRawType
+
/**
- * Generic type for encapsulating Flink's [[TypeInformationAnyType]].
+ * Generic type for encapsulating Flink's [[TypeInformationRawType]].
*
* @param genericType LogicalType to encapsulate
* @param nullable flag if type can be nullable
* @param typeSystem Flink's type system
*/
class GenericRelDataType(
- val genericType: TypeInformationAnyType[_],
+ val genericType: TypeInformationRawType[_],
val nullable: Boolean,
typeSystem: RelDataTypeSystem)
extends BasicSqlType(
@@ -43,7 +42,7 @@ class GenericRelDataType(
isNullable = nullable
computeDigest()
- override def toString = s"ANY($genericType)"
+ override def toString = s"RAW($genericType)"
def canEqual(other: Any): Boolean = other.isInstanceOf[GenericRelDataType]
@@ -64,6 +63,6 @@ class GenericRelDataType(
* [[ArraySqlType]], [[MapSqlType]]... use generateTypeString to equals and hashcode.
*/
override def generateTypeString(sb: lang.StringBuilder, withDetail: Boolean): Unit = {
- sb.append(s"ANY('${genericType.getTypeInformation}')")
+ sb.append(s"RAW('${genericType.getTypeInformation}')")
}
}
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/utils/AggFunctionFactory.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/utils/AggFunctionFactory.scala
index 8a8c901..f0bb6cf 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/utils/AggFunctionFactory.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/utils/AggFunctionFactory.scala
@@ -642,7 +642,7 @@ class AggFunctionFactory(
private def createCollectAggFunction(argTypes: Array[LogicalType]): UserDefinedFunction = {
val elementTypeInfo = argTypes(0) match {
- case gt: TypeInformationAnyType[_] => gt.getTypeInformation
+ case gt: TypeInformationRawType[_] => gt.getTypeInformation
case t => TypeInfoLogicalTypeConverter.fromLogicalTypeToTypeInfo(t)
}
new CollectAggFunction(elementTypeInfo)
diff --git a/flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/codegen/SortCodeGeneratorTest.java b/flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/codegen/SortCodeGeneratorTest.java
index 5e1aeaf..a3eb8ad 100644
--- a/flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/codegen/SortCodeGeneratorTest.java
+++ b/flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/codegen/SortCodeGeneratorTest.java
@@ -63,7 +63,7 @@ import org.apache.flink.table.types.logical.LogicalTypeRoot;
import org.apache.flink.table.types.logical.RowType;
import org.apache.flink.table.types.logical.SmallIntType;
import org.apache.flink.table.types.logical.TinyIntType;
-import org.apache.flink.table.types.logical.TypeInformationAnyType;
+import org.apache.flink.table.types.logical.TypeInformationRawType;
import org.apache.flink.table.types.logical.VarBinaryType;
import org.apache.flink.table.types.logical.VarCharType;
import org.apache.flink.types.Row;
@@ -108,7 +108,7 @@ public class SortCodeGeneratorTest {
new ArrayType(new TinyIntType()),
RowType.of(new IntType()),
RowType.of(RowType.of(new IntType())),
- new TypeInformationAnyType<>(Types.INT)
+ new TypeInformationRawType<>(Types.INT)
};
private int[] fields;
@@ -264,7 +264,7 @@ public class SortCodeGeneratorTest {
seeds[i] = GenericRow.of(GenericRow.of(rnd.nextInt()));
}
break;
- case ANY:
+ case RAW:
seeds[i] = new BinaryGeneric<>(rnd.nextInt());
break;
default:
@@ -316,7 +316,7 @@ public class SortCodeGeneratorTest {
return bytes2;
case ROW:
return GenericRow.of(new Object[]{null});
- case ANY:
+ case RAW:
return new BinaryGeneric<>(rnd.nextInt());
default:
throw new RuntimeException("Not support!");
@@ -357,7 +357,7 @@ public class SortCodeGeneratorTest {
} else {
return GenericRow.of(GenericRow.of(new Object[]{null}));
}
- case ANY:
+ case RAW:
return new BinaryGeneric<>(rnd.nextInt());
default:
throw new RuntimeException("Not support!");
@@ -398,7 +398,7 @@ public class SortCodeGeneratorTest {
} else {
return GenericRow.of(GenericRow.of(rnd.nextInt()));
}
- case ANY:
+ case RAW:
return new BinaryGeneric<>(rnd.nextInt());
default:
throw new RuntimeException("Not support!");
@@ -529,7 +529,7 @@ public class SortCodeGeneratorTest {
if (comp != 0) {
return order ? comp : -comp;
}
- } else if (t.getTypeRoot() == LogicalTypeRoot.ANY) {
+ } else if (t.getTypeRoot() == LogicalTypeRoot.RAW) {
Integer i1 = BinaryGeneric.getJavaObjectFromBinaryGeneric((BinaryGeneric) first, IntSerializer.INSTANCE);
Integer i2 = BinaryGeneric.getJavaObjectFromBinaryGeneric((BinaryGeneric) second, IntSerializer.INSTANCE);
int comp = Integer.compare(i1, i2);
@@ -565,7 +565,7 @@ public class SortCodeGeneratorTest {
Object o2 = TypeGetterSetters.get(result.get(i), keys[j], keyTypes[j]);
if (keyTypes[j] instanceof VarBinaryType) {
Assert.assertArrayEquals(msg, (byte[]) o1, (byte[]) o2);
- } else if (keyTypes[j] instanceof TypeInformationAnyType) {
+ } else if (keyTypes[j] instanceof TypeInformationRawType) {
assertThat(
msg,
(BinaryGeneric) o1,
diff --git a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/calcite/FlinkTypeFactory.scala b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/calcite/FlinkTypeFactory.scala
index 8f43550..6590b4b 100644
--- a/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/calcite/FlinkTypeFactory.scala
+++ b/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/calcite/FlinkTypeFactory.scala
@@ -308,9 +308,9 @@ class FlinkTypeFactory(typeSystem: RelDataTypeSystem) extends JavaTypeFactoryImp
} else {
// types are not all the same
if (allTypes.exists(_.getSqlTypeName == SqlTypeName.ANY)) {
- // one of the type was ANY.
+ // one of the type was RAW.
// we cannot generate a common type if it differs from other types.
- throw new TableException("Generic ANY types must have a common type information.")
+ throw new TableException("Generic RAW types must have a common type information.")
} else {
// cannot resolve a common type for different input types
None
diff --git a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryWriter.java b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryWriter.java
index 1d8415c..9d705fd 100644
--- a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryWriter.java
+++ b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryWriter.java
@@ -126,7 +126,7 @@ public interface BinaryWriter {
case ROW:
writer.writeRow(pos, (BaseRow) o, (BaseRowSerializer) serializer);
break;
- case ANY:
+ case RAW:
writer.writeGeneric(pos, (BinaryGeneric) o, (BinaryGenericSerializer) serializer);
break;
case BINARY:
diff --git a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/DataFormatConverters.java b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/DataFormatConverters.java
index 1185457..b7f2249 100644
--- a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/DataFormatConverters.java
+++ b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/DataFormatConverters.java
@@ -41,7 +41,7 @@ import org.apache.flink.table.types.KeyValueDataType;
import org.apache.flink.table.types.logical.DecimalType;
import org.apache.flink.table.types.logical.LegacyTypeInformationType;
import org.apache.flink.table.types.logical.LogicalType;
-import org.apache.flink.table.types.logical.TypeInformationAnyType;
+import org.apache.flink.table.types.logical.TypeInformationRawType;
import org.apache.flink.table.types.utils.TypeConversions;
import org.apache.flink.types.Row;
@@ -224,10 +224,10 @@ public class DataFormatConverters {
} else {
return new PojoConverter((PojoTypeInfo) compositeType, fieldTypes);
}
- case ANY:
+ case RAW:
TypeInformation typeInfo = logicalType instanceof LegacyTypeInformationType ?
((LegacyTypeInformationType) logicalType).getTypeInformation() :
- ((TypeInformationAnyType) logicalType).getTypeInformation();
+ ((TypeInformationRawType) logicalType).getTypeInformation();
// planner type info
if (typeInfo instanceof BinaryStringTypeInfo) {
diff --git a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/TypeGetterSetters.java b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/TypeGetterSetters.java
index e1fffd1..bb233e2 100644
--- a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/TypeGetterSetters.java
+++ b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/TypeGetterSetters.java
@@ -213,7 +213,7 @@ public interface TypeGetterSetters {
case BINARY:
case VARBINARY:
return row.getBinary(ordinal);
- case ANY:
+ case RAW:
return row.getGeneric(ordinal);
default:
throw new RuntimeException("Not support type: " + type);
diff --git a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/types/ClassLogicalTypeConverter.java b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/types/ClassLogicalTypeConverter.java
index 7c7ad74..2a231f1 100644
--- a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/types/ClassLogicalTypeConverter.java
+++ b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/types/ClassLogicalTypeConverter.java
@@ -77,7 +77,7 @@ public class ClassLogicalTypeConverter {
case BINARY:
case VARBINARY:
return byte[].class;
- case ANY:
+ case RAW:
return BinaryGeneric.class;
default:
throw new RuntimeException("Not support type: " + type);
diff --git a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/types/InternalSerializers.java b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/types/InternalSerializers.java
index 928215e..f5d7c43 100644
--- a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/types/InternalSerializers.java
+++ b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/types/InternalSerializers.java
@@ -41,7 +41,7 @@ import org.apache.flink.table.types.logical.LogicalType;
import org.apache.flink.table.types.logical.MapType;
import org.apache.flink.table.types.logical.MultisetType;
import org.apache.flink.table.types.logical.RowType;
-import org.apache.flink.table.types.logical.TypeInformationAnyType;
+import org.apache.flink.table.types.logical.TypeInformationRawType;
/**
* {@link TypeSerializer} of {@link LogicalType} for internal sql engine execution data formats.
@@ -89,9 +89,9 @@ public class InternalSerializers {
case BINARY:
case VARBINARY:
return BytePrimitiveArraySerializer.INSTANCE;
- case ANY:
+ case RAW:
return new BinaryGenericSerializer(
- ((TypeInformationAnyType) type).getTypeInformation().createSerializer(config));
+ ((TypeInformationRawType) type).getTypeInformation().createSerializer(config));
default:
throw new RuntimeException("Not support type: " + type);
}
diff --git a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/types/LogicalTypeDataTypeConverter.java b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/types/LogicalTypeDataTypeConverter.java
index 2df059f..2decb42 100644
--- a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/types/LogicalTypeDataTypeConverter.java
+++ b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/types/LogicalTypeDataTypeConverter.java
@@ -35,7 +35,7 @@ import org.apache.flink.table.types.logical.LogicalType;
import org.apache.flink.table.types.logical.MapType;
import org.apache.flink.table.types.logical.MultisetType;
import org.apache.flink.table.types.logical.RowType;
-import org.apache.flink.table.types.logical.TypeInformationAnyType;
+import org.apache.flink.table.types.logical.TypeInformationRawType;
import org.apache.flink.table.types.logical.utils.LogicalTypeDefaultVisitor;
import org.apache.flink.table.types.utils.TypeConversions;
@@ -99,7 +99,7 @@ public class LogicalTypeDataTypeConverter {
BigDecimalTypeInfo decimalType = (BigDecimalTypeInfo) typeInfo;
return new DecimalType(decimalType.precision(), decimalType.scale());
} else {
- return new TypeInformationAnyType<>(typeInfo);
+ return new TypeInformationRawType<>(typeInfo);
}
} else {
return logicalType;
diff --git a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/typeutils/TypeCheckUtils.java b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/typeutils/TypeCheckUtils.java
index 01c7ecf..e73e89f 100644
--- a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/typeutils/TypeCheckUtils.java
+++ b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/typeutils/TypeCheckUtils.java
@@ -23,13 +23,13 @@ import org.apache.flink.table.types.logical.LogicalTypeFamily;
import org.apache.flink.table.types.logical.TimestampKind;
import org.apache.flink.table.types.logical.TimestampType;
-import static org.apache.flink.table.types.logical.LogicalTypeRoot.ANY;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.ARRAY;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.BIGINT;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.BOOLEAN;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.DECIMAL;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.INTEGER;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.MAP;
+import static org.apache.flink.table.types.logical.LogicalTypeRoot.RAW;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.ROW;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.TIMESTAMP_WITHOUT_TIME_ZONE;
import static org.apache.flink.table.types.logical.LogicalTypeRoot.TIMESTAMP_WITH_LOCAL_TIME_ZONE;
@@ -109,8 +109,8 @@ public class TypeCheckUtils {
return type.getTypeRoot() == MAP;
}
- public static boolean isAny(LogicalType type) {
- return type.getTypeRoot() == ANY;
+ public static boolean isRaw(LogicalType type) {
+ return type.getTypeRoot() == RAW;
}
public static boolean isRow(LogicalType type) {
@@ -118,7 +118,7 @@ public class TypeCheckUtils {
}
public static boolean isComparable(LogicalType type) {
- return !isAny(type) && !isMap(type) && !isRow(type) && !isArray(type);
+ return !isRaw(type) && !isMap(type) && !isRow(type) && !isArray(type);
}
public static boolean isMutable(LogicalType type) {
@@ -130,7 +130,7 @@ public class TypeCheckUtils {
case MULTISET:
case MAP:
case ROW:
- case ANY:
+ case RAW:
return true;
default:
return false;
diff --git a/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/dataformat/NestedRowTest.java b/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/dataformat/NestedRowTest.java
index 23e3713..cfea23a 100644
--- a/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/dataformat/NestedRowTest.java
+++ b/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/dataformat/NestedRowTest.java
@@ -147,7 +147,7 @@ public class NestedRowTest {
DataTypes.BIGINT().getLogicalType(),
DataTypes.STRING().getLogicalType(),
DataTypes.STRING().getLogicalType(),
- DataTypes.ANY(info).getLogicalType()
+ DataTypes.RAW(info).getLogicalType()
},
new TypeSerializer[]{
IntSerializer.INSTANCE,
diff --git a/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/types/LogicalTypeAssignableTest.java b/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/types/LogicalTypeAssignableTest.java
index f520987..67209f0 100644
--- a/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/types/LogicalTypeAssignableTest.java
+++ b/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/types/LogicalTypeAssignableTest.java
@@ -43,7 +43,7 @@ import org.apache.flink.table.types.logical.TimeType;
import org.apache.flink.table.types.logical.TimestampKind;
import org.apache.flink.table.types.logical.TimestampType;
import org.apache.flink.table.types.logical.TinyIntType;
-import org.apache.flink.table.types.logical.TypeInformationAnyType;
+import org.apache.flink.table.types.logical.TypeInformationRawType;
import org.apache.flink.table.types.logical.VarBinaryType;
import org.apache.flink.table.types.logical.VarCharType;
import org.apache.flink.table.types.logical.YearMonthIntervalType;
@@ -236,8 +236,8 @@ public class LogicalTypeAssignableTest {
},
{
- new TypeInformationAnyType<>(Types.GENERIC(PlannerTypeUtils.class)),
- new TypeInformationAnyType<>(Types.GENERIC(Object.class)),
+ new TypeInformationRawType<>(Types.GENERIC(PlannerTypeUtils.class)),
+ new TypeInformationRawType<>(Types.GENERIC(Object.class)),
false
},
diff --git a/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/typeutils/BaseArraySerializerTest.java b/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/typeutils/BaseArraySerializerTest.java
index 35bbc69..56fc2e1 100644
--- a/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/typeutils/BaseArraySerializerTest.java
+++ b/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/typeutils/BaseArraySerializerTest.java
@@ -112,7 +112,7 @@ public class BaseArraySerializerTest extends SerializerTestBase<BaseArray> {
private BaseArraySerializer createSerializerWithConfig(ExecutionConfig config) {
return new BaseArraySerializer(
- DataTypes.ANY(TypeInformation.of(MyObj.class)).getLogicalType(), config);
+ DataTypes.RAW(TypeInformation.of(MyObj.class)).getLogicalType(), config);
}
@Override
diff --git a/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/typeutils/BaseMapSerializerTest.java b/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/typeutils/BaseMapSerializerTest.java
index 02c0b67..abba86e 100644
--- a/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/typeutils/BaseMapSerializerTest.java
+++ b/flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/typeutils/BaseMapSerializerTest.java
@@ -107,7 +107,7 @@ public class BaseMapSerializerTest extends SerializerTestBase<BaseMap> {
MyObj outputObj = BinaryGeneric.getJavaObjectFromBinaryGeneric(
(BinaryGeneric) outputMap.toJavaMap(
- DataTypes.INT().getLogicalType(), DataTypes.ANY(TypeInformation.of(MyObj.class)).getLogicalType())
+ DataTypes.INT().getLogicalType(), DataTypes.RAW(TypeInformation.of(MyObj.class)).getLogicalType())
.get(inputKey), new KryoSerializer<>(MyObj.class, config));
assertEquals(inputObj, outputObj);
}
@@ -115,7 +115,7 @@ public class BaseMapSerializerTest extends SerializerTestBase<BaseMap> {
private BaseMapSerializer createSerializerWithConfig(ExecutionConfig config) {
return new BaseMapSerializer(
DataTypes.INT().getLogicalType(),
- DataTypes.ANY(TypeInformation.of(MyObj.class)).getLogicalType(),
+ DataTypes.RAW(TypeInformation.of(MyObj.class)).getLogicalType(),
config);
}