aokolnychyi commented on a change in pull request #1890:
URL: https://github.com/apache/iceberg/pull/1890#discussion_r539078152
##########
File path:
spark3-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestExpireSnapshotsProcedure.java
##########
@@ -163,18 +163,28 @@ public void testInvalidExpireSnapshotsCases() {
AssertHelpers.assertThrows("Should reject calls without all required args",
AnalysisException.class, "Missing required parameters",
- () -> sql("CALL %s.system.expire_snapshots('n')", catalogName));
+ () -> sql("CALL %s.system.expire_snapshots()", catalogName));
AssertHelpers.assertThrows("Should reject calls with invalid arg types",
- RuntimeException.class, "Couldn't parse identifier",
+ AnalysisException.class, "Wrong arg type",
() -> sql("CALL %s.system.expire_snapshots('n', 2.2)", catalogName));
- AssertHelpers.assertThrows("Should reject empty namespace",
- IllegalArgumentException.class, "Namespace cannot be empty",
- () -> sql("CALL %s.system.expire_snapshots('', 't')", catalogName));
+ AssertHelpers.assertThrows("Should reject calls without empty table
identifier",
+ IllegalArgumentException.class, "Cannot handle an empty identifier",
+ () -> sql("CALL %s.system.expire_snapshots('')", catalogName));
+ }
- AssertHelpers.assertThrows("Should reject empty table name",
- IllegalArgumentException.class, "Table name cannot be empty",
- () -> sql("CALL %s.system.expire_snapshots('n', '')", catalogName));
+ @Test
+ public void testResolvingTableInAnotherCatalog() throws IOException {
+ String anotherCatalog = "another_" + catalogName;
+ spark.conf().set("spark.sql.catalog." + anotherCatalog,
SparkCatalog.class.getName());
+ spark.conf().set("spark.sql.catalog." + anotherCatalog + ".type",
"hadoop");
+ spark.conf().set("spark.sql.catalog." + anotherCatalog + ".warehouse",
"file:" + temp.newFolder().toString());
+ spark.sql(String.format("CREATE TABLE %s.%s (id bigint NOT NULL, data
string) USING iceberg", anotherCatalog,
Review comment:
nit: we can probably use our `sql()` helper method to get
parameterization for free.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]