nastra commented on code in PR #9765:
URL: https://github.com/apache/iceberg/pull/9765#discussion_r1497068780
##########
core/src/test/java/org/apache/iceberg/jdbc/TestJdbcCatalog.java:
##########
@@ -161,6 +163,40 @@ public void testInitialize() {
jdbcCatalog.initialize("test_jdbc_catalog", properties);
}
+ @Test
+ public void testInitSchemaV0() throws Exception {
+ Map<String, String> properties = Maps.newHashMap();
+ properties.put(CatalogProperties.WAREHOUSE_LOCATION,
this.tableDir.toAbsolutePath().toString());
+ properties.put(CatalogProperties.URI,
"jdbc:sqlite:file::memory:?icebergDBV0");
+ properties.put(JdbcUtil.SCHEMA_VERSION_PROPERTY,
JdbcUtil.SchemaVersion.V0.name());
+ JdbcCatalog jdbcCatalog = new JdbcCatalog();
+ jdbcCatalog.setConf(conf);
+ jdbcCatalog.initialize("v0catalog", properties);
+
+ TableIdentifier tableIdent = TableIdentifier.of("db", "ns1", "ns2", "tbl");
+ Table table =
+ jdbcCatalog
+ .buildTable(tableIdent, SCHEMA)
+ .withPartitionSpec(PARTITION_SPEC)
+ .withProperties(null)
+ .withProperty("key1", "value1")
+ .withProperties(ImmutableMap.of("key2", "value2"))
+ .create();
+
+ assertThat(table.schema()).hasToString(SCHEMA.toString());
Review Comment:
```suggestion
assertThat(table.schema().asStruct()).isEqualTo(SCHEMA.asStruct());
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]