@SuppressWarnings("Duplicates") private static ExprNodeDesc getColumnExpr(ExprNodeDesc expr) {
    if (expr instanceof ExprNodeColumnDesc) {
      return expr;
    }
    ExprNodeGenericFuncDesc funcDesc = null;
    if (expr instanceof ExprNodeGenericFuncDesc) {
      funcDesc = (ExprNodeGenericFuncDesc) expr;
    }
    if (null == funcDesc) {
      return expr;
    }
    GenericUDF udf = funcDesc.getGenericUDF();
    // check if its a simple cast expression.
    if ((udf instanceof GenericUDFBridge
        || udf instanceof GenericUDFToBinary
        || udf instanceof GenericUDFToChar
        || udf instanceof GenericUDFToVarchar
        || udf instanceof GenericUDFToDecimal
        || udf instanceof GenericUDFToDate
        || udf instanceof GenericUDFToUnixTimeStamp
        || udf instanceof GenericUDFToUtcTimestamp) && funcDesc.getChildren().size() == 1 && funcDesc.getChildren()
        .get(0) instanceof ExprNodeColumnDesc) {
      return expr.getChildren().get(0);
    }
    return expr;
  }
@param expr And expression to be parsed

@return either full scan or an optimized sub scan.
kafka-handler/src/java/org/apache/hadoop/hive/kafka/KafkaScanTrimmer.java