seanli-rallyhealth commented on a change in pull request #27081:
[SPARK-30412][SQL][TESTS] Eliminate warnings in Java tests regarding to
deprecated Spark SQL API
URL: https://github.com/apache/spark/pull/27081#discussion_r362589702
##########
File path:
sql/core/src/test/java/test/org/apache/spark/sql/Java8DatasetAggregatorSuite.java
##########
@@ -25,43 +25,50 @@
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.KeyValueGroupedDataset;
-import org.apache.spark.sql.expressions.javalang.typed;
/**
* Suite that replicates tests in JavaDatasetAggregatorSuite using lambda
syntax.
*/
public class Java8DatasetAggregatorSuite extends
JavaDatasetAggregatorSuiteBase {
+ @SuppressWarnings("deprecation")
@Test
public void testTypedAggregationAverage() {
KeyValueGroupedDataset<String, Tuple2<String, Integer>> grouped =
generateGroupedDataset();
- Dataset<Tuple2<String, Double>> agged = grouped.agg(typed.avg(v ->
(double)(v._2() * 2)));
+ Dataset<Tuple2<String, Double>> agged = grouped.agg(
+ org.apache.spark.sql.expressions.javalang.typed.avg(v -> (double)(v._2()
* 2)));
Review comment:
don't think it's good idea to use full class name. you may use rename a
class on import
import org.apache.spark.sql.expressions.javalang.{typed => javaTyped}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]