Skip to content

Commit

Permalink
[apache#1707] feat(mysql): Support mysql index.
Browse files Browse the repository at this point in the history
  • Loading branch information
Clearvive authored and Clearvive committed Jan 29, 2024
1 parent da3031f commit 4c7f107
Showing 1 changed file with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,26 @@ void testCreateTableIndex() {
Transforms.EMPTY_TRANSFORM,
Distributions.NONE,
new SortOrder[0],
new Index[] {
Indexes.createMysqlPrimaryKey(new String[][] {{"col_1", "col_2"}}),
Indexes.unique("u1_key", new String[][] {{"col_2", "col_3"}})
});
new Index[] {Indexes.createMysqlPrimaryKey(new String[][] {{"col_1", "col_2"}})});
});
Assertions.assertTrue(
StringUtils.contains(
illegalArgumentException.getMessage(),
"Index does not support complex fields in MySQL"));

illegalArgumentException =
assertThrows(
IllegalArgumentException.class,
() -> {
tableCatalog.createTable(
NameIdentifier.of(metalakeName, catalogName, schemaName, "test_failed"),
newColumns,
table_comment,
properties,
Transforms.EMPTY_TRANSFORM,
Distributions.NONE,
new SortOrder[0],
new Index[] {Indexes.unique("u1_key", new String[][] {{"col_2", "col_3"}})});
});
Assertions.assertTrue(
StringUtils.contains(
Expand Down

0 comments on commit 4c7f107

Please sign in to comment.