diff options
author | Sean Owen <sowen@cloudera.com> | 2017-02-16 12:32:45 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2017-02-16 12:32:45 +0000 |
commit | 0e2405490f2056728d1353abbac6f3ea177ae533 (patch) | |
tree | 1a9ec960faec7abcb8d8fbac43b6a6dc633d2297 /sql/core/src/main/scala/org | |
parent | 3871d94a695d47169720e877f77ff1e4bede43ee (diff) | |
download | spark-0e2405490f2056728d1353abbac6f3ea177ae533.tar.gz spark-0e2405490f2056728d1353abbac6f3ea177ae533.tar.bz2 spark-0e2405490f2056728d1353abbac6f3ea177ae533.zip |
[SPARK-19550][BUILD][CORE][WIP] Remove Java 7 support
- Move external/java8-tests tests into core, streaming, sql and remove
- Remove MaxPermGen and related options
- Fix some reflection / TODOs around Java 8+ methods
- Update doc references to 1.7/1.8 differences
- Remove Java 7/8 related build profiles
- Update some plugins for better Java 8 compatibility
- Fix a few Java-related warnings
For the future:
- Update Java 8 examples to fully use Java 8
- Update Java tests to use lambdas for simplicity
- Update Java internal implementations to use lambdas
## How was this patch tested?
Existing tests
Author: Sean Owen <sowen@cloudera.com>
Closes #16871 from srowen/SPARK-19493.
Diffstat (limited to 'sql/core/src/main/scala/org')
4 files changed, 2 insertions, 24 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala b/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala index e62cd9f7bf..38a24cc8ed 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala @@ -103,7 +103,7 @@ private[sql] object Dataset { * the following creates a new Dataset by applying a filter on the existing one: * {{{ * val names = people.map(_.name) // in Scala; names is a Dataset[String] - * Dataset<String> names = people.map((Person p) -> p.name, Encoders.STRING)); // in Java 8 + * Dataset<String> names = people.map((Person p) -> p.name, Encoders.STRING)); * }}} * * Dataset operations can also be untyped, through various domain-specific-language (DSL) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala b/sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala index 94e689a4d5..3a548c251f 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala @@ -98,7 +98,7 @@ class KeyValueGroupedDataset[K, V] private[sql]( * // Create Integer values grouped by String key from a Dataset<Tuple2<String, Integer>> * Dataset<Tuple2<String, Integer>> ds = ...; * KeyValueGroupedDataset<String, Integer> grouped = - * ds.groupByKey(t -> t._1, Encoders.STRING()).mapValues(t -> t._2, Encoders.INT()); // Java 8 + * ds.groupByKey(t -> t._1, Encoders.STRING()).mapValues(t -> t._2, Encoders.INT()); * }}} * * @since 2.1.0 diff --git a/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala b/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala index ea465e2c83..dbe55090ea 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala @@ -190,17 +190,6 @@ class SQLContext private[sql](val sparkSession: SparkSession) * The following example registers a UDF in Java: * {{{ * sqlContext.udf().register("myUDF", - * new UDF2<Integer, String, String>() { - * @Override - * public String call(Integer arg1, String arg2) { - * return arg2 + arg1; - * } - * }, DataTypes.StringType); - * }}} - * - * Or, to use Java 8 lambda syntax: - * {{{ - * sqlContext.udf().register("myUDF", * (Integer arg1, String arg2) -> arg2 + arg1, * DataTypes.StringType); * }}} diff --git a/sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala b/sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala index e1fdb2f287..1975a56caf 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala @@ -164,17 +164,6 @@ class SparkSession private( * The following example registers a UDF in Java: * {{{ * sparkSession.udf().register("myUDF", - * new UDF2<Integer, String, String>() { - * @Override - * public String call(Integer arg1, String arg2) { - * return arg2 + arg1; - * } - * }, DataTypes.StringType); - * }}} - * - * Or, to use Java 8 lambda syntax: - * {{{ - * sparkSession.udf().register("myUDF", * (Integer arg1, String arg2) -> arg2 + arg1, * DataTypes.StringType); * }}} |