Skip to content

Commit

Permalink
Code simplification (GoogleCloudDataproc#1041)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrabinowitz authored Aug 16, 2023
1 parent 977a0a7 commit f55c0dc
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.apache.spark.sql.internal.SQLConf;
import org.apache.spark.sql.sources.Filter;
import org.apache.spark.sql.types.Metadata;
import scala.collection.Iterator;

/** Spark related utilities */
public class SparkBigQueryUtil {
Expand Down Expand Up @@ -203,11 +202,7 @@ public static String getTableNameFromOptions(Map<String, String> options) {
public static <K, V> ImmutableMap<K, V> scalaMapToJavaMap(
scala.collection.immutable.Map<K, V> map) {
ImmutableMap.Builder<K, V> result = ImmutableMap.<K, V>builder();
Iterator<K> keysIterator = map.keys().iterator();
while (keysIterator.hasNext()) {
K key = keysIterator.next();
result.put(key, map.get(key).get());
}
map.foreach(entry -> result.put(entry._1(), entry._2()));
return result.build();
}

Expand Down

0 comments on commit f55c0dc

Please sign in to comment.