manuzhang commented on code in PR #17157:
URL: https://github.com/apache/iceberg/pull/17157#discussion_r3900397176
##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetConversions.java:
##########
@@ -94,6 +94,12 @@ static Function<Object, Object>
converterFromParquet(PrimitiveType type) {
if (type.getOriginalType() != null) {
switch (type.getOriginalType()) {
case UTF8:
+ case ENUM:
+ case JSON:
+ // ENUM and JSON are UTF-8 strings that map to Iceberg StringType
(see MessageTypeToType),
+ // so they must be decoded to a CharSequence like UTF8; otherwise
read-time row-group
+ // filters compare a ByteBuffer against a CharSequence literal and
throw
+ // ClassCastException
Review Comment:
Can we add a more end-to -end test that throws `ClassCastException` without
this change?
##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetConversions.java:
##########
@@ -94,6 +94,12 @@ static Function<Object, Object>
converterFromParquet(PrimitiveType type) {
if (type.getOriginalType() != null) {
switch (type.getOriginalType()) {
case UTF8:
+ case ENUM:
+ case JSON:
+ // ENUM and JSON are UTF-8 strings that map to Iceberg StringType
(see MessageTypeToType),
+ // so they must be decoded to a CharSequence like UTF8; otherwise
read-time row-group
+ // filters compare a ByteBuffer against a CharSequence literal and
throw
+ // ClassCastException
Review Comment:
Can we add a more end-to-end test that throws `ClassCastException` without
this change?
--
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]