vldpyatkov commented on a change in pull request #502:
URL: https://github.com/apache/ignite-3/pull/502#discussion_r768642500
##########
File path:
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItTablesApiTest.java
##########
@@ -439,16 +563,48 @@ protected Table createTable(Ignite node, String
schemaName, String shortTableNam
* @param shortTableName Table name.
*/
protected Table createTableIfNotExists(Ignite node, String schemaName,
String shortTableName) {
- return node.tables().createTableIfNotExists(
- schemaName + "." + shortTableName,
- tblCh -> convert(SchemaBuilders.tableBuilder(schemaName,
shortTableName).columns(Arrays.asList(
- SchemaBuilders.column("key", ColumnType.INT64).build(),
- SchemaBuilders.column("valInt",
ColumnType.INT32).asNullable(true).build(),
- SchemaBuilders.column("valStr", ColumnType.string())
- .withDefaultValueExpression("default").build()
- )).withPrimaryKey("key").build(),
- tblCh).changeReplicas(2).changePartitions(10)
- );
+ try {
+ return node.tables().createTable(
+ schemaName + "." + shortTableName,
+ tblCh -> convert(SchemaBuilders.tableBuilder(schemaName,
shortTableName).columns(Arrays.asList(
+ SchemaBuilders.column("key",
ColumnType.INT64).build(),
+ SchemaBuilders.column("valInt",
ColumnType.INT32).asNullable(true).build(),
+ SchemaBuilders.column("valStr",
ColumnType.string())
+
.withDefaultValueExpression("default").build()
+ )).withPrimaryKey("key").build(),
+ tblCh).changeReplicas(2).changePartitions(10)
+ );
+ } catch (TableAlreadyExistsException ex) {
+ return node.tables().table(schemaName + "." + shortTableName);
+ }
+ }
+
+ /**
+ * Drops the table which name is specified.
+ * If the table did not exist, an exception would be thrown.
Review comment:
Done.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]