dimas-b commented on code in PR #1824:
URL: https://github.com/apache/polaris/pull/1824#discussion_r2138590961


##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java:
##########
@@ -329,25 +307,13 @@ public PolarisBaseEntity lookupEntityByName(
       long parentId,
       int typeCode,
       @Nonnull String name) {
-    Map<String, Object> params =
-        Map.of(
-            "catalog_id",
-            catalogId,
-            "parent_id",
-            parentId,
-            "type_code",
-            typeCode,
-            "name",
-            name,
-            "realm_id",
-            realmId);
+    List<Object> params = List.of(catalogId, parentId, typeCode, name, 
realmId);
     return getPolarisBaseEntity(
-        QueryGenerator.generateSelectQuery(
-            ModelEntity.ALL_COLUMNS, ModelEntity.TABLE_NAME, params));
+        new PreparedQuery(SQLConstants.ENTITY_LOOKUP_BY_NAME_QUERY, params));

Review Comment:
   I'd prefer to keep this SQL constant and parameter bindings closer to each 
other to make it easier to maintain the SQL without breaking the binding.
   
   For example: `SQLConstants.entityLookupByName(catalogId, parentId, typeCode, 
name, realmId)`
   
   WDYT?



-- 
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