use of com.hazelcast.jet.sql.impl.schema.HazelcastTable in project hazelcast by hazelcast.
the class LogicalUpdateTest method test_updateByKeyWithLiteral.
@Test
@Parameters(method = "literals")
public void test_updateByKeyWithLiteral(QueryDataType type, String literalValue) {
HazelcastTable table = partitionedTable("m", asList(field(KEY, type), field(VALUE, VARCHAR)), 1);
assertPlan(optimizeLogical("UPDATE m SET this = '2' WHERE __key = " + literalValue, table), plan(planRow(0, UpdateByKeyMapLogicalRel.class)));
assertPlan(optimizeLogical("UPDATE m SET this = '2' WHERE " + literalValue + " = __key", table), plan(planRow(0, UpdateByKeyMapLogicalRel.class)));
}
use of com.hazelcast.jet.sql.impl.schema.HazelcastTable in project hazelcast by hazelcast.
the class LogicalUpdateTest method test_updateByValue.
@Test
public void test_updateByValue() {
HazelcastTable table = partitionedTable("m", asList(field(KEY, INT), field(VALUE, VARCHAR)), 10);
assertPlan(optimizeLogical("UPDATE m SET this = '2' WHERE this = '1'", table), plan(planRow(0, UpdateLogicalRel.class), planRow(1, FullScanLogicalRel.class)));
}
use of com.hazelcast.jet.sql.impl.schema.HazelcastTable in project hazelcast by hazelcast.
the class LogicalUpdateTest method test_requiresJob.
@Test
public void test_requiresJob() {
HazelcastTable table = partitionedTable("m", asList(field(KEY, INT), field(VALUE, VARCHAR)), 0);
assertPlan(optimizeLogical("UPDATE m SET this = '2' WHERE __key = 1", true, table), plan(planRow(0, UpdateLogicalRel.class), planRow(1, FullScanLogicalRel.class)));
}
use of com.hazelcast.jet.sql.impl.schema.HazelcastTable in project hazelcast by hazelcast.
the class PhysicalJoinTest method when_rightChildIsNotTableScan_then_useHashJoin.
@Test
public void when_rightChildIsNotTableScan_then_useHashJoin() {
HazelcastTable tableLeft = partitionedTable("l", asList(field(KEY, INT), field(VALUE, INT)), 1);
HazelcastTable tableRight = partitionedTable("r", asList(field(KEY, INT), field(VALUE, INT)), 1);
String query = "SELECT * FROM l WHERE EXISTS (SELECT 1 FROM r WHERE l.__key = r.__key)";
assertPlan(optimizePhysical(query, asList(), tableLeft, tableRight).getPhysical(), plan(planRow(0, ProjectPhysicalRel.class), planRow(1, JoinHashPhysicalRel.class), planRow(2, FullScanPhysicalRel.class), planRow(2, AggregateCombineByKeyPhysicalRel.class), planRow(3, AggregateAccumulateByKeyPhysicalRel.class), planRow(4, FullScanPhysicalRel.class)));
}
use of com.hazelcast.jet.sql.impl.schema.HazelcastTable in project hazelcast by hazelcast.
the class LogicalInsertTest method test_requiresJob.
@Test
public void test_requiresJob() {
HazelcastTable table = partitionedTable("m", asList(field(KEY, INT), field(VALUE, VARCHAR)), 0);
assertPlan(optimizeLogical("INSERT INTO m VALUES (1, '1')", true, table), plan(planRow(0, InsertLogicalRel.class), planRow(1, ValuesLogicalRel.class)));
}
Aggregations