lindong28 commented on code in PR #103:
URL: https://github.com/apache/flink-ml/pull/103#discussion_r882652830


##########
flink-ml-lib/src/test/java/org/apache/flink/ml/classification/KnnTest.java:
##########
@@ -121,8 +124,9 @@ private static void verifyPredictionResult(Table output, 
String labelCol, String
                                     @Override
                                     public Tuple2<Double, Double> map(Row row) 
{
                                         return Tuple2.of(
-                                                (Double) 
row.getField(labelCol),
-                                                (Double) 
row.getField(predictionCol));
+                                                ((Number) 
row.getField(labelCol)).doubleValue(),

Review Comment:
   Since the values of the output table's label column have the same type as 
the input table's label column specified by the user, the user should already 
know that this column has double values, and therefore would not need to 
explicitly convert this column to double type, right?
   
   Would it be simpler to skip type-casting for the label column as well?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to