code
stringlengths
25
201k
docstring
stringlengths
19
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
51
path
stringlengths
11
314
url
stringlengths
62
377
license
stringclasses
7 values
public static DataType SMALLINT() { return new AtomicDataType(new SmallIntType()); }
Data type of a 2-byte signed integer with values from -32,768 to 32,767. @see SmallIntType
SMALLINT
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType INT() { return new AtomicDataType(new IntType()); }
Data type of a 4-byte signed integer with values from -2,147,483,648 to 2,147,483,647. @see IntType
INT
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType BIGINT() { return new AtomicDataType(new BigIntType()); }
Data type of an 8-byte signed integer with values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. @see BigIntType
BIGINT
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType FLOAT() { return new AtomicDataType(new FloatType()); }
Data type of a 4-byte single precision floating point number. @see FloatType
FLOAT
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType DOUBLE() { return new AtomicDataType(new DoubleType()); }
Data type of an 8-byte double precision floating point number. @see DoubleType
DOUBLE
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType DATE() { return new AtomicDataType(new DateType()); }
Data type of a date consisting of {@code year-month-day} with values ranging from {@code 0000-01-01} to {@code 9999-12-31}. <p>Compared to the SQL standard, the range starts at year {@code 0000}. @see DataType
DATE
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType TIME(int precision) { return new AtomicDataType(new TimeType(precision)); }
Data type of a time WITHOUT time zone {@code TIME(p)} where {@code p} is the number of digits of fractional seconds (=precision). {@code p} must have a value between 0 and 9 (both inclusive). <p>An instance consists of {@code hour:minute:second[.fractional]} with up to nanosecond precision and values ranging from {@code 00:00:00.000000000} to {@code 23:59:59.999999999}. <p>Compared to the SQL standard, leap seconds (23:59:60 and 23:59:61) are not supported as the semantics are closer to {@link java.time.LocalTime}. A time WITH time zone is not provided. @see #TIME() @see TimeType
TIME
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType TIME() { return new AtomicDataType(new TimeType()); }
Data type of a time WITHOUT time zone {@code TIME} with no fractional seconds by default. <p>An instance consists of {@code hour:minute:second} with up to second precision and values ranging from {@code 00:00:00} to {@code 23:59:59}. <p>Compared to the SQL standard, leap seconds (23:59:60 and 23:59:61) are not supported as the semantics are closer to {@link java.time.LocalTime}. A time WITH time zone is not provided. @see #TIME(int) @see TimeType
TIME
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType TIMESTAMP(int precision) { return new AtomicDataType(new TimestampType(precision)); }
Data type of a timestamp WITHOUT time zone {@code TIMESTAMP(p)} where {@code p} is the number of digits of fractional seconds (=precision). {@code p} must have a value between 0 and 9 (both inclusive). <p>An instance consists of {@code year-month-day hour:minute:second[.fractional]} with up to nanosecond precision and values ranging from {@code 0000-01-01 00:00:00.000000000} to {@code 9999-12-31 23:59:59.999999999}. <p>Compared to the SQL standard, leap seconds (23:59:60 and 23:59:61) are not supported as the semantics are closer to {@link java.time.LocalDateTime}. @see #TIMESTAMP_WITH_TIME_ZONE(int) @see #TIMESTAMP_WITH_LOCAL_TIME_ZONE(int) @see TimestampType
TIMESTAMP
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType TIMESTAMP() { return new AtomicDataType(new TimestampType()); }
Data type of a timestamp WITHOUT time zone {@code TIMESTAMP} with 6 digits of fractional seconds by default. <p>An instance consists of {@code year-month-day hour:minute:second[.fractional]} with up to microsecond precision and values ranging from {@code 0000-01-01 00:00:00.000000} to {@code 9999-12-31 23:59:59.999999}. <p>Compared to the SQL standard, leap seconds (23:59:60 and 23:59:61) are not supported as the semantics are closer to {@link java.time.LocalDateTime}. @see #TIMESTAMP(int) @see #TIMESTAMP_WITH_TIME_ZONE(int) @see #TIMESTAMP_WITH_LOCAL_TIME_ZONE(int) @see TimestampType
TIMESTAMP
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType TIMESTAMP_WITH_TIME_ZONE(int precision) { return new AtomicDataType(new ZonedTimestampType(precision)); }
Data type of a timestamp WITH time zone {@code TIMESTAMP(p) WITH TIME ZONE} where {@code p} is the number of digits of fractional seconds (=precision). {@code p} must have a value between 0 and 9 (both inclusive). <p>An instance consists of {@code year-month-day hour:minute:second[.fractional] zone} with up to nanosecond precision and values ranging from {@code 0000-01-01 00:00:00.000000000 +14:59} to {@code 9999-12-31 23:59:59.999999999 -14:59}. <p>Compared to the SQL standard, leap seconds (23:59:60 and 23:59:61) are not supported as the semantics are closer to {@link java.time.OffsetDateTime}. @see #TIMESTAMP(int) @see #TIMESTAMP_WITH_LOCAL_TIME_ZONE(int) @see ZonedTimestampType
TIMESTAMP_WITH_TIME_ZONE
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType TIMESTAMP_WITH_TIME_ZONE() { return new AtomicDataType(new ZonedTimestampType()); }
Data type of a timestamp WITH time zone {@code TIMESTAMP WITH TIME ZONE} with 6 digits of fractional seconds by default. <p>An instance consists of {@code year-month-day hour:minute:second[.fractional] zone} with up to microsecond precision and values ranging from {@code 0000-01-01 00:00:00.000000 +14:59} to {@code 9999-12-31 23:59:59.999999 -14:59}. <p>Compared to the SQL standard, leap seconds (23:59:60 and 23:59:61) are not supported as the semantics are closer to {@link java.time.OffsetDateTime}. @see #TIMESTAMP_WITH_TIME_ZONE(int) @see #TIMESTAMP(int) @see #TIMESTAMP_WITH_LOCAL_TIME_ZONE(int) @see ZonedTimestampType
TIMESTAMP_WITH_TIME_ZONE
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType TIMESTAMP_WITH_LOCAL_TIME_ZONE(int precision) { return new AtomicDataType(new LocalZonedTimestampType(precision)); }
Data type of a timestamp WITH LOCAL time zone {@code TIMESTAMP(p) WITH LOCAL TIME ZONE} where {@code p} is the number of digits of fractional seconds (=precision). {@code p} must have a value between 0 and 9 (both inclusive). <p>An instance consists of {@code year-month-day hour:minute:second[.fractional] zone} with up to nanosecond precision and values ranging from {@code 0000-01-01 00:00:00.000000000 +14:59} to {@code 9999-12-31 23:59:59.999999999 -14:59}. Leap seconds (23:59:60 and 23:59:61) are not supported as the semantics are closer to {@link java.time.OffsetDateTime}. <p>Compared to {@link ZonedTimestampType}, the time zone offset information is not stored physically in every datum. Instead, the type assumes {@link java.time.Instant} semantics in UTC time zone at the edges of the table ecosystem. Every datum is interpreted in the local time zone configured in the current session for computation and visualization. <p>This type fills the gap between time zone free and time zone mandatory timestamp types by allowing the interpretation of UTC timestamps according to the configured session timezone. @see #TIMESTAMP(int) @see #TIMESTAMP_WITH_TIME_ZONE(int) @see LocalZonedTimestampType
TIMESTAMP_WITH_LOCAL_TIME_ZONE
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType TIMESTAMP_LTZ(int precision) { return new AtomicDataType(new LocalZonedTimestampType(precision)); }
Data type of a timestamp WITH LOCAL time zone. This is a synonym for {@link DataTypes#TIMESTAMP_WITH_LOCAL_TIME_ZONE(int)}.
TIMESTAMP_LTZ
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType TIMESTAMP_WITH_LOCAL_TIME_ZONE() { return new AtomicDataType(new LocalZonedTimestampType()); }
Data type of a timestamp WITH LOCAL time zone {@code TIMESTAMP WITH LOCAL TIME ZONE} with 6 digits of fractional seconds by default. <p>An instance consists of {@code year-month-day hour:minute:second[.fractional] zone} with up to microsecond precision and values ranging from {@code 0000-01-01 00:00:00.000000 +14:59} to {@code 9999-12-31 23:59:59.999999 -14:59}. Leap seconds (23:59:60 and 23:59:61) are not supported as the semantics are closer to {@link java.time.OffsetDateTime}. <p>Compared to {@link ZonedTimestampType}, the time zone offset information is not stored physically in every datum. Instead, the type assumes {@link java.time.Instant} semantics in UTC time zone at the edges of the table ecosystem. Every datum is interpreted in the local time zone configured in the current session for computation and visualization. <p>This type fills the gap between time zone free and time zone mandatory timestamp types by allowing the interpretation of UTC timestamps according to the configured session timezone. @see #TIMESTAMP_WITH_LOCAL_TIME_ZONE(int) @see #TIMESTAMP(int) @see #TIMESTAMP_WITH_TIME_ZONE(int) @see LocalZonedTimestampType
TIMESTAMP_WITH_LOCAL_TIME_ZONE
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType TIMESTAMP_LTZ() { return new AtomicDataType(new LocalZonedTimestampType()); }
Data type of a timestamp WITH LOCAL time zone. This is a synonym for {@link DataTypes#TIMESTAMP_WITH_LOCAL_TIME_ZONE()}.
TIMESTAMP_LTZ
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType INTERVAL(Resolution resolution) { Preconditions.checkNotNull(resolution, "Interval resolution must not be null."); return new AtomicDataType(Resolution.resolveInterval(resolution, null)); }
Data type of a temporal interval. There are two types of temporal intervals: day-time intervals with up to nanosecond granularity or year-month intervals with up to month granularity. <p>An interval of day-time consists of {@code +days hours:months:seconds.fractional} with values ranging from {@code -999999 23:59:59.999999999} to {@code +999999 23:59:59.999999999}. The type must be parameterized to one of the following resolutions: interval of days, interval of days to hours, interval of days to minutes, interval of days to seconds, interval of hours, interval of hours to minutes, interval of hours to seconds, interval of minutes, interval of minutes to seconds, or interval of seconds. The value representation is the same for all types of resolutions. For example, an interval of seconds of 70 is always represented in an interval-of-days-to-seconds format (with default precisions): {@code +00 00:01:10.000000}). <p>An interval of year-month consists of {@code +years-months} with values ranging from {@code -9999-11} to {@code +9999-11}. The type must be parameterized to one of the following resolutions: interval of years, interval of years to months, or interval of months. The value representation is the same for all types of resolutions. For example, an interval of months of 50 is always represented in an interval-of-years-to-months format (with default year precision): {@code +04-02}. <p>Examples: {@code INTERVAL(DAY(2))} for a day-time interval or {@code INTERVAL(YEAR(4))} for a year-month interval. @see DayTimeIntervalType @see YearMonthIntervalType
INTERVAL
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType INTERVAL(Resolution upperResolution, Resolution lowerResolution) { Preconditions.checkNotNull(upperResolution, "Upper interval resolution must not be null."); Preconditions.checkNotNull(lowerResolution, "Lower interval resolution must not be null."); return new AtomicDataType(Resolution.resolveInterval(upperResolution, lowerResolution)); }
Data type of a temporal interval. There are two types of temporal intervals: day-time intervals with up to nanosecond granularity or year-month intervals with up to month granularity. <p>An interval of day-time consists of {@code +days hours:months:seconds.fractional} with values ranging from {@code -999999 23:59:59.999999999} to {@code +999999 23:59:59.999999999}. The type must be parameterized to one of the following resolutions: interval of days, interval of days to hours, interval of days to minutes, interval of days to seconds, interval of hours, interval of hours to minutes, interval of hours to seconds, interval of minutes, interval of minutes to seconds, or interval of seconds. The value representation is the same for all types of resolutions. For example, an interval of seconds of 70 is always represented in an interval-of-days-to-seconds format (with default precisions): {@code +00 00:01:10.000000}. <p>An interval of year-month consists of {@code +years-months} with values ranging from {@code -9999-11} to {@code +9999-11}. The type must be parameterized to one of the following resolutions: interval of years, interval of years to months, or interval of months. The value representation is the same for all types of resolutions. For example, an interval of months of 50 is always represented in an interval-of-years-to-months format (with default year precision): {@code +04-02}. <p>Examples: {@code INTERVAL(DAY(2), SECOND(9))} for a day-time interval or {@code INTERVAL(YEAR(4), MONTH())} for a year-month interval. @see DayTimeIntervalType @see YearMonthIntervalType
INTERVAL
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType ARRAY(DataType elementDataType) { Preconditions.checkNotNull(elementDataType, "Element data type must not be null."); return new CollectionDataType( new ArrayType(elementDataType.getLogicalType()), elementDataType); }
Data type of an array of elements with same subtype. <p>Compared to the SQL standard, the maximum cardinality of an array cannot be specified but is fixed at {@link Integer#MAX_VALUE}. Also, any valid type is supported as a subtype. @see ArrayType
ARRAY
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static UnresolvedDataType ARRAY(AbstractDataType<?> elementDataType) { Preconditions.checkNotNull(elementDataType, "Element data type must not be null."); return new UnresolvedDataType( () -> String.format(ArrayType.FORMAT, elementDataType), factory -> ARRAY(factory.createDataType(elementDataType))); }
Unresolved data type of an array of elements with same subtype. <p>Compared to the SQL standard, the maximum cardinality of an array cannot be specified but is fixed at {@link Integer#MAX_VALUE}. Also, any valid type is supported as a subtype. <p>Note: Compared to {@link #ARRAY(DataType)}, this method produces an {@link UnresolvedDataType}. In most of the cases, the {@link UnresolvedDataType} will be automatically resolved by the API. At other locations, a {@link DataTypeFactory} is provided. @see ArrayType
ARRAY
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType MULTISET(DataType elementDataType) { Preconditions.checkNotNull(elementDataType, "Element data type must not be null."); return new CollectionDataType( new MultisetType(elementDataType.getLogicalType()), elementDataType); }
Data type of a multiset (=bag). Unlike a set, it allows for multiple instances for each of its elements with a common subtype. Each unique value (including {@code NULL}) is mapped to some multiplicity. <p>There is no restriction of element types; it is the responsibility of the user to ensure uniqueness. @see MultisetType
MULTISET
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static UnresolvedDataType MULTISET(AbstractDataType<?> elementDataType) { Preconditions.checkNotNull(elementDataType, "Element data type must not be null."); return new UnresolvedDataType( () -> String.format(MultisetType.FORMAT, elementDataType), factory -> MULTISET(factory.createDataType(elementDataType))); }
Unresolved data type of a multiset (=bag). Unlike a set, it allows for multiple instances for each of its elements with a common subtype. Each unique value (including {@code NULL}) is mapped to some multiplicity. <p>There is no restriction of element types; it is the responsibility of the user to ensure uniqueness. <p>Note: Compared to {@link #MULTISET(DataType)}, this method produces an {@link UnresolvedDataType}. In most of the cases, the {@link UnresolvedDataType} will be automatically resolved by the API. At other locations, a {@link DataTypeFactory} is provided. @see MultisetType
MULTISET
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType MAP(DataType keyDataType, DataType valueDataType) { Preconditions.checkNotNull(keyDataType, "Key data type must not be null."); Preconditions.checkNotNull(valueDataType, "Value data type must not be null."); return new KeyValueDataType( new MapType(keyDataType.getLogicalType(), valueDataType.getLogicalType()), keyDataType, valueDataType); }
Data type of an associative array that maps keys (including {@code NULL}) to values (including {@code NULL}). A map cannot contain duplicate keys; each key can map to at most one value. <p>There is no restriction of key types; it is the responsibility of the user to ensure uniqueness. The map type is an extension to the SQL standard. @see MapType
MAP
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static UnresolvedDataType MAP( AbstractDataType<?> keyDataType, AbstractDataType<?> valueDataType) { Preconditions.checkNotNull(keyDataType, "Key data type must not be null."); Preconditions.checkNotNull(valueDataType, "Value data type must not be null."); return new UnresolvedDataType( () -> String.format(MapType.FORMAT, keyDataType, valueDataType), factory -> MAP( factory.createDataType(keyDataType), factory.createDataType(valueDataType))); }
Unresolved data type of an associative array that maps keys (including {@code NULL}) to values (including {@code NULL}). A map cannot contain duplicate keys; each key can map to at most one value. <p>There is no restriction of key types; it is the responsibility of the user to ensure uniqueness. The map type is an extension to the SQL standard. <p>Note: Compared to {@link #MAP(DataType, DataType)}, this method produces an {@link UnresolvedDataType}. In most of the cases, the {@link UnresolvedDataType} will be automatically resolved by the API. At other locations, a {@link DataTypeFactory} is provided. @see MapType
MAP
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType ROW(Field... fields) { final List<RowField> logicalFields = Stream.of(fields) .map( f -> Preconditions.checkNotNull( f, "Field definition must not be null.")) .map(f -> new RowField(f.name, f.dataType.getLogicalType(), f.description)) .collect(Collectors.toList()); final List<DataType> fieldDataTypes = Stream.of(fields).map(f -> f.dataType).collect(Collectors.toList()); return new FieldsDataType(new RowType(logicalFields), fieldDataTypes); }
Data type of a sequence of fields. A field consists of a field name, field type, and an optional description. The most specific type of a row of a table is a row type. In this case, each column of the row corresponds to the field of the row type that has the same ordinal position as the column. <p>Compared to the SQL standard, an optional field description simplifies the handling with complex structures. <p>Use {@link #FIELD(String, DataType)} or {@link #FIELD(String, DataType, String)} to construct fields. @see RowType
ROW
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType ROW(DataType... fieldDataTypes) { return ROW( IntStream.range(0, fieldDataTypes.length) .mapToObj(idx -> FIELD("f" + idx, fieldDataTypes[idx])) .toArray(Field[]::new)); }
Data type of a sequence of fields. <p>This is shortcut for {@link #ROW(Field...)} where the field names will be generated using {@code f0, f1, f2, ...}.
ROW
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType ROW() { return ROW(new Field[0]); }
Data type of a row type with no fields. It only exists for completeness. @see #ROW(Field...)
ROW
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static UnresolvedDataType ROW(AbstractField... fields) { Stream.of(fields) .forEach(f -> Preconditions.checkNotNull(f, "Field definition must not be null.")); return new UnresolvedDataType( () -> String.format( RowType.FORMAT, Stream.of(fields) .map(Object::toString) .collect(Collectors.joining(", "))), factory -> { final Field[] fieldsArray = Stream.of(fields) .map( f -> new Field( f.name, factory.createDataType( f.getAbstractDataType()), f.description)) .toArray(Field[]::new); return ROW(fieldsArray); }); }
Unresolved data type of a sequence of fields. A field consists of a field name, field type, and an optional description. The most specific type of a row of a table is a row type. In this case, each column of the row corresponds to the field of the row type that has the same ordinal position as the column. <p>Compared to the SQL standard, an optional field description simplifies the handling with complex structures. <p>Use {@link #FIELD(String, AbstractDataType)} or {@link #FIELD(String, AbstractDataType, String)} to construct fields. <p>Note: Compared to {@link #ROW(Field...)}, this method produces an {@link UnresolvedDataType} with {@link UnresolvedField}s. In most of the cases, the {@link UnresolvedDataType} will be automatically resolved by the API. At other locations, a {@link DataTypeFactory} is provided. @see RowType
ROW
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static UnresolvedDataType ROW(AbstractDataType<?>... fieldDataTypes) { return ROW( IntStream.range(0, fieldDataTypes.length) .mapToObj(idx -> FIELD("f" + idx, fieldDataTypes[idx])) .toArray(AbstractField[]::new)); }
Data type of a sequence of fields. <p>This is shortcut for {@link #ROW(AbstractField...)} where the field names will be generated using {@code f0, f1, f2, ...}.
ROW
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType NULL() { return new AtomicDataType(new NullType()); }
Data type for representing untyped {@code NULL} values. A null type has no other value except {@code NULL}, thus, it can be cast to any nullable type similar to JVM semantics. <p>This type helps in representing unknown types in API calls that use a {@code NULL} literal as well as bridging to formats such as JSON or Avro that define such a type as well. <p>The null type is an extension to the SQL standard. <p>Note: The runtime does not support this type. It is a pure helper type during translation and planning. Table columns cannot be declared with this type. Functions cannot declare return types of this type. @see NullType
NULL
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static DataType DESCRIPTOR() { return new AtomicDataType(new DescriptorType()); }
Data type for describing an arbitrary, unvalidated list of columns. <p>This type is the return type of calls to {@code DESCRIPTOR(`c0`, `c1`)}. The type is intended to be used in arguments of {@link ProcessTableFunction}s. <p>Note: The runtime does not support this type. It is a pure helper type during translation and planning. Table columns cannot be declared with this type. Functions cannot declare return types of this type. @see DescriptorType
DESCRIPTOR
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static <T> DataType RAW(Class<T> clazz, TypeSerializer<T> serializer) { return new AtomicDataType(new RawType<>(clazz, serializer)); }
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 raw type is an extension to the SQL standard. <p>This method assumes that a {@link TypeSerializer} instance is present. Use {@link #RAW(Class)} for automatically generating a serializer. @param clazz originating value class @param serializer type serializer @see RawType
RAW
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static <T> UnresolvedDataType RAW(Class<T> clazz) { return new UnresolvedDataType( () -> String.format(RawType.FORMAT, clazz.getName(), "?"), factory -> factory.createRawDataType(clazz)); }
Unresolved 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 raw type is an extension to the SQL standard. <p>Compared to {@link #RAW(Class, TypeSerializer)}, this method produces an {@link UnresolvedDataType} where no serializer is known and a generic serializer should be used. During the resolution, a {@link DataTypes#RAW(Class, TypeSerializer)} with Flink's default RAW serializer is created and automatically configured. <p>Note: In most of the cases, the {@link UnresolvedDataType} will be automatically resolved by the API. At other locations, a {@link DataTypeFactory} is provided. @see RawType
RAW
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static <T> UnresolvedDataType RAW(TypeInformation<T> typeInformation) { return new UnresolvedDataType( () -> String.format(RawType.FORMAT, typeInformation.getTypeClass().getName(), "?"), factory -> factory.createRawDataType(typeInformation)); }
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 raw type is an extension to the SQL standard. <p>Compared to {@link #RAW(Class, TypeSerializer)}, this method produces an {@link UnresolvedDataType} where the serializer will be generated from the enclosed {@link TypeInformation} later. <p>Note: In most of the cases, the {@link UnresolvedDataType} will be automatically resolved by the API. At other locations, a {@link DataTypeFactory} is provided. @see RawType
RAW
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static Resolution SECOND() { return new Resolution( Resolution.IntervalUnit.SECOND, DayTimeIntervalType.DEFAULT_FRACTIONAL_PRECISION); }
Resolution in seconds with 6 digits for fractional seconds by default. @see #SECOND(int)
SECOND
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static Resolution SECOND(int precision) { return new Resolution(Resolution.IntervalUnit.SECOND, precision); }
Resolution in seconds and (possibly) fractional seconds. The precision is the number of digits of fractional seconds. It must have a value between 0 and 9 (both inclusive). If no fractional is specified, it is equal to 6 by default. @see #SECOND()
SECOND
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static Resolution DAY(int precision) { return new Resolution(Resolution.IntervalUnit.DAY, precision); }
Resolution in days. The precision is the number of digits of days. It must have a value between 1 and 6 (both inclusive). If no precision is specified, it is equal to 2 by default. @see #DAY()
DAY
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static Resolution DAY() { return new Resolution( Resolution.IntervalUnit.DAY, DayTimeIntervalType.DEFAULT_DAY_PRECISION); }
Resolution in days with 2 digits for the number of days by default. @see #DAY(int)
DAY
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static Resolution YEAR(int precision) { return new Resolution(Resolution.IntervalUnit.YEAR, precision); }
Resolution in years. The precision is the number of digits of years. It must have a value between 1 and 4 (both inclusive). If no precision is specified, it is equal to 2. @see #YEAR()
YEAR
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static Resolution YEAR() { return new Resolution( Resolution.IntervalUnit.YEAR, YearMonthIntervalType.DEFAULT_PRECISION); }
Resolution in years with 2 digits for the number of years by default. @see #YEAR(int)
YEAR
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static Field FIELD(String name, DataType dataType) { return new Field( Preconditions.checkNotNull(name, "Field name must not be null."), Preconditions.checkNotNull(dataType, "Field data type must not be null."), null); }
Field definition with field name and data type.
FIELD
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static Field FIELD(String name, DataType dataType, String description) { return new Field( Preconditions.checkNotNull(name, "Field name must not be null."), Preconditions.checkNotNull(dataType, "Field data type must not be null."), Preconditions.checkNotNull(description, "Field description must not be null.")); }
Field definition with field name, data type, and a description.
FIELD
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static UnresolvedField FIELD(String name, AbstractDataType<?> fieldDataType) { return new UnresolvedField( Preconditions.checkNotNull(name, "Field name must not be null."), Preconditions.checkNotNull(fieldDataType, "Field data type must not be null."), null); }
Unresolved field definition with field name and data type. <p>Note: Compared to {@link #FIELD(String, DataType)}, this method produces an {@link UnresolvedField} that can contain an {@link UnresolvedDataType}.
FIELD
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static UnresolvedField FIELD( String name, AbstractDataType<?> fieldDataType, String description) { return new UnresolvedField( Preconditions.checkNotNull(name, "Field name must not be null."), Preconditions.checkNotNull(fieldDataType, "Field data type must not be null."), Preconditions.checkNotNull(description, "Field description must not be null.")); }
Unresolved field definition with field name, unresolved data type, and a description. <p>Note: Compared to {@link #FIELD(String, DataType, String)}, this method produces an {@link UnresolvedField} that can contain an {@link UnresolvedDataType}.
FIELD
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/DataTypes.java
Apache-2.0
public static Schema.Builder newBuilder() { return new Builder(); }
Builder for configuring and creating instances of {@link Schema}.
newBuilder
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder fromSchema(Schema unresolvedSchema) { columns.addAll(unresolvedSchema.columns); watermarkSpecs.addAll(unresolvedSchema.watermarkSpecs); if (unresolvedSchema.primaryKey != null) { primaryKeyNamed( unresolvedSchema.primaryKey.getConstraintName(), unresolvedSchema.primaryKey.getColumnNames()); } return this; }
Adopts all members from the given unresolved schema.
fromSchema
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder fromResolvedSchema(ResolvedSchema resolvedSchema) { addResolvedColumns(resolvedSchema.getColumns()); addResolvedWatermarkSpec(resolvedSchema.getWatermarkSpecs()); resolvedSchema.getPrimaryKey().ifPresent(this::addResolvedConstraint); return this; }
Adopts all members from the given resolved schema.
fromResolvedSchema
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder fromRowDataType(DataType dataType) { Preconditions.checkNotNull(dataType, "Data type must not be null."); Preconditions.checkArgument( dataType.getLogicalType().is(LogicalTypeRoot.ROW), "Data type of ROW expected."); final List<DataType> fieldDataTypes = dataType.getChildren(); final List<String> fieldNames = ((RowType) dataType.getLogicalType()).getFieldNames(); IntStream.range(0, fieldDataTypes.size()) .forEach(i -> column(fieldNames.get(i), fieldDataTypes.get(i))); return this; }
Adopts all fields of the given row as physical columns of the schema.
fromRowDataType
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder fromColumns(List<UnresolvedColumn> unresolvedColumns) { columns.addAll(unresolvedColumns); return this; }
Adopts all columns from the given list.
fromColumns
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder column(String columnName, AbstractDataType<?> dataType) { Preconditions.checkNotNull(columnName, "Column name must not be null."); Preconditions.checkNotNull(dataType, "Data type must not be null."); columns.add(new UnresolvedPhysicalColumn(columnName, dataType)); return this; }
Declares a physical column that is appended to this schema. <p>Physical columns are regular columns known from databases. They define the names, the types, and the order of fields in the physical data. Thus, physical columns represent the payload that is read from and written to an external system. Connectors and formats use these columns (in the defined order) to configure themselves. Other kinds of columns can be declared between physical columns but will not influence the final physical schema. @param columnName column name @param dataType data type of the column
column
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder column(String columnName, String serializableTypeString) { return column(columnName, DataTypes.of(serializableTypeString)); }
Declares a physical column that is appended to this schema. <p>See {@link #column(String, AbstractDataType)} for a detailed explanation. <p>This method uses a type string that can be easily persisted in a durable catalog. @param columnName column name @param serializableTypeString data type of the column as a serializable string @see LogicalType#asSerializableString()
column
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder columnByExpression(String columnName, String sqlExpression) { return columnByExpression(columnName, new SqlCallExpression(sqlExpression)); }
Declares a computed column that is appended to this schema. <p>See {@link #columnByExpression(String, Expression)} for a detailed explanation. <p>This method uses a SQL expression that can be easily persisted in a durable catalog. <p>Example: {@code .columnByExpression("ts", "CAST(json_obj.ts AS TIMESTAMP(3))")} @param columnName column name @param sqlExpression computation of the column using SQL
columnByExpression
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder columnByMetadata(String columnName, AbstractDataType<?> dataType) { return columnByMetadata(columnName, dataType, null, false); }
Declares a metadata column that is appended to this schema. <p>Metadata columns allow to access connector and/or format specific fields for every row of a table. For example, a metadata column can be used to read and write the timestamp from and to Kafka records for time-based operations. The connector and format documentation lists the available metadata fields for every component. <p>Every metadata field is identified by a string-based key and has a documented data type. For convenience, the runtime will perform an explicit cast if the data type of the column differs from the data type of the metadata field. Of course, this requires that the two data types are compatible. <p>Note: This method assumes that the metadata key is equal to the column name and the metadata column can be used for both reading and writing. @param columnName column name @param dataType data type of the column
columnByMetadata
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder columnByMetadata(String columnName, String serializableTypeString) { return columnByMetadata(columnName, serializableTypeString, null, false); }
Declares a metadata column that is appended to this schema. <p>See {@link #column(String, AbstractDataType)} for a detailed explanation. <p>This method uses a type string that can be easily persisted in a durable catalog. @param columnName column name @param serializableTypeString data type of the column
columnByMetadata
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder columnByMetadata( String columnName, AbstractDataType<?> dataType, boolean isVirtual) { return columnByMetadata(columnName, dataType, null, isVirtual); }
Declares a metadata column that is appended to this schema. <p>Metadata columns allow to access connector and/or format specific fields for every row of a table. For example, a metadata column can be used to read and write the timestamp from and to Kafka records for time-based operations. The connector and format documentation lists the available metadata fields for every component. <p>Every metadata field is identified by a string-based key and has a documented data type. For convenience, the runtime will perform an explicit cast if the data type of the column differs from the data type of the metadata field. Of course, this requires that the two data types are compatible. <p>By default, a metadata column can be used for both reading and writing. However, in many cases an external system provides more read-only metadata fields than writable fields. Therefore, it is possible to exclude metadata columns from persisting by setting the {@code isVirtual} flag to {@code true}. <p>Note: This method assumes that the metadata key is equal to the column name. @param columnName column name @param dataType data type of the column @param isVirtual whether the column should be persisted or not
columnByMetadata
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder columnByMetadata( String columnName, String serializableTypeString, @Nullable String metadataKey, boolean isVirtual) { return columnByMetadata( columnName, DataTypes.of(serializableTypeString), metadataKey, isVirtual); }
Declares a metadata column that is appended to this schema. <p>See {@link #columnByMetadata(String, AbstractDataType, String, boolean)} for a detailed explanation. <p>This method uses a type string that can be easily persisted in a durable catalog. @param columnName column name @param serializableTypeString data type of the column @param metadataKey identifying metadata key, if null the column name will be used as metadata key @param isVirtual whether the column should be persisted or not
columnByMetadata
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder withComment(@Nullable String comment) { if (columns.size() > 0) { columns.set( columns.size() - 1, columns.get(columns.size() - 1).withComment(comment)); } else { throw new IllegalArgumentException( "Method 'withComment(...)' must be called after a column definition, " + "but there is no preceding column defined."); } return this; }
Apply comment to the previous column.
withComment
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder watermark(String columnName, String sqlExpression) { return watermark(columnName, new SqlCallExpression(sqlExpression)); }
Declares that the given column should serve as an event-time (i.e. rowtime) attribute and specifies a corresponding watermark strategy as an expression. <p>See {@link #watermark(String, Expression)} for a detailed explanation. <p>This method uses a SQL expression that can be easily persisted in a durable catalog. <p>Example: {@code .watermark("ts", "ts - INTERVAL '5' SECOND")}
watermark
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder primaryKey(String... columnNames) { Preconditions.checkNotNull(columnNames, "Primary key column names must not be null."); return primaryKey(Arrays.asList(columnNames)); }
Declares a primary key constraint for a set of given columns. Primary key uniquely identify a row in a table. Neither of columns in a primary can be nullable. The primary key is informational only. It will not be enforced. It can be used for optimizations. It is the data owner's responsibility to ensure uniqueness of the data. <p>The primary key will be assigned a random name. @param columnNames columns that form a unique primary key
primaryKey
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public Builder primaryKey(List<String> columnNames) { Preconditions.checkNotNull(columnNames, "Primary key column names must not be null."); final String generatedConstraintName = columnNames.stream().collect(Collectors.joining("_", "PK_", "")); return primaryKeyNamed(generatedConstraintName, columnNames); }
Declares a primary key constraint for a set of given columns. Primary key uniquely identify a row in a table. Neither of columns in a primary can be nullable. The primary key is informational only. It will not be enforced. It can be used for optimizations. It is the data owner's responsibility to ensure uniqueness of the data. <p>The primary key will be assigned a generated name in the format {@code PK_col1_col2}. @param columnNames columns that form a unique primary key
primaryKey
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java
Apache-2.0
public List<T> getList() { return list; }
Returns the entire view's content as an instance of {@link List}.
getList
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/ListView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/ListView.java
Apache-2.0
public void setList(List<T> list) { this.list = list; }
Replaces the entire view's content with the content of the given {@link List}.
setList
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/ListView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/ListView.java
Apache-2.0
public Iterable<T> get() throws Exception { return list; }
Returns an iterable of the list view. @throws Exception Thrown if the system cannot get data. @return The iterable of the list.
get
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/ListView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/ListView.java
Apache-2.0
public boolean remove(T value) throws Exception { return list.remove(value); }
Removes the given value from the list. @param value The element to be removed from this list view.
remove
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/ListView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/ListView.java
Apache-2.0
public static DataType newListViewDataType(DataType elementDataType) { return DataTypes.STRUCTURED( ListView.class, DataTypes.FIELD("list", DataTypes.ARRAY(elementDataType).bridgedTo(List.class))); }
Utility method for creating a {@link DataType} of {@link ListView} explicitly.
newListViewDataType
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/ListView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/ListView.java
Apache-2.0
public Map<K, V> getMap() { return map; }
Returns the entire view's content as an instance of {@link Map}.
getMap
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
Apache-2.0
public void setMap(Map<K, V> map) { this.map = map; }
Replaces the entire view's content with the content of the given {@link Map}.
setMap
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
Apache-2.0
public V get(K key) throws Exception { return map.get(key); }
Return the value for the specified key or {@code null} if the key is not in the map view. @param key The key whose associated value is to be returned @return The value to which the specified key is mapped, or {@code null} if this map contains no mapping for the key @throws Exception Thrown if the system cannot get data.
get
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
Apache-2.0
public void put(K key, V value) throws Exception { map.put(key, value); }
Inserts a value for the given key into the map view. If the map view already contains a value for the key, the existing value is overwritten. @param key The key for which the value is inserted. @param value The value that is inserted for the key. @throws Exception Thrown if the system cannot put data.
put
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
Apache-2.0
public boolean contains(K key) throws Exception { return map.containsKey(key); }
Checks if the map view contains a value for a given key. @param key The key to check. @return True if there exists a value for the given key, false otherwise. @throws Exception Thrown if the system cannot access the map.
contains
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
Apache-2.0
public Iterable<Map.Entry<K, V>> entries() throws Exception { return map.entrySet(); }
Returns all entries of the map view. @return An iterable of all the key-value pairs in the map view. @throws Exception Thrown if the system cannot access the map.
entries
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
Apache-2.0
public Iterable<K> keys() throws Exception { return map.keySet(); }
Returns all the keys in the map view. @return An iterable of all the keys in the map. @throws Exception Thrown if the system cannot access the map.
keys
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
Apache-2.0
public Iterable<V> values() throws Exception { return map.values(); }
Returns all the values in the map view. @return An iterable of all the values in the map. @throws Exception Thrown if the system cannot access the map.
values
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
Apache-2.0
public Iterator<Map.Entry<K, V>> iterator() throws Exception { return map.entrySet().iterator(); }
Returns an iterator over all entries of the map view. @return An iterator over all the mappings in the map. @throws Exception Thrown if the system cannot access the map.
iterator
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
Apache-2.0
public boolean isEmpty() throws Exception { return map.isEmpty(); }
Returns true if the map view contains no key-value mappings, otherwise false. @return True if the map view contains no key-value mappings, otherwise false. @throws Exception Thrown if the system cannot access the state.
isEmpty
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
Apache-2.0
public static DataType newMapViewDataType(DataType keyDataType, DataType valueDataType) { return DataTypes.STRUCTURED( MapView.class, DataTypes.FIELD( "map", DataTypes.MAP(keyDataType, valueDataType).bridgedTo(Map.class))); }
Utility method for creating a {@link DataType} of {@link MapView} explicitly.
newMapViewDataType
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/dataview/MapView.java
Apache-2.0
protected void checkOpenState() { Preconditions.checkState(isOpen, "CatalogStore is not opened yet."); }
Checks whether the catalog store is currently open. @throws IllegalStateException if the store is closed
checkOpenState
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/AbstractCatalogStore.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/AbstractCatalogStore.java
Apache-2.0
default Optional<Factory> getFactory() { return Optional.empty(); }
Returns a factory for creating instances from catalog objects. <p>This method enables bypassing the discovery process. Implementers can directly pass internal catalog-specific objects to their own factory. For example, a custom {@link CatalogTable} can be processed by a custom {@link DynamicTableFactory}. <p>If this catalog support to create materialized table, you should also override this method to provide {@link DynamicTableFactory} which help planner to find {@link DynamicTableSource} and {@link DynamicTableSink} correctly during compile optimization phase. If you don't override this method, you must specify the physical connector identifier that this catalog represents storage when create materialized table. Otherwise, the planner can't find the {@link DynamicTableFactory}. <p>Because all factories are interfaces, the returned {@link Factory} instance can implement multiple supported extension points. An {@code instanceof} check is performed by the caller that checks whether a required factory is implemented; otherwise the discovery process is used.
getFactory
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default Optional<FunctionDefinitionFactory> getFunctionDefinitionFactory() { return Optional.empty(); }
Get an optional {@link FunctionDefinitionFactory} instance that's responsible for instantiating function definitions. @return an optional FunctionDefinitionFactory instance
getFunctionDefinitionFactory
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default void dropDatabase(String name, boolean ignoreIfNotExists) throws DatabaseNotExistException, DatabaseNotEmptyException, CatalogException { dropDatabase(name, ignoreIfNotExists, false); }
Drop a database. @param name Name of the database to be dropped. @param ignoreIfNotExists Flag to specify behavior when the database does not exist: if set to false, throw an exception, if set to true, do nothing. @throws DatabaseNotExistException if the given database does not exist @throws CatalogException in case of any runtime exception
dropDatabase
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default CatalogBaseTable getTable(ObjectPath tablePath, long timestamp) throws TableNotExistException, CatalogException { throw new UnsupportedOperationException( String.format( "getTable(ObjectPath, long) is not implemented for %s.", this.getClass())); }
Returns a {@link CatalogTable} or {@link CatalogView} at a specific time identified by the given {@link ObjectPath}. The framework will resolve the metadata objects when necessary. @param tablePath Path of the table or view @param timestamp Timestamp of the table snapshot, which is milliseconds since 1970-01-01 00:00:00 UTC @return The requested table or view @throws TableNotExistException if the target does not exist @throws CatalogException in case of any runtime exception
getTable
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default void alterTable( ObjectPath tablePath, CatalogBaseTable newTable, List<TableChange> tableChanges, boolean ignoreIfNotExists) throws TableNotExistException, CatalogException { alterTable(tablePath, newTable, ignoreIfNotExists); }
Modifies an existing table or view. Note that the new and old {@link CatalogBaseTable} must be of the same kind. For example, this doesn't allow altering a regular table to partitioned table, or altering a view to a table, and vice versa. <p>The framework will make sure to call this method with fully validated {@link ResolvedCatalogTable} or {@link ResolvedCatalogView}. Those instances are easy to serialize for a durable catalog implementation. @param tablePath path of the table or view to be modified @param newTable the new table definition @param tableChanges change to describe the modification between the newTable and the original table. @param ignoreIfNotExists flag to specify behavior when the table or view does not exist: if set to false, throw an exception, if set to true, do nothing. @throws TableNotExistException if the table does not exist @throws CatalogException in case of any runtime exception
alterTable
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default List<String> listProcedures(String dbName) throws DatabaseNotExistException, CatalogException { throw new UnsupportedOperationException( String.format("listProcedures is not implemented for %s.", this.getClass())); }
List the names of all procedures in the given database. An empty list is returned if no procedure. @param dbName name of the database. @return a list of the names of the procedures in this database @throws DatabaseNotExistException if the database does not exist @throws CatalogException in case of any runtime exception
listProcedures
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default Procedure getProcedure(ObjectPath procedurePath) throws ProcedureNotExistException, CatalogException { throw new UnsupportedOperationException( String.format("getProcedure is not implemented for %s.", this.getClass())); }
Get the procedure. The procedure name should be handled in a case-insensitive way. @param procedurePath path of the procedure @return the requested procedure @throws ProcedureNotExistException if the procedure does not exist in the catalog @throws CatalogException in case of any runtime exception
getProcedure
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default List<String> listModels(String databaseName) throws DatabaseNotExistException, CatalogException { return Collections.emptyList(); }
Get names of all models under this database. An empty list is returned if none exists. @return a list of the names of all models in this database @throws DatabaseNotExistException if the database does not exist @throws CatalogException in case of any runtime exception
listModels
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default CatalogModel getModel(ObjectPath modelPath) throws ModelNotExistException, CatalogException { throw new ModelNotExistException(null, modelPath); }
Returns a {@link CatalogModel} identified by the given {@link ObjectPath}. @param modelPath Path of the model @return The requested model @throws ModelNotExistException if the target does not exist @throws CatalogException in case of any runtime exception
getModel
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default boolean modelExists(ObjectPath modelPath) throws CatalogException { return false; }
Check if a model exists in this catalog. @param modelPath Path of the model @return true if the given model exists in the catalog false otherwise @throws CatalogException in case of any runtime exception
modelExists
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default void dropModel(ObjectPath modelPath, boolean ignoreIfNotExists) throws ModelNotExistException, CatalogException { throw new UnsupportedOperationException( String.format( "dropModel(ObjectPath, boolean) is not implemented for %s.", this.getClass())); }
Drop a model. @param modelPath Path of the model to be dropped @param ignoreIfNotExists Flag to specify behavior when the model does not exist: if set to false, throw an exception, if set to true, do nothing. @throws ModelNotExistException if the model does not exist @throws CatalogException in case of any runtime exception
dropModel
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default void renameModel(ObjectPath modelPath, String newModelName, boolean ignoreIfNotExists) throws ModelNotExistException, ModelAlreadyExistException, CatalogException { throw new UnsupportedOperationException( String.format( "renameModel(ObjectPath, String, boolean) is not implemented for %s.", this.getClass())); }
Rename an existing model. @param modelPath Path of the model to be renamed @param newModelName the new name of the model @param ignoreIfNotExists Flag to specify behavior when the model does not exist: if set to false, throw an exception, if set to true, do nothing. @throws ModelNotExistException if the model does not exist @throws CatalogException in case of any runtime exception
renameModel
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default void createModel(ObjectPath modelPath, CatalogModel model, boolean ignoreIfExists) throws ModelAlreadyExistException, DatabaseNotExistException, CatalogException { throw new UnsupportedOperationException( String.format( "createModel(ObjectPath, CatalogModel, boolean) is not implemented for %s.", this.getClass())); }
Creates a new model. <p>The framework will make sure to call this method with fully validated {@link ResolvedCatalogModel}. Those instances are easy to serialize for a durable catalog implementation. @param modelPath path of the model to be created @param model the CatalogModel definition @param ignoreIfExists flag to specify behavior when a model already exists at the given path: if set to false, it throws a ModelAlreadyExistException, if set to true, do nothing. @throws ModelAlreadyExistException if model already exists and ignoreIfExists is false @throws DatabaseNotExistException if the database in tablePath doesn't exist @throws CatalogException in case of any runtime exception
createModel
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default void alterModel(ObjectPath modelPath, CatalogModel newModel, boolean ignoreIfNotExists) throws ModelNotExistException, CatalogException { throw new UnsupportedOperationException( String.format( "alterModel(ObjectPath, CatalogModel, boolean) is not implemented for %s.", this.getClass())); }
Modifies an existing model. <p>The framework will make sure to call this method with fully validated {@link ResolvedCatalogModel}. Those instances are easy to serialize for a durable catalog implementation. @param modelPath path of the model to be modified @param newModel the new model definition @param ignoreIfNotExists flag to specify behavior when the model does not exist: if set to false, throw an exception, if set to true, do nothing. @throws ModelNotExistException if the model does not exist @throws CatalogException in case of any runtime exception
alterModel
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
default void alterModel( ObjectPath modelPath, CatalogModel newModel, List<ModelChange> modelChanges, boolean ignoreIfNotExists) throws ModelNotExistException, CatalogException { alterModel(modelPath, newModel, ignoreIfNotExists); }
Modifies an existing model. <p>The framework will make sure to call this method with fully validated {@link ResolvedCatalogModel}. Those instances are easy to serialize for a durable catalog implementation. @param modelPath path of the model to be modified @param newModel the new model definition @param modelChanges changes to describe the modification between the newModel and the original model @param ignoreIfNotExists flag to specify behavior when the model does not exist: if set to false, throw an exception, if set to true, do nothing. @throws ModelNotExistException if the model does not exist @throws CatalogException in case of any runtime exception
alterModel
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
Apache-2.0
@Deprecated default TableSchema getSchema() { return null; }
@deprecated This method returns the deprecated {@link TableSchema} class. The old class was a hybrid of resolved and unresolved schema information. It has been replaced by the new {@link Schema} which is always unresolved and will be resolved by the framework later.
getSchema
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogBaseTable.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogBaseTable.java
Apache-2.0
default Schema getUnresolvedSchema() { final TableSchema oldSchema = getSchema(); if (oldSchema == null) { throw new UnsupportedOperationException( "A CatalogBaseTable must implement getUnresolvedSchema()."); } return oldSchema.toSchema(); }
Returns the schema of the table or view. <p>The schema can reference objects from other catalogs and will be resolved and validated by the framework when accessing the table or view. @see ResolvedCatalogTable @see ResolvedCatalogView
getUnresolvedSchema
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogBaseTable.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogBaseTable.java
Apache-2.0
@Override public CatalogDescriptor applyChange(CatalogDescriptor descriptor) { Configuration conf = descriptor.getConfiguration(); configUpdater.accept(conf); return CatalogDescriptor.of( descriptor.getCatalogName(), conf, descriptor.getComment().orElse(null)); }
A catalog change to modify the catalog configuration.
applyChange
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogChange.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogChange.java
Apache-2.0
@Override public CatalogDescriptor applyChange(CatalogDescriptor descriptor) { return descriptor.setComment(newComment); }
A catalog change to modify the comment.
applyChange
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogChange.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogChange.java
Apache-2.0
default Duration getFreshness() { return convertFreshnessToDuration(getDefinitionFreshness()); }
Get the {@link Duration} value of materialized table definition freshness, it is converted from {@link IntervalFreshness}.
getFreshness
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogMaterializedTable.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogMaterializedTable.java
Apache-2.0
static CatalogModel of( Schema inputSchema, Schema outputSchema, Map<String, String> modelOptions, @Nullable String comment) { return new DefaultCatalogModel(inputSchema, outputSchema, modelOptions, comment); }
Creates a basic implementation of this interface. @param inputSchema unresolved input schema @param outputSchema unresolved output schema @param modelOptions model options @param comment optional comment
of
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogModel.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogModel.java
Apache-2.0
public static Map<String, String> serializeCatalogTable( ResolvedCatalogTable resolvedTable, SqlFactory sqlFactory) { try { final Map<String, String> properties = new HashMap<>(); serializeResolvedSchema(properties, resolvedTable.getResolvedSchema(), sqlFactory); final String comment = resolvedTable.getComment(); if (comment != null && !comment.isEmpty()) { properties.put(COMMENT, comment); } final Optional<Long> snapshot = resolvedTable.getSnapshot(); snapshot.ifPresent(snapshotId -> properties.put(SNAPSHOT, Long.toString(snapshotId))); serializePartitionKeys(properties, resolvedTable.getPartitionKeys()); properties.putAll(resolvedTable.getOptions()); properties.remove(IS_GENERIC); // reserved option return properties; } catch (Exception e) { throw new CatalogException("Error in serializing catalog table.", e); } }
Serializes the given {@link ResolvedCatalogTable} into a map of string properties.
serializeCatalogTable
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogPropertiesUtil.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogPropertiesUtil.java
Apache-2.0
public static Map<String, String> serializeCatalogView( ResolvedCatalogView resolvedView, SqlFactory sqlFactory) { try { final Map<String, String> properties = new HashMap<>(); serializeResolvedSchema(properties, resolvedView.getResolvedSchema(), sqlFactory); final String comment = resolvedView.getComment(); if (comment != null && !comment.isEmpty()) { properties.put(COMMENT, comment); } properties.putAll(resolvedView.getOptions()); properties.remove(IS_GENERIC); // reserved option return properties; } catch (Exception e) { throw new CatalogException("Error in serializing catalog view.", e); } }
Serializes the given {@link ResolvedCatalogView} into a map of string properties.
serializeCatalogView
java
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogPropertiesUtil.java
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogPropertiesUtil.java
Apache-2.0