use of org.apache.flink.api.java.typeutils.RowTypeInfo in project flink by apache.
the class HBaseRowInputFormat method getProducedType.
@Override
public TypeInformation<Row> getProducedType() {
// split the fieldNames
String[] famNames = schema.getFamilyNames();
TypeInformation<?>[] typeInfos = new TypeInformation[famNames.length];
int i = 0;
for (String family : famNames) {
typeInfos[i] = new RowTypeInfo(schema.getQualifierTypes(family), schema.getQualifierNames(family));
i++;
}
return new RowTypeInfo(typeInfos, famNames);
}
use of org.apache.flink.api.java.typeutils.RowTypeInfo in project flink by apache.
the class MaxByOperatorTest method testMaxByRowTypeInfoKeyFieldsForUnsortedGrouping.
/**
* Validates that no ClassCastException happens should not fail e.g. like in FLINK-8255.
*/
@Test(expected = InvalidProgramException.class)
public void testMaxByRowTypeInfoKeyFieldsForUnsortedGrouping() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
TypeInformation[] types = new TypeInformation[] { Types.INT, Types.INT };
String[] fieldNames = new String[] { "id", "value" };
RowTypeInfo rowTypeInfo = new RowTypeInfo(types, fieldNames);
UnsortedGrouping groupDs = env.fromCollection(Collections.singleton(new Row(2)), rowTypeInfo).groupBy(0);
groupDs.maxBy(1);
}
use of org.apache.flink.api.java.typeutils.RowTypeInfo in project flink by apache.
the class MaxByOperatorTest method testMaxByRowTypeInfoKeyFieldsDataset.
/**
* Validates that no ClassCastException happens should not fail e.g. like in FLINK-8255.
*/
@Test(expected = InvalidProgramException.class)
public void testMaxByRowTypeInfoKeyFieldsDataset() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
TypeInformation[] types = new TypeInformation[] { Types.INT, Types.INT };
String[] fieldNames = new String[] { "id", "value" };
RowTypeInfo rowTypeInfo = new RowTypeInfo(types, fieldNames);
DataSet tupleDs = env.fromCollection(Collections.singleton(new Row(2)), rowTypeInfo);
tupleDs.maxBy(0);
}
use of org.apache.flink.api.java.typeutils.RowTypeInfo in project flink by apache.
the class MinByOperatorTest method testMinByRowTypeInfoKeyFieldsDataset.
/**
* Validates that no ClassCastException happens should not fail e.g. like in FLINK-8255.
*/
@Test(expected = InvalidProgramException.class)
public void testMinByRowTypeInfoKeyFieldsDataset() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
TypeInformation[] types = new TypeInformation[] { Types.INT, Types.INT };
String[] fieldNames = new String[] { "id", "value" };
RowTypeInfo rowTypeInfo = new RowTypeInfo(types, fieldNames);
DataSet tupleDs = env.fromCollection(Collections.singleton(new Row(2)), rowTypeInfo);
tupleDs.minBy(0);
}
use of org.apache.flink.api.java.typeutils.RowTypeInfo in project flink by apache.
the class PythonKeyedProcessOperator method open.
@Override
public void open() throws Exception {
internalTimerService = getInternalTimerService("user-timers", namespaceSerializer, this);
keyTypeInfo = new RowTypeInfo(((RowTypeInfo) this.getInputTypeInfo()).getTypeAt(0));
keyTypeSerializer = PythonTypeUtils.TypeInfoToSerializerConverter.typeInfoSerializerConverter(keyTypeInfo);
timerDataTypeInfo = createTimerDataTypeInfo(keyTypeInfo);
timerDataSerializer = PythonTypeUtils.TypeInfoToSerializerConverter.typeInfoSerializerConverter(timerDataTypeInfo);
timerHandler = new TimerHandler();
super.open();
}
Aggregations