use of com.facebook.presto.common.type.StandardTypes.DOUBLE in project presto by prestodb.
the class TestRowParametricType method testTypeSignatureRoundTrip.
@Test
public void testTypeSignatureRoundTrip() {
FunctionAndTypeManager functionAndTypeManager = createTestFunctionAndTypeManager();
TypeSignature typeSignature = new TypeSignature(ROW, TypeSignatureParameter.of(new NamedTypeSignature(Optional.of(new RowFieldName("col1", false)), new TypeSignature(BIGINT))), TypeSignatureParameter.of(new NamedTypeSignature(Optional.of(new RowFieldName("col2", true)), new TypeSignature(DOUBLE))));
List<TypeParameter> parameters = typeSignature.getParameters().stream().map(parameter -> TypeParameter.of(parameter, functionAndTypeManager)).collect(Collectors.toList());
Type rowType = RowParametricType.ROW.createType(parameters);
assertEquals(rowType.getTypeSignature(), typeSignature);
}
Aggregations