aokolnychyi commented on code in PR #7553:
URL: https://github.com/apache/iceberg/pull/7553#discussion_r1189336292
##########
spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/source/TestTimestampWithoutZone.java:
##########
@@ -157,64 +153,10 @@ public void
testUnpartitionedTimestampWithoutZoneProjection() {
read(unpartitioned.toString(), vectorized, "id", "ts"));
}
- @Test
- public void testUnpartitionedTimestampWithoutZoneError() {
- Assertions.assertThatThrownBy(
- () ->
- spark
- .read()
- .format("iceberg")
- .option(SparkReadOptions.VECTORIZATION_ENABLED,
String.valueOf(vectorized))
-
.option(SparkReadOptions.HANDLE_TIMESTAMP_WITHOUT_TIMEZONE, "false")
- .load(unpartitioned.toString())
- .collectAsList())
- .isInstanceOf(IllegalArgumentException.class)
- .hasMessage(SparkUtil.TIMESTAMP_WITHOUT_TIMEZONE_ERROR);
- }
-
- @Test
- public void testUnpartitionedTimestampWithoutZoneAppend() {
- spark
- .read()
- .format("iceberg")
- .option(SparkReadOptions.HANDLE_TIMESTAMP_WITHOUT_TIMEZONE, "true")
- .option(SparkReadOptions.VECTORIZATION_ENABLED,
String.valueOf(vectorized))
- .load(unpartitioned.toString())
- .write()
- .format("iceberg")
- .option(SparkWriteOptions.HANDLE_TIMESTAMP_WITHOUT_TIMEZONE, "true")
- .mode(SaveMode.Append)
- .save(unpartitioned.toString());
-
- assertEqualsSafe(
- SCHEMA.asStruct(),
- Stream.concat(records.stream(),
records.stream()).collect(Collectors.toList()),
- read(unpartitioned.toString(), vectorized));
- }
-
- @Test
- public void testUnpartitionedTimestampWithoutZoneWriteError() {
- Assertions.assertThatThrownBy(
- () ->
- spark
- .read()
- .format("iceberg")
-
.option(SparkReadOptions.HANDLE_TIMESTAMP_WITHOUT_TIMEZONE, "true")
- .option(SparkReadOptions.VECTORIZATION_ENABLED,
String.valueOf(vectorized))
- .load(unpartitioned.toString())
- .write()
- .format("iceberg")
-
.option(SparkWriteOptions.HANDLE_TIMESTAMP_WITHOUT_TIMEZONE, "false")
- .mode(SaveMode.Append)
- .save(unpartitioned.toString()))
- .isInstanceOf(IllegalArgumentException.class)
- .hasMessage(SparkUtil.TIMESTAMP_WITHOUT_TIMEZONE_ERROR);
- }
-
@Test
public void testUnpartitionedTimestampWithoutZoneSessionProperties() {
withSQLConf(
- ImmutableMap.of(SparkSQLProperties.HANDLE_TIMESTAMP_WITHOUT_TIMEZONE,
"true"),
+ ImmutableMap.of(),
Review Comment:
minor: Same here.
##########
spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/sql/TestTimestampWithoutZone.java:
##########
@@ -93,18 +90,10 @@ public void removeTables() {
sql("DROP TABLE IF EXISTS %s", newTableName);
}
- @Test
- public void testWriteTimestampWithoutZoneError() {
- Assertions.assertThatThrownBy(
- () -> sql("INSERT INTO %s VALUES %s", tableName,
rowToSqlValues(values)))
- .isInstanceOf(IllegalArgumentException.class)
- .hasMessage(SparkUtil.TIMESTAMP_WITHOUT_TIMEZONE_ERROR);
- }
-
@Test
public void testAppendTimestampWithoutZone() {
Review Comment:
I wonder whether we should test out that Spark SQL conf instead now.
##########
spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/data/AvroDataTest.java:
##########
@@ -232,7 +231,7 @@ public void testMixedTypes() throws IOException {
@Test
public void testTimestampWithoutZone() throws IOException {
withSQLConf(
Review Comment:
minor: Shall we drop `withSQLConf` completely given that the conf is empty
now?
--
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]