org.apache.flink.table.types.utils.LegacyTypeInfoDataTypeConverter Java Examples

The following examples show how to use org.apache.flink.table.types.utils.LegacyTypeInfoDataTypeConverter. 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 File: FlinkPulsarRowSource.java    From pulsar-flink with Apache License 2.0 5 votes vote down vote up
@Override
public TypeInformation<Row> getProducedType() {
    if (typeInformation == null) {
        try (PulsarMetadataReader reader = new PulsarMetadataReader(adminUrl, clientConfigurationData, "", caseInsensitiveParams, -1, -1)) {
            List<String> topics = reader.getTopics();
            FieldsDataType schema = reader.getSchema(topics);
            typeInformation = (TypeInformation<Row>) LegacyTypeInfoDataTypeConverter.toLegacyTypeInfo(schema);
        } catch (Exception e) {
            log.error("Failed to get schema for source with exception {}", ExceptionUtils.stringifyException(e));
            typeInformation = null;
        }
    }

    return typeInformation;
}
 
Example #2
Source File: FlinkPulsarITest.java    From pulsar-flink with Apache License 2.0 4 votes vote down vote up
private TypeInformation<Row> intRowTypeInfo() {
    return (TypeInformation<Row>) LegacyTypeInfoDataTypeConverter
            .toLegacyTypeInfo(intRowType());
}
 
Example #3
Source File: FlinkPulsarITest.java    From pulsar-flink with Apache License 2.0 4 votes vote down vote up
private TypeInformation<Row> intRowWithTopicTypeInfo() {
    return (TypeInformation<Row>) LegacyTypeInfoDataTypeConverter
            .toLegacyTypeInfo(intRowWithTopicType());
}
 
Example #4
Source File: HiveGenericUDAF.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public TypeInformation getResultType() {
	return LegacyTypeInfoDataTypeConverter.toLegacyTypeInfo(
		getHiveResultType(this.constantArguments, this.argTypes));
}
 
Example #5
Source File: HiveScalarFunction.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public TypeInformation getResultType(Class[] signature) {
	return LegacyTypeInfoDataTypeConverter.toLegacyTypeInfo(
		getHiveResultType(this.constantArguments, this.argTypes));
}
 
Example #6
Source File: HiveGenericUDTF.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public TypeInformation getResultType() {
	return LegacyTypeInfoDataTypeConverter.toLegacyTypeInfo(
		getHiveResultType(this.constantArguments, this.argTypes));
}
 
Example #7
Source File: LegacyTypeInfoDataTypeConverterTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testTypeInfoToDataTypeConversion() {
	assertThat(LegacyTypeInfoDataTypeConverter.toDataType(inputTypeInfo), equalTo(dataType.nullable()));
}
 
Example #8
Source File: LegacyTypeInfoDataTypeConverterTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testDataTypeToTypeInfoConversion() {
	assertThat(LegacyTypeInfoDataTypeConverter.toLegacyTypeInfo(dataType), equalTo(inputTypeInfo));
}
 
Example #9
Source File: LegacyTypeInfoDataTypeConverterTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testTypeInfoToDataTypeConversion() {
	assertThat(LegacyTypeInfoDataTypeConverter.toDataType(inputTypeInfo), equalTo(dataType.nullable()));
}
 
Example #10
Source File: LegacyTypeInfoDataTypeConverterTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testDataTypeToTypeInfoConversion() {
	assertThat(LegacyTypeInfoDataTypeConverter.toLegacyTypeInfo(dataType), equalTo(inputTypeInfo));
}
 
Example #11
Source File: AbstractPythonStatelessFunctionFlatMap.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public TypeInformation<Row> getProducedType() {
	return (TypeInformation<Row>) LegacyTypeInfoDataTypeConverter
		.toLegacyTypeInfo(LogicalTypeDataTypeConverter.toDataType(outputType));
}