Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neuyilan committed Dec 24, 2024
1 parent 6edd281 commit 098d08e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1597,10 +1597,6 @@ public static Path dataPath(Map<String, String> options) {
return new Path(options.get(TABLE_DATA_PATH.key()));
}

public static Path dataPath(Options options) {
return new Path(options.get(TABLE_DATA_PATH));
}

public TableType type() {
return options.get(TYPE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public static TestAppendFileStore createAppendStore(
SchemaManager schemaManage = new SchemaManager(new LocalFileIO(), path);

options.put(CoreOptions.PATH.key(), root);
options.put(CoreOptions.TABLE_DATA_PATH.key(), root);
TableSchema tableSchema =
SchemaUtils.forceCommit(
schemaManage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ public TestFileStore build() {
conf.set(CoreOptions.FILE_FORMAT, format);
conf.set(CoreOptions.MANIFEST_FORMAT, format);
conf.set(CoreOptions.PATH, root);
conf.set(CoreOptions.TABLE_DATA_PATH, root);
conf.set(CoreOptions.BUCKET, numBuckets);

conf.set(CoreOptions.CHANGELOG_PRODUCER, changelogProducer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
import static org.apache.flink.table.factories.FactoryUtil.CONNECTOR;
import static org.apache.paimon.CoreOptions.PATH;
import static org.apache.paimon.CoreOptions.SCAN_FILE_CREATION_TIME_MILLIS;
import static org.apache.paimon.CoreOptions.TABLE_DATA_PATH;
import static org.apache.paimon.flink.FlinkCatalogOptions.DISABLE_CREATE_TABLE_IN_DEFAULT_DB;
import static org.apache.paimon.flink.FlinkCatalogOptions.LOG_SYSTEM_AUTO_REGISTER;
import static org.apache.paimon.flink.FlinkConnectorOptions.LOG_SYSTEM;
Expand Down Expand Up @@ -709,6 +710,7 @@ public void testCreateTableWithColumnOptions() throws Exception {

Map<String, String> expected = got.getOptions();
expected.remove("path");
expected.remove("table.data.path");
expected.remove(FlinkCatalogOptions.REGISTER_TIMEOUT.key());
assertThat(catalogTable.getOptions()).isEqualTo(expected);
}
Expand Down Expand Up @@ -892,19 +894,21 @@ private void checkEquals(
Map<String, String> optionsToAdd,
Set<String> optionsToRemove) {
Path tablePath;
Path tableDataPath;
try {
tablePath =
new Path(
((FlinkCatalog) catalog)
.catalog()
.getTable(FlinkCatalog.toIdentifier(path))
.options()
.get(PATH.key()));
Map<String, String> options =
((FlinkCatalog) catalog)
.catalog()
.getTable(FlinkCatalog.toIdentifier(path))
.options();
tablePath = new Path(options.get(PATH.key()));
tableDataPath = new Path(options.get(TABLE_DATA_PATH.key()));
} catch (org.apache.paimon.catalog.Catalog.TableNotExistException e) {
throw new RuntimeException(e);
}
Map<String, String> options = new HashMap<>(t1.getOptions());
options.put("path", tablePath.toString());
options.put("table.data.path", tableDataPath.toString());
options.putAll(optionsToAdd);
optionsToRemove.forEach(options::remove);
if (t1.getTableKind() == CatalogBaseTable.TableKind.TABLE) {
Expand Down

0 comments on commit 098d08e

Please sign in to comment.