A Filter containing an IN clause is not passed to Enumerable.scan.
I'm using the Calcite JDBC driver with an own SchemaFactory (defined by a model property) that provides a schema containing a ProjectableFilterableTable:
It maps to a Java class and provides two Integer typed columns "value1" and "value2".
The following query leads to a quite expensive behavior in the scan method if the following statement is executed:
The scan method is invoked with a filter that only covers the part "value1" = 1, the IN clause is completely omitted. The result on the JDBC side is still valid but in my case this still leads to a full scan of a large underlying data set (millions of rows).
Interestingly the filter part reflecting the IN operator is provided if the number of elements in the list is below 20. It seems that this is controlled by org.apache.calcite.sql2rel.SqlToRelConverter.Config#getInSubQueryThreshold. It would at be very helpful if this behavior could be confgiured on the JDBC property level.