rdblue commented on code in PR #6402: URL: https://github.com/apache/iceberg/pull/6402#discussion_r1050278409
########## flink/v1.16/flink/src/test/java/org/apache/iceberg/flink/source/TestFlinkTableSource.java: ########## @@ -603,7 +603,108 @@ public void testFilterPushDown2Literal() { } @Test - public void testSqlParseNaN() { - // todo add some test case to test NaN + public void testFilterNaN() { + final String tableName = "test_table_nan"; + try { + sql( + "CREATE TABLE %s (id INT, data VARCHAR,d DOUBLE, f FLOAT) WITH ('write.format.default'='%s')", + tableName, format.name()); + sql( + "INSERT INTO %s VALUES (1,'iceberg',10, 1.1),(2,'b',20,2.2),(3,CAST(NULL AS VARCHAR),30,3.3),(4,'d',CAST('NaN' AS DOUBLE),4.4)", + tableName); + + String sqlNaNDoubleEqual = + String.format("SELECT * FROM %s WHERE d = CAST('NaN' AS DOUBLE) ", tableName); + List<Row> resultDoubleEqual = sql(sqlNaNDoubleEqual); + Assert.assertEquals("Should have 0 records", 0, resultDoubleEqual.size()); Review Comment: This should have 1 record. -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org