-
Notifications
You must be signed in to change notification settings - Fork 334
fix type cast warning in PolarisCatalogUtils #3178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
FYI: @rahil-c |
```
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
```
1cd3597 to
7c5ad69
Compare
| 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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)