calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Risden <>
Subject Simplifying literal comparison literal
Date Sun, 19 Feb 2017 22:03:38 GMT
While working on Solr and Calcite integration, I found that there is a case
where some tools issue a sql query like "where 1 = 0" just to get metadata
information back. Spark SQL is one of the ones that does this.

Calcite doesn't seem to optimize away the literal comparison literal case
with RexUtil.simplify. In my understanding any literal comparison literal
results in a simple TRUE/FALSE result.

I'm not sure this is valid in the general case, but I put together a simple
example of doing this on the RexUtil simplifyCall.

I would love to hear any feedback related to this. I need to run through
the full Calcite test suite, but wondering if this is even viable.


Kevin Risden

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message