Description
In RexUtil.java, we can find the following class that is used to fix an expression to match changes in nullability of input fields, which is specially useful for inner/outer joins:
public static class FixNullabilityShuttle extends RexShuttle { private final List<RelDataType> typeList; private final RexBuilder rexBuilder; public FixNullabilityShuttle(RexBuilder rexBuilder, List<RelDataType> typeList) { this.typeList = typeList; this.rexBuilder = rexBuilder; } @Override public RexNode visitInputRef(RexInputRef ref) { final RelDataType rightType = typeList.get(ref.getIndex()); final RelDataType refType = ref.getType(); if (refType == rightType) { return ref; } final RelDataType refType2 = rexBuilder.getTypeFactory().createTypeWithNullability(refType, rightType.isNullable()); if (refType2 == rightType) { return new RexInputRef(ref.getIndex(), refType2); } throw new AssertionError("mismatched type " + ref + " " + rightType); } }
We are hitting the last assertion error in Hive. The reason seems to be that after adjusting the nullability, refType2 != rightType (which I think makes sense). In particular, it seems that the last if clause should be removed.
Attachments
Issue Links
- blocks
-
HIVE-12186 Upgrade Hive to Calcite 1.5
- Closed