DRILL-1631: Bump optiq version to r7
Add test case. Fix is in optiq.
DRILL-1663: Fix casting to a variable width type implicitly in a join condition

Factor out logic in ExpressionTreeMaterializer so the same logic can be reused in ChainedHashTable.