pan3793 commented on code in PR #13106:
URL: https://github.com/apache/iceberg/pull/13106#discussion_r2184170197
##########
spark/v4.0/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestRollbackToSnapshotProcedure.java:
##########
@@ -250,27 +250,33 @@ public void testInvalidRollbackToSnapshotCases() {
"CALL %s.system.rollback_to_snapshot(namespace => 'n1',
table => 't', 1L)",
catalogName))
.isInstanceOf(AnalysisException.class)
- .hasMessage("Named and positional arguments cannot be mixed");
+ .hasMessage(
+ "[UNEXPECTED_POSITIONAL_ARGUMENT] Cannot invoke routine
`rollback_to_snapshot` because it contains positional argument(s) following the
named argument assigned to `table`; please rearrange them so the positional
arguments come first and then retry the query again. SQLSTATE: 4274K");
assertThatThrownBy(() -> sql("CALL %s.custom.rollback_to_snapshot('n',
't', 1L)", catalogName))
.isInstanceOf(AnalysisException.class)
- .hasMessage("Catalog %s does not support procedures.", catalogName);
+ .hasMessage(
+ "[FAILED_TO_LOAD_ROUTINE] Failed to load routine
`%s`.`custom`.`rollback_to_snapshot`. SQLSTATE: 38000",
+ catalogName);
assertThatThrownBy(() -> sql("CALL %s.system.rollback_to_snapshot('t')",
catalogName))
.isInstanceOf(AnalysisException.class)
- .hasMessage("Missing required parameters: [snapshot_id]");
+ .hasMessage(
+ "[REQUIRED_PARAMETER_NOT_FOUND] Cannot invoke routine
`rollback_to_snapshot` because the parameter named `snapshot_id` is required,
but the routine call did not supply a value. Please update the routine call to
supply an argument value (either positionally at index 0 or by name) and retry
the query again. SQLSTATE: 4274K");
assertThatThrownBy(() -> sql("CALL %s.system.rollback_to_snapshot(1L)",
catalogName))
.isInstanceOf(AnalysisException.class)
- .hasMessage("Missing required parameters: [snapshot_id]");
+ .hasMessage(
+ "[REQUIRED_PARAMETER_NOT_FOUND] Cannot invoke routine
`rollback_to_snapshot` because the parameter named `snapshot_id` is required,
but the routine call did not supply a value. Please update the routine call to
supply an argument value (either positionally at index 0 or by name) and retry
the query again. SQLSTATE: 4274K");
assertThatThrownBy(() -> sql("CALL %s.system.rollback_to_snapshot(table =>
't')", catalogName))
.isInstanceOf(AnalysisException.class)
- .hasMessage("Missing required parameters: [snapshot_id]");
+ .hasMessage(
+ "[REQUIRED_PARAMETER_NOT_FOUND] Cannot invoke routine
`rollback_to_snapshot` because the parameter named `snapshot_id` is required,
but the routine call did not supply a value. Please update the routine call to
supply an argument value (either positionally at index 1 or by name) and retry
the query again. SQLSTATE: 4274K");
assertThatThrownBy(() -> sql("CALL %s.system.rollback_to_snapshot('t',
2.2)", catalogName))
- .isInstanceOf(AnalysisException.class)
- .hasMessage("Wrong arg type for snapshot_id: cannot cast
DecimalType(2,1) to LongType");
+ .isInstanceOf(RuntimeException.class)
Review Comment:
addressed
##########
spark/v4.0/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestSetCurrentSnapshotProcedure.java:
##########
@@ -216,15 +219,16 @@ public void testInvalidRollbackToSnapshotCases() {
assertThatThrownBy(
() -> sql("CALL %s.system.set_current_snapshot(snapshot_id =>
1L)", catalogName))
.isInstanceOf(AnalysisException.class)
- .hasMessage("Missing required parameters: [table]");
+ .hasMessage(
+ "[REQUIRED_PARAMETER_NOT_FOUND] Cannot invoke routine
`set_current_snapshot` because the parameter named `table` is required, but the
routine call did not supply a value. Please update the routine call to supply
an argument value (either positionally at index 0 or by name) and retry the
query again. SQLSTATE: 4274K");
assertThatThrownBy(() -> sql("CALL %s.system.set_current_snapshot(table =>
't')", catalogName))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Either snapshot_id or ref must be provided, not both");
assertThatThrownBy(() -> sql("CALL %s.system.set_current_snapshot('t',
2.2)", catalogName))
- .isInstanceOf(AnalysisException.class)
- .hasMessage("Wrong arg type for snapshot_id: cannot cast
DecimalType(2,1) to LongType");
+ .isInstanceOf(RuntimeException.class)
Review Comment:
addressed
--
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]