czy006 commented on code in PR #3426:
URL: https://github.com/apache/amoro/pull/3426#discussion_r1982917411
##########
amoro-format-iceberg/src/main/java/org/apache/amoro/table/TableProperties.java:
##########
@@ -115,6 +115,9 @@ private TableProperties() {}
"self-optimizing.full.rewrite-all-files";
public static final boolean SELF_OPTIMIZING_FULL_REWRITE_ALL_FILES_DEFAULT =
true;
+ public static final String SELF_OPTIMIZING_FILTER = "self-optimizing.filter";
+ public static final String SELF_OPTIMIZING_FILTER_DEFAULT = null;
Review Comment:
If it is set to null here, is it possible that NPE may occur during
subsequent verification? Can we use **""** instead?
##########
amoro-format-iceberg/src/main/java/org/apache/amoro/utils/ExpressionUtil.java:
##########
@@ -79,4 +108,169 @@ public static Expression convertPartitionDataToDataFilter(
}
return filter;
}
+
+ /**
+ * Convert SQL filter to Iceberg {@link Expression}.
+ *
+ * @param sqlFilter the SQL filter
+ * @param tableColumns the list of table columns
+ * @return the Iceberg {@link Expression}
+ */
+ public static Expression convertSqlFilterToIcebergExpression(
+ String sqlFilter, List<Types.NestedField> tableColumns) {
+ if (sqlFilter == null) {
+ return Expressions.alwaysTrue();
+ }
+
+ try {
+ Select statement = (Select) CCJSqlParserUtil.parse("SELECT * FROM dummy
WHERE " + sqlFilter);
Review Comment:
Why do we need fixation here? **SELECT * FROM dummy**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]