PreparedStatement for query
is created with wrong types (nullable INTEGER) for all selected columns, no matter what their actual type is. This behavior reproduces with hash join only and is very likely to be caused by
DRILL-6027 as the query works fine before this feature was implemented.
To reproduce the problem you can put the aforementioned query into TestPreparedStatementProvider#joinOrderByQuery() test method.