Package com.facebook.presto.spi

Examples of com.facebook.presto.spi.ColumnType


                return super.visitComparisonExpression(node, complement);
            }
            node = normalizeSimpleComparison(node);

            Symbol symbol = Symbol.fromQualifiedName(((QualifiedNameReference) node.getLeft()).getName());
            ColumnType columnType = checkedTypeLookup(symbol);
            ColumnHandle columnHandle = checkedColumnHandleLookup(symbol);
            Object value = LiteralInterpreter.evaluate(node.getRight());

            // Handle the cases where implicit coercions can happen in comparisons
            // TODO: how to abstract this out
View Full Code Here


            if (!(node.getValue() instanceof QualifiedNameReference)) {
                return super.visitIsNullPredicate(node, complement);
            }

            Symbol symbol = Symbol.fromQualifiedName(((QualifiedNameReference) node.getValue()).getName());
            ColumnType columnType = checkedTypeLookup(symbol);
            ColumnHandle columnHandle = checkedColumnHandleLookup(symbol);

            Domain domain = complementIfNecessary(Domain.onlyNull(columnType.getNativeType()), complement);
            return new ExtractionResult(
                    TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(columnHandle, domain)),
                    TRUE_LITERAL);
        }
View Full Code Here

            if (!(node.getValue() instanceof QualifiedNameReference)) {
                return super.visitIsNotNullPredicate(node, complement);
            }

            Symbol symbol = Symbol.fromQualifiedName(((QualifiedNameReference) node.getValue()).getName());
            ColumnType columnType = checkedTypeLookup(symbol);
            ColumnHandle columnHandle = checkedColumnHandleLookup(symbol);

            Domain domain = complementIfNecessary(Domain.notNull(columnType.getNativeType()), complement);
            return new ExtractionResult(
                    TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(columnHandle, domain)),
                    TRUE_LITERAL);
        }
View Full Code Here

        throw new UnsupportedOperationException();
    }

    private ColumnType getColumnType(MBeanAttributeInfo attribute)
    {
        ColumnType columnType;
        switch (attribute.getType()) {
            case "boolean":
            case "java.lang.Boolean":
                columnType = ColumnType.BOOLEAN;
                break;
View Full Code Here

            {
                MetadataDao dao = dbiHandle.attach(MetadataDao.class);
                long tableId = dao.insertTable(catalogName, table.getSchemaName(), table.getTableName());
                for (int i = 0; i < table.getColumnTypes().size(); i++) {
                    NativeColumnHandle column = table.getColumnHandles().get(i);
                    ColumnType columnType = table.getColumnTypes().get(i);
                    dao.insertColumn(tableId, i + 1, column.getColumnName(), i, fromColumnType(columnType).getName());
                }
            }
        });
View Full Code Here

        ImmutableList.Builder<ColumnMetadata> columns = ImmutableList.builder();
        List<Field> fields = plan.getDescriptor().getFields();
        for (int i = 0; i < fields.size(); i++) {
            Field field = fields.get(i);
            String name = field.getName().get();
            ColumnType type = field.getType().getColumnType();
            columns.add(new ColumnMetadata(name, type, i, false));
        }
        return columns.build();
    }
View Full Code Here

        return columns.build();
    }

    private ColumnType getColumnType(MBeanAttributeInfo attribute)
    {
        ColumnType columnType;
        switch (attribute.getType()) {
            case "boolean":
            case "java.lang.Boolean":
                columnType = ColumnType.BOOLEAN;
                break;
View Full Code Here

        ImmutableList.Builder<ColumnMetadata> columns = ImmutableList.builder();
        List<Field> fields = plan.getDescriptor().getFields();
        for (int i = 0; i < fields.size(); i++) {
            Field field = fields.get(i);
            String name = field.getName().get();
            ColumnType type = field.getType().getColumnType();
            columns.add(new ColumnMetadata(name, type, i, false));
        }
        return columns.build();
    }
View Full Code Here

        return Strings.isNullOrEmpty(getFieldValue(field));
    }

    private void checkFieldType(int field, ColumnType expected)
    {
        ColumnType actual = getType(field);
        checkArgument(actual == expected, "Expected field %s to be type %s but is %s", field, expected, actual);
    }
View Full Code Here

                return super.visitComparisonExpression(node, complement);
            }
            node = normalizeSimpleComparison(node);

            Symbol symbol = Symbol.fromQualifiedName(((QualifiedNameReference) node.getLeft()).getName());
            ColumnType columnType = checkedTypeLookup(symbol);
            ColumnHandle columnHandle = checkedColumnHandleLookup(symbol);
            Object value = LiteralInterpreter.evaluate(node.getRight());

            // Handle the cases where implicit coercions can happen in comparisons
            // TODO: how to abstract this out
View Full Code Here

TOP

Related Classes of com.facebook.presto.spi.ColumnType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.