Description
When RelNode is having `NOT IN` operator, it's being converted incorrectly by RelToSqlConverter. For example
@Test public void testNotInOperator() { final RelBuilder builder = relBuilder().scan("EMP"); final RexNode condition = builder.call(SqlStdOperatorTable.NOT_IN, builder.field("DEPTNO"), builder.literal(20), builder.literal(30)); final RelNode root = relBuilder().scan("EMP").filter(condition).build(); final String sql = toSql(root); final String expectedSql = "SELECT *\n" + "FROM \"scott\".\"EMP\"\n" + "WHERE \"DEPTNO\" NOT IN (20, 30)"; assertThat(sql, isLinux(expectedSql)); }
Above test fails with error:
Expected: is "SELECT *\nFROM \"scott\".\"EMP\"\nWHERE \"DEPTNO\" NOT IN (20, 30)" but: was "SELECT *\nFROM \"scott\".\"EMP\"\nWHERE \"DEPTNO\" NOT IN 20 NOT IN 30"