private List<Object> getSymbolValues(ValuesNode valuesNode, int symbolId, Session session, Type symbolType) { if (UNKNOWN.equals(symbolType)) { // special casing for UNKNOWN as evaluateConstantExpression does not handle that return IntStream.range(0, valuesNode.getRows().size()) .mapToObj(rowId -> null) .collect(toList()); } return valuesNode.getRows().stream() .map(row -> row.get(symbolId)) .map(expression -> evaluateConstantExpression(expression, symbolType, metadata, session, ImmutableList.of())) .collect(toList()); }
private boolean satisfiesConstraints(Type type) { if (comparableRequired && !type.isComparable()) { return false; } if (orderableRequired && !type.isOrderable()) { return false; } if (requiredBaseName.isPresent() && !UNKNOWN.equals(type) && !requiredBaseName.get().equals(type.getTypeSignature().getBase())) { // TODO: the case below should be properly handled: // * `type` does not have the `requiredBaseName` but can be coerced to some type that has the `requiredBaseName`. return false; } return true; } }
else if (UNKNOWN.equals(type)) { Object objectValue = resultSet.getObject(i); checkState(resultSet.wasNull(), "Expected a null value, but got %s", objectValue);
if (UNKNOWN.equals(actualType)) { actualTypeParametersTypeSignatureProvider = Collections.nCopies(formalTypeSignature.getParameters().size(), new TypeSignatureProvider(UNKNOWN.getTypeSignature()));
else if (UNKNOWN.equals(type)) { Object objectValue = resultSet.getObject(i); checkState(resultSet.wasNull(), "Expected a null value, but got %s", objectValue);
|| StringType.STRING.equals(prestoType) || prestoType instanceof com.facebook.presto.type.VarcharType) { return new LogicalSchema.LogicalFieldSchema(alias, null, DataType.CHARARRAY); } else if (UnknownType.UNKNOWN.equals(prestoType)) { return new LogicalSchema.LogicalFieldSchema(alias, null, DataType.UNKNOWN); } else if (prestoType instanceof MapType) { if (mapType.getValueType() != null && !UnknownType.UNKNOWN.equals(mapType.getValueType())) { schema = new LogicalSchema(); schema.addField(fromPrestoTypeToPigSchema(null, mapType.getValueType()));