MaxGekk 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_r362601244
 
 

 ##########
 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:
   The purpose of using full path to deprecated methods is to put any 
references to deprecated class under the annotation 
`@SuppressWarnings("deprecation")`. Even if we forget that your code doesn't 
compile in Java, it still refers to deprecated class.

----------------------------------------------------------------
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]

Reply via email to