liuxiaocs7 commented on code in PR #7483:
URL: https://github.com/apache/iceberg/pull/7483#discussion_r1182259253
##########
spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/source/TestDataSourceOptions.java:
##########
@@ -242,50 +242,49 @@ public void testIncrementalScanOptions() throws
IOException {
List<Long> snapshotIds = SnapshotUtil.currentAncestorIds(table);
// start-snapshot-id and snapshot-id are both configured.
- AssertHelpers.assertThrows(
- "Check both start-snapshot-id and snapshot-id are configured",
- IllegalArgumentException.class,
- "Cannot set start-snapshot-id and end-snapshot-id for incremental
scans",
- () -> {
- spark
- .read()
- .format("iceberg")
- .option("snapshot-id", snapshotIds.get(3).toString())
- .option("start-snapshot-id", snapshotIds.get(3).toString())
- .load(tableLocation)
- .explain();
- });
+ Assertions.assertThatThrownBy(
+ () ->
+ spark
+ .read()
+ .format("iceberg")
+ .option("snapshot-id", snapshotIds.get(3).toString())
+ .option("start-snapshot-id", snapshotIds.get(3).toString())
+ .load(tableLocation)
+ .explain())
+ .isInstanceOf(IllegalArgumentException.class)
+ .hasMessage(
+ "Cannot set start-snapshot-id and end-snapshot-id for incremental
scans when either snapshot-id or as-of-timestamp is set");
// end-snapshot-id and as-of-timestamp are both configured.
- AssertHelpers.assertThrows(
- "Check both start-snapshot-id and snapshot-id are configured",
- IllegalArgumentException.class,
- "Cannot set start-snapshot-id and end-snapshot-id for incremental
scans",
- () -> {
- spark
- .read()
- .format("iceberg")
- .option(
- SparkReadOptions.AS_OF_TIMESTAMP,
-
Long.toString(table.snapshot(snapshotIds.get(3)).timestampMillis()))
- .option("end-snapshot-id", snapshotIds.get(2).toString())
- .load(tableLocation)
- .explain();
- });
+ Assertions.assertThatThrownBy(
+ () -> {
Review Comment:
thanks, fixed
--
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]