Skip to content

Conversation

@dimas-b
Copy link
Contributor

@dimas-b dimas-b commented Nov 27, 2025

plugins/spark/v3.5/spark/src/main/java/org/apache/polaris/spark/utils/PolarisCatalogUtils.java:131: warning: [unchecked] unchecked cast
            scala.collection.immutable.Map$.MODULE$.apply(
                                                         ^
  required: Map<String,String>
  found:    Map

Checklist

  • 🛡️ Don't disclose security issues! (contact [email protected])
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

@dimas-b
Copy link
Contributor Author

dimas-b commented Nov 27, 2025

FYI: @rahil-c

@dimas-b dimas-b marked this pull request as draft November 27, 2025 21:36
```
plugins/spark/v3.5/spark/src/main/java/org/apache/polaris/spark/utils/PolarisCatalogUtils.java:131: warning: [unchecked] unchecked cast
            scala.collection.immutable.Map$.MODULE$.apply(
                                                         ^
  required: Map<String,String>
  found:    Map
```
@dimas-b dimas-b marked this pull request as ready for review November 28, 2025 00:16
Builder<Tuple2<String, String>, scala.collection.immutable.Map<String, String>> mb =
Map$.MODULE$.newBuilder();
tableProperties.forEach((k, v) -> mb.$plus$eq(Tuple2.apply(k, v)));
scala.collection.immutable.Map<String, String> scalaOptions = mb.result();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about using scala.jdk.javaapi.CollectionConverters instead of the original builder pattern here (and JavaConverters on line 142)? It's more concise, though the builder approach is more explicit.

Copy link
Contributor Author

@dimas-b dimas-b Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried CollectionConverters but hit compatibility issues between scala 2.12 and 2.13 🤷

@tmater : if you have a working code for both scala versions that Polaris uses - please open a PR. I'd be happy to switch to CollectionConverters. Note: IJ by default only shows you scala 2.12 - you need to run ./gradlew --no-build-cache :polaris-spark-3.5_2.13:compileJava from shell.

Copy link
Contributor

@tmater tmater Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for the explanation, I’ll check both Scala versions later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants