Description
When we create local indexes on functions then while joining back missing columns from data table is generating wrong data row key.
When we generated index row key schema we are initializing isNullableToBe to true always even if the expression might be not null. Because of this we might change the column type to other castable one and may consider actual data as separator bytes.
... if (indexField == null) { Expression e = expressionItr.next(); isNullableToBe = true; dataTypeToBe = IndexUtil.getIndexColumnDataType(isNullableToBe, e.getDataType()); sortOrderToBe = descIndexColumnBitSet.get(i) ? SortOrder.DESC : SortOrder.ASC; maxLengthToBe = e.getMaxLength(); scaleToBe = e.getScale(); ...