Package io.crate.metadata

Examples of io.crate.metadata.ReferenceInfo.type()


    @Test
    public void testGetColumnInfo() throws Exception {
        ReferenceInfo foobar = info.getReferenceInfo(new ColumnIdent("digest"));
        assertNotNull(foobar);
        assertEquals(DataTypes.STRING, foobar.type());

        DynamicReference reference = info.getDynamic(new ColumnIdent("foobar"));
        assertNull(reference);
    }
View Full Code Here


            Object value = entry.getValue();

            int idx = tableInfo.partitionedBy().indexOf(entry.getKey());
            try {
                ReferenceInfo referenceInfo = tableInfo.partitionedByColumns().get(idx);
                Object converted = referenceInfo.type().value(value);
                values[idx] = converted == null ? null : DataTypes.STRING.value(converted);
            } catch (IndexOutOfBoundsException ex) {
                throw new IllegalArgumentException(
                        String.format("\"%s\" is no known partition column", entry.getKey().fqn()));
            }
View Full Code Here

            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
Copyright © 2018 www.massapi.com. 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.