public static RexNode fixNullability(final RexBuilder rexBuilder,
      RexNode node, final List<RelDataType> fieldTypes) {
    return new FixNullabilityShuttle(rexBuilder, fieldTypes).apply(node);
  }
Fixes up the type of all {@link RexInputRef}s in an
expression to match differences in nullability.

<p>Throws if there any greater inconsistencies of type.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveCalciteUtil.java