Skip to content

Conversation

@Young-Leo
Copy link
Contributor

This fixes a table-model issue where NULL-related predicates fail only
when the table has no TAG columns, while the same predicates work when
TAG columns exist.

Repro (table model)

Table without TAG (used to fail)

CREATE TABLE test_table_no_tag(
  id INT32 FIELD,
  name STRING FIELD,
  value DOUBLE FIELD
);

SELECT * FROM test_table_no_tag WHERE name = null;

Table with TAG (used to work)

CREATE TABLE test_table_with_tag(
  id STRING TAG,
  name STRING FIELD,
  value DOUBLE FIELD
);

SELECT * FROM test_table_with_tag WHERE name = null;

Fix

Handle casted NULL predicates across predicate visitors so the no-TAG
path no longer fails.

Comment on lines +376 to +382
@Override
protected Filter visitCast(Cast node, Context context) {
if (node.getExpression() instanceof NullLiteral) {
return new FalseLiteralFilter();
}
return process(node.getExpression(), context);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not right, what if I write CAST(NULL AS BOOLEAM) IS NULL ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants