@Test
  public void testSameVarcharLiteralDifferentPrecisionValueOverflow() {

    final RexBuilder rexBuilder = relBuilder.getRexBuilder();
    RelDataType stringType30 = rexBuilder.getTypeFactory().createTypeWithCharsetAndCollation(
            rexBuilder.getTypeFactory().createSqlType(SqlTypeName.VARCHAR, 30),
            Charset.forName(ConversionUtil.NATIVE_UTF16_CHARSET_NAME), SqlCollation.IMPLICIT);
    RexNode lita30 = rexBuilder.makeLiteral(RexNodeExprFactory.makeHiveUnicodeString("AAA111"), stringType30, true);
    RexNode litb30 = rexBuilder.makeLiteral(RexNodeExprFactory.makeHiveUnicodeString("BBB222"), stringType30, true);

    RelDataType stringType4 = rexBuilder.getTypeFactory().createTypeWithCharsetAndCollation(
            rexBuilder.getTypeFactory().createSqlType(SqlTypeName.VARCHAR, 4),
            Charset.forName(ConversionUtil.NATIVE_UTF16_CHARSET_NAME), SqlCollation.IMPLICIT);
    RexNode litaOverflow =
            rexBuilder.makeLiteral(RexNodeExprFactory.makeHiveUnicodeString("AAA111"), stringType4, true);
    RexNode litbOverflow =
            rexBuilder.makeLiteral(RexNodeExprFactory.makeHiveUnicodeString("BBB222"), stringType4, true);

    final RelNode basePlan = relBuilder
          .scan("t")
          .filter(and(relBuilder,
                  relBuilder.call(HiveIn.INSTANCE, relBuilder.field("f2"), lita30, litb30),
                  relBuilder.call(HiveIn.INSTANCE, relBuilder.field("f2"), litaOverflow, litbOverflow)))
          .build();

    planner.setRoot(basePlan);
    RelNode optimizedRelNode = planner.findBestExp();

    HiveFilter filter = (HiveFilter) optimizedRelNode;
    RexNode condition = filter.getCondition();
    System.out.println(condition);
    assertEquals("false", condition.toString());
  }
Despite that extraction happen at a higher level; nested parts should also be handled
ql/src/test/org/apache/hadoop/hive/ql/optimizer/calcite/rules/TestHivePointLookupOptimizerRule.java