You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/03/20 15:54:59 UTC
[GitHub] [ignite] zstan commented on a change in pull request #8906: IGNITE-14336 pass a table modification command to the calcite schema …
zstan commented on a change in pull request #8906:
URL: https://github.com/apache/ignite/pull/8906#discussion_r598127471
##########
File path: modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java
##########
@@ -849,6 +851,109 @@ public void testTableDistributionKeysForComplexKeyObject() {
assertEquals(ImmutableIntList.of(3), tblMap.get("MY_TBL_2").descriptor().distribution().getKeys());
}
+ /**
+ * Verifies that table modification events are passed to a calcite schema modification listener.
+ */
+ @Test
+ public void testIgniteSchemaAwaresAlterTableCommand() {
+ String selectAllQry = "select * from test_tbl";
+
+ execute(client, "drop table if exists test_tbl");
+ execute(client, "create table test_tbl(id int primary key, val varchar)");
+
+ CalciteQueryProcessor qryProc = Commons.lookupComponent(client.context(), CalciteQueryProcessor.class);
+
+ {
+ List<String> names = deriveColumnNamesFromCursor(
+ qryProc.query(null, "PUBLIC", selectAllQry).get(0)
+ );
+
+ assertThat(names, equalTo(F.asList("ID", "VAL")));
+ }
+
+ {
+ execute(client, "alter table test_tbl add column new_col int");
+
+ List<String> names = deriveColumnNamesFromCursor(
+ qryProc.query(null, "PUBLIC", selectAllQry).get(0)
+ );
+
+ assertThat(names, equalTo(F.asList("ID", "VAL", "NEW_COL")));
+ }
+
+ {
+ try {
+ execute(client, "alter table test_tbl add column new_col int");
Review comment:
may be it would be useful to append
fail(); into new line ? thus Exception throwing will be checked.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org