Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.21.0
Description
Problem can be reproduced with the following test (to be added to EnumerablesTest.java):
@Test public void testMergeJoinWithNullKeys() { assertThat( EnumerableDefaults.mergeJoin( Linq4j.asEnumerable( Arrays.asList( new Emp(30, "Fred"), new Emp(20, "Sebastian"), new Emp(30, "Theodore"), new Emp(20, "Theodore"), new Emp(40, null), new Emp(30, null))), Linq4j.asEnumerable( Arrays.asList( new Dept(15, "Marketing"), new Dept(20, "Sales"), new Dept(30, "Theodore"), new Dept(40, null))), e -> e.name, d -> d.name, (v0, v1) -> v0 + ", " + v1, false, false).toList().toString(), equalTo("[Emp(30, Theodore), Dept(30, Theodore)," + " Emp(20, Theodore), Dept(30, Theodore)]")); }
which throws a NPE inside EnumerableDefaults#MergeJoinEnumerator when trying to compare null keys:
java.lang.NullPointerException at java.lang.String.compareTo(String.java:1155) at java.lang.String.compareTo(String.java:111) at org.apache.calcite.linq4j.EnumerableDefaults$MergeJoinEnumerator.advance(EnumerableDefaults.java:3861)
Attachments
Issue Links
- links to