public static List<RexNode> rewriteToDateChildren(List<RexNode> childRexNodeLst, RexBuilder rexBuilder) {
    List<RexNode> newChildRexNodeLst = new ArrayList<>();
    assert childRexNodeLst.size() == 1;
    RexNode child = childRexNodeLst.get(0);
    if (SqlTypeUtil.isDatetime(child.getType()) || SqlTypeUtil.isInterval(child.getType())) {
      newChildRexNodeLst.add(child);
    } else {
      newChildRexNodeLst.add(makeCast(SqlTypeName.TIMESTAMP, child, rexBuilder));
    }
    return newChildRexNodeLst;
  }
Adds explicit casts if Calcite's type system could not resolve the CASE branches to a common type.

Calcite is more stricter than hive w.r.t type conversions.
If a CASE has branches with string/int/boolean branch types; there is no common type.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/RexNodeConverter.java