Search in sources :

Example 76 with WhereClause

use of io.crate.analyze.WhereClause in project crate by crate.

the class WhereClauseAnalyzerTest method testGtGenColOptimization.

@Test
public void testGtGenColOptimization() throws Exception {
    WhereClause whereClause = analyzeSelectWhere("select * from generated_col where ts > '2015-01-02T12:00:00'");
    assertThat(whereClause.partitions().size(), is(1));
    assertThat(whereClause.partitions().get(0), is(new PartitionName(new RelationName("doc", "generated_col"), Arrays.asList("1420156800000", "-2")).asIndexName()));
}
Also used : PartitionName(io.crate.metadata.PartitionName) WhereClause(io.crate.analyze.WhereClause) RelationName(io.crate.metadata.RelationName) CrateDummyClusterServiceUnitTest(io.crate.test.integration.CrateDummyClusterServiceUnitTest) Test(org.junit.Test)

Aggregations

WhereClause (io.crate.analyze.WhereClause)76 Test (org.junit.Test)52 CrateUnitTest (io.crate.test.integration.CrateUnitTest)30 CrateDummyClusterServiceUnitTest (io.crate.test.integration.CrateDummyClusterServiceUnitTest)17 Symbol (io.crate.analyze.symbol.Symbol)10 PartitionName (io.crate.metadata.PartitionName)8 RelationName (io.crate.metadata.RelationName)7 TableInfo (io.crate.metadata.table.TableInfo)7 Reference (io.crate.metadata.Reference)6 DocTableRelation (io.crate.analyze.relations.DocTableRelation)5 Symbol (io.crate.expression.symbol.Symbol)5 DocTableInfo (io.crate.metadata.doc.DocTableInfo)5 SqlExpressions (io.crate.testing.SqlExpressions)5 AnalyzedRelation (io.crate.analyze.relations.AnalyzedRelation)4 Routing (io.crate.metadata.Routing)4 QualifiedName (io.crate.sql.tree.QualifiedName)4 ImmutableList (com.google.common.collect.ImmutableList)3 OrderBy (io.crate.analyze.OrderBy)3 Function (io.crate.analyze.symbol.Function)3 Bucket (io.crate.data.Bucket)3