private static boolean compatibleSchema(TableScanOperator tsOp1, TableScanOperator tsOp2) {
    return Objects.equals(tsOp1.getNeededColumns(), tsOp2.getNeededColumns())
        && Objects.equals(tsOp1.getNeededColumnIDs(), tsOp2.getNeededColumnIDs())
        && Objects.equals(tsOp1.getConf().getVirtualCols(), tsOp2.getConf().getVirtualCols());
  }
Class wrapping shared work optimizer.
This implementation enables merging of TS with different schemas by taking the union of the
{@link TableScanDesc#getNeededColumns()} and {@link TableScanDesc#getNeededColumnIDs()}
from both {@link TableScanOperator}s.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java