[CALCITE-397] "SELECT DISTINCT *" on reflective schema gives ClassCastException at runtime