Java Code Examples for org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory#getMapTypeInfo()

The following examples show how to use org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory#getMapTypeInfo() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: flink   File: HiveTypeUtil.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public TypeInfo visit(MapType mapType) {
	LogicalType keyType  = mapType.getKeyType();
	LogicalType valueType = mapType.getValueType();
	TypeInfo keyTypeInfo = keyType.accept(new TypeInfoLogicalTypeVisitor(dataType));
	TypeInfo valueTypeInfo = valueType.accept(new TypeInfoLogicalTypeVisitor(dataType));
	if (null == keyTypeInfo || null == valueTypeInfo) {
		return defaultMethod(mapType);
	} else {
		return TypeInfoFactory.getMapTypeInfo(keyTypeInfo, valueTypeInfo);
	}
}
 
Example 2
Source Project: flink   File: HiveTypeUtil.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public TypeInfo visit(MapType mapType) {
	LogicalType keyType  = mapType.getKeyType();
	LogicalType valueType = mapType.getValueType();
	TypeInfo keyTypeInfo = keyType.accept(this);
	TypeInfo valueTypeInfo = valueType.accept(this);
	if (null == keyTypeInfo || null == valueTypeInfo) {
		return defaultMethod(mapType);
	} else {
		return TypeInfoFactory.getMapTypeInfo(keyTypeInfo, valueTypeInfo);
	}
}
 
Example 3
Source Project: streamx   File: HiveSchemaConverter.java    License: Apache License 2.0 4 votes vote down vote up
public static TypeInfo convertMap(Schema schema) {
  return TypeInfoFactory.getMapTypeInfo(
      convert(schema.keySchema()), convert(schema.valueSchema()));
}
 
Example 4
@Override
public TypeInfo getSupportedHiveType() {
  return TypeInfoFactory.getMapTypeInfo(TypeInfoFactory.stringTypeInfo, TypeInfoFactory.stringTypeInfo);
}