Y-Wakuta commented on code in PR #4281:
URL: https://github.com/apache/polaris/pull/4281#discussion_r3214651253
##########
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:
In `JdbcBasePersistenceImpl.deleteFromPolicyMappingRecords` — the delete's
WHERE is built from `ModelPolicyMappingRecord.toMap()`, which includes the
`properties` JSON column. Without `CAST(? AS JSON)` the bound VARCHAR doesn't
match the JSON column under MySQL's comparison rules, so the delete predicate
never matched after a policy detach; this was the actual cause of
`MysqlPolicyServiceIT.testPolicyMapping` failing.
--
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]