Y-Wakuta commented on code in PR #4281:
URL: https://github.com/apache/polaris/pull/4281#discussion_r3354022433
##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/QueryGenerator.java:
##########
@@ -335,7 +336,11 @@ static QueryFragment generateWhereClauseExtended(
List<String> conditions = new ArrayList<>();
List<Object> parameters = new ArrayList<>();
for (Map.Entry<String, Object> entry : whereEquals.entrySet()) {
- conditions.add(entry.getKey() + " = ?");
+ if (entry.getValue() instanceof Converter.MysqlJsonValue) {
+ conditions.add(entry.getKey() + " = CAST(? AS JSON)");
Review Comment:
Thank you, this was a great suggestion. I followed it: added
DatabaseType.asJsonConditionPlaceholder() ("?" for Postgres/H2/Cockroach,
"CAST(? AS JSON)" for MySQL) and a ModelRegistry.isJsonColumn(table, column)
helper, so the instanceof is gone from the call path. As you predicted,
MysqlJsonValue became unnecessary and has been removed.
--
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]