public TrimResult trimFields(
      final JdbcFilter jdbcFilter,
      ImmutableBitSet fieldsUsed,
      Set<RelDataTypeField> extraFields) {

    TrimResult trimResult = trimFields((Filter) jdbcFilter, fieldsUsed, extraFields);
    RelNode newInput = trimResult.left;
    final Mapping inputMapping = trimResult.right;

    if (newInput instanceof JdbcFilter) {
      return trimResult;
    }

    if (newInput instanceof Filter) {
      JdbcFilter newFilter = 
          (JdbcFilter) JdbcFilterRule.create((JdbcConvention) jdbcFilter.getConvention()).convert(newInput);
      return result(newFilter, inputMapping);
    }

    return trimFields((RelNode) jdbcFilter, fieldsUsed, extraFields);
  }
Creates a project with a dummy column, to protect the parts of the system
that cannot handle a relational expression with no columns.

@param fieldCount Number of fields in the original relational expression
@param input Trimmed input
@return Dummy project, or null if no dummy is required
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/RelFieldTrimmer.java