singhpk234 commented on code in PR #14349:
URL: https://github.com/apache/iceberg/pull/14349#discussion_r2464399429
##########
spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/data/SparkParquetReaders.java:
##########
@@ -776,7 +776,7 @@ public MapData getMap(int ordinal) {
@Override
public VariantVal getVariant(int ordinal) {
- throw new UnsupportedOperationException("Unsupported method:
getVariant");
+ return (VariantVal) values[ordinal];
Review Comment:
do we need a Precondition before case for error message ?
##########
spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/sql/TestSparkVariantRead.java:
##########
@@ -169,4 +169,112 @@ public void testVariantNullValueProjection(boolean
vectorized) {
assertThat(row.getLong(0)).isEqualTo(10L);
assertThat(row.isNullAt(1)).isTrue();
}
+
+ @ParameterizedTest
+ @ValueSource(booleans = {false, true})
+ public void testNestedStructVariant(boolean vectorized) {
+ assumeThat(vectorized).as("Variant vectorized Parquet read is not
implemented yet").isFalse();
+ spark.conf().set("spark.sql.parquet.enableVectorizedReader",
String.valueOf(vectorized));
Review Comment:
nit : we have withSQLConf in iceberg too, can try using it ?
--
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]