Package io.crate.metadata

Examples of io.crate.metadata.ReferenceInfo


    public DynamicReference(ReferenceInfo info) {
        this.info = info;
    }

    public DynamicReference(ReferenceIdent ident, RowGranularity rowGranularity) {
        this.info = new ReferenceInfo(ident, rowGranularity, UndefinedType.INSTANCE);
    }
View Full Code Here


        this.info = new ReferenceInfo(ident, rowGranularity, UndefinedType.INSTANCE);
    }

    public void valueType(DataType dataType) {
        assert this.info != null;
        this.info = new ReferenceInfo(info.ident(), info.granularity(), dataType,
                info.columnPolicy(), info.indexType());
    }
View Full Code Here

                info.columnPolicy(), info.indexType());
    }

    public void columnPolicy(ColumnPolicy objectType) {
        assert this.info != null;
        this.info = new ReferenceInfo(info.ident(), info.granularity(), info.type(),
                objectType, info.indexType());
    }
View Full Code Here

    public DynamicReference getDynamic(ColumnIdent ident, boolean forWrite) {
        boolean parentIsIgnored = false;
        if (!ident.isColumn()) {
            // see if parent is strict object
            ColumnIdent parentIdent = ident.getParent();
            ReferenceInfo parentInfo = null;

            while (parentIdent != null) {
                parentInfo = getReferenceInfo(parentIdent);
                if (parentInfo != null) {
                    break;
                }
                parentIdent = parentIdent.getParent();
            }

            if (parentInfo != null) {
                switch (parentInfo.columnPolicy()) {
                    case STRICT:
                        throw new ColumnUnknownException(ident().name(), ident.fqn());
                    case IGNORED:
                        parentIsIgnored = true;
                        break;
View Full Code Here

        public static final ReferenceInfo ROUTINE_NAME = info(Columns.ROUTINE_NAME, DataTypes.STRING);
        public static final ReferenceInfo ROUTINE_TYPE = info(Columns.ROUTINE_TYPE, DataTypes.STRING);
    }

    private static ReferenceInfo info(ColumnIdent columnIdent, DataType dataType) {
        return new ReferenceInfo(new ReferenceIdent(IDENT, columnIdent), RowGranularity.DOC, dataType);
    }
View Full Code Here

    @Override
    public SysExpression<Object[]> getChildImplementation(String name) {
        List<SysObjectReference> childImplementations = getChildImplementations();
        final Object[] values = new Object[childImplementations.size()];
        ReferenceInfo info = null;
        int i = 0;
        for (SysObjectReference sysObjectReference : childImplementations) {
            SysExpression<?> child = sysObjectReference.getChildImplementation(name);
            if (child != null) {
                if (info == null) {
                    info = child.info();
                }
                Object value = child.value();
                values[i++] = value;
            }
        }
        if (info == null) {
            return null;
        } else {
            final ReferenceInfo infoFinal = info;
            return new SysExpression<Object[]>() {
                @Override
                public Object[] value() {
                    return values;
                }
View Full Code Here

            childImplementations.add(new NullFieldSysObjectReference());
        }

        @Override
        public ReferenceInfo info() {
            return new ReferenceInfo(new ReferenceIdent(new TableIdent("bla", "blubb"), "foo"), RowGranularity.DOC, new ArrayType(DataTypes.STRING));
        }
View Full Code Here

            return null;
        }

        @Override
        public ReferenceInfo info() {
            return new ReferenceInfo(new ReferenceIdent(new TableIdent("bla", "blubb"), "foo"), RowGranularity.DOC, DataTypes.STRING);
        }
View Full Code Here

            childImplementations.put("n", new BytesRefNullSysExpression());
        }

        @Override
        public ReferenceInfo info() {
            return new ReferenceInfo(new ReferenceIdent(new TableIdent("bla", "blubb"), "foo"), RowGranularity.DOC, DataTypes.OBJECT);
        }
View Full Code Here

        } else {
            PartitionName partitionName = PartitionName.fromStringSafe(node.index());
            int numPartitionColumns = node.partitionBy().size();
            partitionValues = new HashMap<>(numPartitionColumns);
            for (int i = 0; i < node.partitionBy().size(); i++) {
                ReferenceInfo info = node.partitionBy().get(i);
                partitionValues.put(
                        info.ident().columnIdent().fqn(),
                        info.type().value(partitionName.values().get(i))
                );
            }
        }
        return partitionValues;
    }
View Full Code Here

TOP

Related Classes of io.crate.metadata.ReferenceInfo

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.