Package io.crate.metadata

Examples of io.crate.metadata.TableIdent


        return modules;
    }

    @Test
    public void testPartitionNameFromAssignmentWithBytesRef() throws Exception {
        TableInfo tableInfo = TestingTableInfo.builder(new TableIdent("doc", "users"), RowGranularity.DOC, new Routing(null))
                .add("name", DataTypes.STRING, null, true)
                .addPrimaryKey("name").build();

        PartitionName partitionName = PartitionPropertiesAnalyzer.toPartitionName(
                tableInfo,
View Full Code Here


    @Test
    public void testUpdateAssignments() throws Exception {
        UpdateAnalysis.NestedAnalysis analysis = analyze("update users set name='Trillian'");
        assertThat(analysis.assignments().size(), is(1));
        assertThat(analysis.table().ident(), is(new TableIdent(null, "users")));

        Reference ref = analysis.assignments().keySet().iterator().next();
        assertThat(ref.info().ident().tableIdent().name(), is("users"));
        assertThat(ref.info().ident().columnIdent().name(), is("name"));
        assertTrue(analysis.assignments().containsKey(ref));
View Full Code Here

    private DocTableInfo innerGetTableInfo(String name) {
        boolean checkAliasSchema = clusterService.state().metaData().settings().getAsBoolean("crate.table_alias.schema_check", true);
        DocTableInfoBuilder builder = new DocTableInfoBuilder(
                this,
                new TableIdent(NAME, name),
                clusterService,
                transportPutIndexTemplateAction,
                checkAliasSchema
        );
        return builder.build();
View Full Code Here

        };
    }

    private BlobTableInfo innerGetTableInfo(String name) {
        BlobTableInfoBuilder builder = new BlobTableInfoBuilder(this,
                new TableIdent(NAME, name), clusterService, blobEnvironment, environment);
        return builder.build();
    }
View Full Code Here

        if (tableNameParts.size() == 2) {
            Preconditions.checkArgument(tableNameParts.get(0).equalsIgnoreCase(BlobSchemaInfo.NAME),
                    "The Schema \"%s\" isn't valid in a [CREATE | ALTER] BLOB TABLE clause",
                    tableNameParts.get(0));

            return new TableIdent(tableNameParts.get(0), tableNameParts.get(1));
        }
        assert tableNameParts.size() == 1;
        return new TableIdent(BlobSchemaInfo.NAME, tableNameParts.get(0));
    }
View Full Code Here

    public abstract Analysis newAnalysis(Analyzer.ParameterContext parameterContext);

    @Override
    protected R visitTable(Table node, T context) {
        Preconditions.checkState(context.table() == null, "selecting from multiple tables is not supported");
        TableIdent tableIdent = TableIdent.of(node);
        context.table(tableIdent);
        return null;
    }
View Full Code Here

                String.format("Encountered node %s but expected a CreateTable node", node));
    }

    @Override
    public Void visitCreateTable(CreateTable node, CreateTableAnalysis context) {
        TableIdent tableIdent = TableIdent.of(node.name());
        Preconditions.checkArgument(Strings.isNullOrEmpty(tableIdent.schema()),
                "A custom schema name must not be specified in the CREATE TABLE clause");
        context.table(tableIdent);

        // apply default in case it is not specified in the genericProperties,
        // if it is it will get overwritten afterwards.
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

TOP

Related Classes of io.crate.metadata.TableIdent

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.