private boolean canBePushed(Set<Integer> inputRefs, HiveTableFunctionScan tfs) {
    Set<RelColumnMapping> columnMappings = tfs.getColumnMappings();
    if (inputRefs.isEmpty()) {
      return true;
    }

    if (CollectionUtils.isEmpty(columnMappings)) {
      return false;
    }

    for (Integer inputRef : inputRefs) {
      if (!tfs.containsInputRefMapping(inputRef)) {
        return false;
      }
    }
    return true;
  }
Rule to transpose Filter and TableFunctionScan RelNodes

We cannot use Calcite's FilterTableFunctionTransposeRule because that rule
uses LogicalFilter and LogicalTableFunctionScan.  We should remove this
class when CALCITE-5985 is fixed (and remove the CALCITE_5985_FIXED entry
in Bug.java)
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterTableFunctionTransposeRule.java