rdblue commented on a change in pull request #1857:
URL: https://github.com/apache/iceberg/pull/1857#discussion_r538899410
##########
File path: spark3/src/test/java/org/apache/iceberg/spark/sql/TestSelect.java
##########
@@ -63,11 +63,25 @@ public void removeTables() {
@Test
public void testSelect() {
- List<Object[]> expected = ImmutableList.of(row(1L, "a"), row(2L, "b"),
row(3L, "c"));
+ List<Object[]> expected = ImmutableList.of(
+ row(1L, "a", 1.0F), row(2L, "b", 2.0F), row(3L, "c", Float.NaN));
assertEquals("Should return all expected rows", expected, sql("SELECT *
FROM %s", tableName));
}
+ @Test
+ public void testSelectRewrite() {
+ List<Object[]> expected = ImmutableList.of(row(3L, "c", Float.NaN));
+
+ assertEquals("Should return all expected rows", expected,
+ sql("SELECT * FROM %s where float = float('NaN')", tableName));
+
+ Assert.assertEquals("Should create only one scan", 1, scanEventCount);
+ Assert.assertEquals("Should push down expected filter",
+ "(float IS NOT NULL AND float = NaN)",
Review comment:
Shouldn't this be `is_nan(float)` instead of `= NaN`?
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]