You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-53240][SQL] Ban com.google.common.collect.(ArrayList)?Multimap
### What changes were proposed in this pull request?
This PR aims to ban `com.google.common.collect.Multimap` and `com.google.common.collect.ArrayListMultimap` because we use very primitive usage with only two elements. We can simply do this like the following in native Java way.
```java
- private final Multimap<String, String> clientToHiveMap = ArrayListMultimap.create();
+ private final Map<String, List<String>> clientToHiveMap = new HashMap<>();
```
```java
- clientToHiveMap.putAll(ClassicTableTypes.TABLE.name(),
- Arrays.asList(TableType.MANAGED_TABLE.name(), TableType.EXTERNAL_TABLE.name()));
+ clientToHiveMap.put(ClassicTableTypes.TABLE.name(),
+ List.of(TableType.MANAGED_TABLE.name(), TableType.EXTERNAL_TABLE.name()));
```
### Why are the changes needed?
To simplify the code.
### Does this PR introduce _any_ user-facing change?
No behavior change.
### How was this patch tested?
Pass the CIs.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes#51967 from dongjoon-hyun/SPARK-53240.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
0 commit comments