private static Expression convertSparkExpressionToIceberg(
      net.sf.jsqlparser.expression.Expression whereExpr, List<Types.NestedField> tableColumns) {
    if (whereExpr instanceof IsNullExpression) {
      IsNullExpression isNull = (IsNullExpression) whereExpr;
      Types.NestedField column = getColumn(isNull.getLeftExpression(), tableColumns);
      return isNull.isNot()
          ? Expressions.notNull(column.name())
          : Expressions.isNull(column.name());
    } else if (whereExpr instanceof EqualsTo) {
      EqualsTo eq = (EqualsTo) whereExpr;
      Types.NestedField column = getColumn(eq.getLeftExpression(), tableColumns);
      return Expressions.equal(column.name(), getValue(eq.getRightExpression(), column));
    } else if (whereExpr instanceof NotEqualsTo) {
      NotEqualsTo ne = (NotEqualsTo) whereExpr;
      Types.NestedField column = getColumn(ne.getLeftExpression(), tableColumns);
      return Expressions.notEqual(column.name(), getValue(ne.getRightExpression(), column));
    } else if (whereExpr instanceof GreaterThan) {
      GreaterThan gt = (GreaterThan) whereExpr;
      Types.NestedField column = getColumn(gt.getLeftExpression(), tableColumns);
      return Expressions.greaterThan(column.name(), getValue(gt.getRightExpression(), column));
    } else if (whereExpr instanceof GreaterThanEquals) {
      GreaterThanEquals ge = (GreaterThanEquals) whereExpr;
      Types.NestedField column = getColumn(ge.getLeftExpression(), tableColumns);
      return Expressions.greaterThanOrEqual(
          column.name(), getValue(ge.getRightExpression(), column));
    } else if (whereExpr instanceof MinorThan) {
      MinorThan lt = (MinorThan) whereExpr;
      Types.NestedField column = getColumn(lt.getLeftExpression(), tableColumns);
      return Expressions.lessThan(column.name(), getValue(lt.getRightExpression(), column));
    } else if (whereExpr instanceof MinorThanEquals) {
      MinorThanEquals le = (MinorThanEquals) whereExpr;
      Types.NestedField column = getColumn(le.getLeftExpression(), tableColumns);
      return Expressions.lessThanOrEqual(column.name(), getValue(le.getRightExpression(), column));
    } else if (whereExpr instanceof InExpression) {
      InExpression in = (InExpression) whereExpr;
      Types.NestedField column = getColumn(in.getLeftExpression(), tableColumns);
      net.sf.jsqlparser.expression.Expression rightExpr = in.getRightExpression();
      List<Object> values = new ArrayList<>();
      if (rightExpr instanceof ExpressionList) {
        for (net.sf.jsqlparser.expression.Expression expr : ((ExpressionList<?>) rightExpr)) {
          values.add(getValue(expr, column));
        }
      } else {
        throw new UnsupportedOperationException("Subquery IN not supported");
      }
      return in.isNot()
          ? Expressions.notIn(column.name(), values)
          : Expressions.in(column.name(), values);
    } else if (whereExpr instanceof NotExpression) {
      NotExpression not = (NotExpression) whereExpr;
      return Expressions.not(convertSparkExpressionToIceberg(not.getExpression(), tableColumns));
    } else if (whereExpr instanceof AndExpression) {
      AndExpression and = (AndExpression) whereExpr;
      return Expressions.and(
          convertSparkExpressionToIceberg(and.getLeftExpression(), tableColumns),
          convertSparkExpressionToIceberg(and.getRightExpression(), tableColumns));
    } else if (whereExpr instanceof OrExpression) {
      OrExpression or = (OrExpression) whereExpr;
      return Expressions.or(
          convertSparkExpressionToIceberg(or.getLeftExpression(), tableColumns),
          convertSparkExpressionToIceberg(or.getRightExpression(), tableColumns));
    }
    throw new UnsupportedOperationException("Unsupported expression: " + whereExpr);
  }
Convert SQL filter to Iceberg {@link Expression}.

@param sqlFilter the SQL filter
@param tableColumns the list of table columns
@return the Iceberg {@link Expression}
amoro-format-iceberg/src/main/java/org/apache/amoro/utils/ExpressionUtil.java