Package com.facebook.presto.tuple.TupleInfo

Examples of com.facebook.presto.tuple.TupleInfo.Type


    {
        if (isNull()) {
            return null;
        }

        Type type = tupleInfo.getType();
        switch (type) {
            case BOOLEAN:
                return getBoolean();
            case FIXED_INT_64:
                return getLong();
View Full Code Here


                    BlockBuilder output = pageBuilder.getBlockBuilder(column);
                    if (cursor.isNull(column)) {
                        output.appendNull();
                    }
                    else {
                        Type type = getTupleInfos().get(column).getType();
                        switch (type) {
                            case BOOLEAN:
                                output.append(cursor.getBoolean(column));
                                break;
                            case FIXED_INT_64:
View Full Code Here

        private int hashCurrentRow()
        {
            int result = 0;
            for (int channel = 0; channel < types.size(); channel++) {
                Type type = types.get(channel);
                BlockCursor cursor = currentRow[channel];
                result = addToHashCode(result, valueHashCode(type, cursor.getRawSlice(), cursor.getRawOffset()));
            }
            return result;
        }
View Full Code Here

    }

    @Override
    public BlockCursor cursor()
    {
        Type type = tupleInfo.getType();
        if (type == Type.BOOLEAN) {
            return new UncompressedBooleanBlockCursor(positionCount, slice);
        }
        else if (type == Type.FIXED_INT_64) {
            return new UncompressedLongBlockCursor(positionCount, slice);
View Full Code Here

    }

    @Override
    public RandomAccessBlock toRandomAccessBlock()
    {
        Type type = tupleInfo.getType();
        if (type == Type.BOOLEAN) {
            return new UncompressedBooleanBlock(positionCount, slice);
        }
        if (type == Type.FIXED_INT_64) {
            return new UncompressedLongBlock(slice);
View Full Code Here

    }

    @Override
    public BlockCursor cursor()
    {
        Type type = tupleInfo.getType();
        if (type == Type.BOOLEAN) {
            return new UncompressedBooleanBlockCursor(positionCount, getUncompressedSlice());
        }
        else if (type == Type.FIXED_INT_64) {
            return new UncompressedLongBlockCursor(positionCount, getUncompressedSlice());
View Full Code Here

    }

    @Override
    public RandomAccessBlock toRandomAccessBlock()
    {
        Type type = tupleInfo.getType();
        if (type == Type.BOOLEAN) {
            return new UncompressedBooleanBlock(positionCount, getUncompressedSlice());
        }
        if (type == Type.FIXED_INT_64) {
            return new UncompressedLongBlock(getUncompressedSlice());
View Full Code Here

            checkArgument(names.size() == types.size(), "names and types size mismatch");

            ImmutableList.Builder<Column> list = ImmutableList.builder();
            for (int i = 0; i < names.size(); i++) {
                String name = names.get(i);
                Type type = types.get(i);
                switch (type) {
                    case BOOLEAN:
                        list.add(new Column(name, "boolean"));
                        break;
                    case FIXED_INT_64:
View Full Code Here

                    Object value = data.get(i);
                    if (value == null) {
                        row.add(null);
                        continue;
                    }
                    Type type = tupleInfos.get(i).getType();
                    switch (type) {
                        case BOOLEAN:
                            row.add(value);
                            break;
                        case FIXED_INT_64:
View Full Code Here

    {
        ImmutableList.Builder<String> names = ImmutableList.builder();
        ImmutableList.Builder<TupleInfo> tupleInfos = ImmutableList.builder();
        for (ColumnMetadata column : columns) {
            names.add(column.getName());
            Type type = Type.fromColumnType(column.getType());
            tupleInfos.add(new TupleInfo(type));
        }
        return new Builder(tupleInfos.build(), names.build());
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.tuple.TupleInfo.Type

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.