nastra commented on code in PR #14804:
URL: https://github.com/apache/iceberg/pull/14804#discussion_r2605742966


##########
spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/sql/TestSelect.java:
##########
@@ -643,4 +644,39 @@ public void 
testRequiredNestedFieldInOptionalStructFilter() {
     assertEquals("Should return all expected rows", ImmutableList.of(row(0)), 
result);
     sql("DROP TABLE IF EXISTS %s", nestedStructTable);
   }
+
+  @TestTemplate
+  public void simpleTypesInFilter() {
+    String tableName = tableName("simple_types_table");
+    sql(
+        "CREATE TABLE IF NOT EXISTS %s (id bigint, boolean boolean, integer 
integer, long long, "
+            + "float float, double double, string string, date date, timestamp 
timestamp) USING iceberg",
+        tableName);
+    sql(
+        "INSERT INTO %s VALUES (1, true, 1, 1L, 1.0, 1.0, '1.0', 
to_date('2021-01-01'), to_timestamp('2021-01-01T00:00:00')), "
+            + "(2, false, 2, 2L, 2.0, 2.0, '2.0', to_date('2022-02-02'), 
to_timestamp('2022-02-02T00:00:00')), "
+            + "(3, true, 3, 3L, 3.0, 3.0, '3.0', to_date('2023-03-03'), 
to_timestamp('2023-03-03T00:00:00'))",
+        tableName);
+    assertThat(sql("SELECT id FROM %s where id > 1", 
tableName)).containsExactly(row(2L), row(3L));
+    assertThat(sql("SELECT id, boolean FROM %s where boolean = true", 
tableName))
+        .containsExactly(row(1L, true), row(3L, true));
+    assertThat(sql("SELECT long FROM %s where long > 1", tableName))
+        .containsExactly(row(2L), row(3L));
+    assertThat(sql("SELECT float FROM %s where float > 1.0", tableName))
+        .containsExactly(row(2.0f), row(3.0f));
+    assertThat(sql("SELECT double FROM %s where double > 1.0", tableName))

Review Comment:
   yeah you're right, that's a good idea



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to