use of com.hazelcast.sql.impl.exec.scan.index.MapIndexScanExecIterator in project hazelcast by hazelcast.
the class SqlIndexConverterMismatchTest method testMismatch.
/**
* @see MapIndexScanExecIterator#getIndexEntries
*/
@SuppressWarnings({ "StatementWithEmptyBody", "JavadocReference" })
@Ignore("https://github.com/hazelcast/hazelcast/issues/19287")
@Test
public void testMismatch() {
ExpressionBiValue value1 = new ExpressionBiValue.IntegerIntegerVal();
value1.field1(10);
value1.field2(10);
ExpressionBiValue value2 = new ExpressionBiValue.StringIntegerVal();
value2.field1("10");
value2.field2(10);
map.put(getLocalKey(member1, key -> key), value1);
map.put(getLocalKey(member2, key -> key), value2);
try {
try (SqlResult result = member1.getSql().execute("SELECT key FROM " + MAP_NAME + " WHERE field1=1")) {
for (SqlRow ignore : result) {
// No-op.
}
}
fail("Must fail!");
} catch (HazelcastSqlException e) {
assertEquals(SqlErrorCode.INDEX_INVALID, e.getCode());
Throwable ex = findRootQueryException(e);
assertEquals("Cannot use the index \"index\" of the IMap \"map\" because it has component \"field1\" of type VARCHAR, but INTEGER was expected", ex.getMessage());
}
}
Aggregations