chamikaramj commented on code in PR #35230: URL: https://github.com/apache/beam/pull/35230#discussion_r2139395768
########## sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/FilterUtils.java: ########## @@ -72,6 +74,56 @@ class FilterUtils { .put(SqlKind.OR, Operation.OR) .build(); + /** + * Parses a SQL filter expression string and returns a set of all field names referenced within + * it. + */ + static Set<String> getReferencedFieldNames(@Nullable String filter) { + if (filter == null || filter.trim().isEmpty()) { + return new HashSet<>(); + } + + SqlParser parser = SqlParser.create(filter); + try { + SqlNode expression = parser.parseExpression(); + Set<String> fieldNames = new HashSet<>(); + extractFieldNames(expression, fieldNames); + System.out.println("xxx fields in filter: " + fieldNames); Review Comment: Pls delete debug line. -- 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: github-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org