Search in sources :

Example 6 with MultisetType

use of org.apache.flink.table.types.logical.MultisetType in project flink by apache.

the class LogicalTypeJsonDeserializer method deserializeCollection.

private static LogicalType deserializeCollection(LogicalTypeRoot typeRoot, JsonNode logicalTypeNode, SerdeContext serdeContext) {
    final JsonNode elementNode = logicalTypeNode.get(FIELD_NAME_ELEMENT_TYPE);
    final LogicalType elementType = deserialize(elementNode, serdeContext);
    switch(typeRoot) {
        case ARRAY:
            return new ArrayType(elementType);
        case MULTISET:
            return new MultisetType(elementType);
        default:
            throw new TableException("Collection type root expected.");
    }
}
Also used : ArrayType(org.apache.flink.table.types.logical.ArrayType) TableException(org.apache.flink.table.api.TableException) LogicalType(org.apache.flink.table.types.logical.LogicalType) JsonNode(org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.JsonNode) MultisetType(org.apache.flink.table.types.logical.MultisetType)

Aggregations

MultisetType (org.apache.flink.table.types.logical.MultisetType)6 LogicalType (org.apache.flink.table.types.logical.LogicalType)5 ArrayType (org.apache.flink.table.types.logical.ArrayType)3 IntType (org.apache.flink.table.types.logical.IntType)3 MapType (org.apache.flink.table.types.logical.MapType)3 LocalZonedTimestampType (org.apache.flink.table.types.logical.LocalZonedTimestampType)2 SmallIntType (org.apache.flink.table.types.logical.SmallIntType)2 TimestampType (org.apache.flink.table.types.logical.TimestampType)2 ZonedTimestampType (org.apache.flink.table.types.logical.ZonedTimestampType)2 LocalDateTime (java.time.LocalDateTime)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 Consumer (java.util.function.Consumer)1 JsonNode (org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.JsonNode)1 TableException (org.apache.flink.table.api.TableException)1 ArrayData (org.apache.flink.table.data.ArrayData)1 CodeGenUtils.className (org.apache.flink.table.planner.codegen.CodeGenUtils.className)1 CodeGenUtils.newName (org.apache.flink.table.planner.codegen.CodeGenUtils.newName)1