rdblue commented on a change in pull request #4009:
URL: https://github.com/apache/iceberg/pull/4009#discussion_r798835301
##########
File path:
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/SparkTableUtil.java
##########
@@ -178,12 +179,16 @@ private SparkTableUtil() {
Option<scala.collection.immutable.Map<String, String>>
scalaPartitionFilter;
if (partitionFilter != null && !partitionFilter.isEmpty()) {
- scalaPartitionFilter =
Option.apply(JavaConverters.mapAsScalaMapConverter(partitionFilter).asScala()
- .toMap(Predef.conforms()));
+ Builder<Tuple2<String, String>, scala.collection.immutable.Map<String,
String>> builder =
+ Map$.MODULE$.<String, String>newBuilder();
+ for (Map.Entry<String, String> entry : partitionFilter.entrySet()) {
+ builder.$plus$eq(Tuple2.apply(entry.getKey(), entry.getValue()));
+ }
Review comment:
Using the Scala API in Java is really ugly. I think that's why we prefer
to use the Java API and convert unless it is performance critical. Is this
change needed for Scala 2.13 or can we continue to convert?
--
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]