You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/05/27 03:03:14 UTC

[GitHub] [flink-ml] yunfengzhou-hub commented on a diff in pull request #103: [FLINK-27742] Fix compatibility issue between Stages

yunfengzhou-hub commented on code in PR #103:
URL: https://github.com/apache/flink-ml/pull/103#discussion_r883234948


##########
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:
   According to offline discussion, label column is inherited from input table and remain untouched, which means it could be double or integer type. Thus we still need to use (Number)...doubleValue() in order to extract its value.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org