yuqi1129 commented on code in PR #12007:
URL: https://github.com/apache/gravitino/pull/12007#discussion_r3614425793


##########
catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/utils/DorisUtils.java:
##########


Review Comment:
   Thanks — I looked into this carefully, and unfortunately an escape-aware 
regex here actually breaks the round-trip against real Doris.
   
   The key point is what `SHOW CREATE DATABASE` echoes back. Doris does **not** 
re-emit the value with escaped/doubled quotes; it echoes the comment with 
**bare (un-escaped) double quotes**. For example, a comment `owner's "comment" 
C:\tmp; --` comes back as:
   
   ```
   "comment" = "owner's "comment" C:\tmp; --"
   ```
   
   I verified this against the `TestDorisDatabaseOperations` docker IT: 
switching to an escape-aware, non-greedy group made the value truncate at the 
first inner quote (`owner's`), because that group stops at the first bare `"`.
   
   The greedy `"(.*)"..."(.*)"` pattern is what makes this work: it captures 
the value up to the **last** quote on the line, which is exactly right for 
Doris's one-property-per-line, bare-quote output. Because Doris echoes bare 
quotes, the value is inherently ambiguous, and "value = everything up to the 
last quote on this line" is the only sane heuristic.
   
   So the escaping on the write path is still needed (to send valid SQL to 
Doris), but on the read path there is nothing to disambiguate via escaping. The 
only residual limitation is a value that itself contains a literal `"="`, which 
we accept as a known edge case rather than regress the normal round-trip. I 
have reverted the regex change and kept the greedy pattern.



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

Reply via email to