eric-maynard commented on code in PR #1802:
URL: https://github.com/apache/polaris/pull/1802#discussion_r2126890221


##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/QueryGenerator.java:
##########
@@ -37,35 +40,51 @@
 
 public class QueryGenerator {
 
-  public static <T> String generateSelectQuery(
+  public static class PreparedQuery {
+    private final String sql;
+    private final List<Object> parameters;
+
+    public PreparedQuery(String sql, List<Object> parameters) {
+      this.sql = sql;
+      this.parameters = parameters;
+    }
+
+    public String getSql() {
+      return sql;
+    }
+
+    public List<Object> getParameters() {
+      return parameters;
+    }
+  }
+
+  public static <T> PreparedQuery generateSelectQuery(
       @Nonnull Converter<T> entity, @Nonnull Map<String, Object> whereClause) {

Review Comment:
   This looks quite bizarre to me, as it essentially fragments the 
responsibility for query generation all throughout a bunch of classes. This 
naturally leads to quite a bit of repeated code, as well as additional burden 
on anybody who wants to create a new model or a new query pattern. 
   
   This could be a valid future improvement, but is it necessary to achieve the 
stated goal of this PR? If not, I'd rather we separate that effort out so we 
can evaluate it on its own merits rather than having it block a migration away 
from building queries from raw strings.



-- 
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: issues-unsubscr...@polaris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to