use of io.crate.analyze.UpdateAnalyzedStatement in project crate by crate.
the class WhereClauseAnalyzerTest method testUpdateWherePartitionedByColumn.
@Test
public void testUpdateWherePartitionedByColumn() throws Exception {
UpdateAnalyzedStatement updateAnalyzedStatement = analyzeUpdate("update parted set id = 2 where date = 1395874800000");
UpdateAnalyzedStatement.NestedAnalyzedStatement nestedAnalyzedStatement = updateAnalyzedStatement.nestedStatements().get(0);
assertThat(nestedAnalyzedStatement.whereClause().hasQuery(), is(false));
assertThat(nestedAnalyzedStatement.whereClause().noMatch(), is(false));
assertEquals(ImmutableList.of(new PartitionName("parted", Arrays.asList(new BytesRef("1395874800000"))).asIndexName()), nestedAnalyzedStatement.whereClause().partitions());
}
Aggregations