Copilot commented on code in PR #12007:
URL: https://github.com/apache/gravitino/pull/12007#discussion_r3602589559
##########
catalogs/catalog-jdbc-doris/src/test/java/org/apache/gravitino/catalog/doris/utils/TestDorisUtils.java:
##########
@@ -92,6 +97,12 @@ public void testExtractTablePropertiesFromSql() {
result = DorisUtils.extractPropertiesFromSql(createTableSql);
assertEquals("value1", result.get("property1"));
assertEquals("comment", result.get("comment"));
+
+ createTableSql =
+ "CREATE DATABASE `test`\nPROPERTIES (\n"
+ + "\"key\"name\" = \"owner's \"comment\" D:\\data; --\"\n)";
+ result = DorisUtils.extractPropertiesFromSql(createTableSql);
+ assertEquals("owner's \"comment\" D:\\data; --", result.get("key\"name"));
Review Comment:
This `createTableSql` snippet doesn’t compile as Java: the embedded double
quotes in the SQL are not escaped. Also, once the string literal is corrected,
`DorisUtils.extractPropertiesFromSql` currently returns the raw captured text
(it does not unescape doubled quotes/backslashes), so the lookup key `key"name`
/ expected value `owner's "comment" ...` won’t match an escaped SHOW CREATE
output. Consider (a) fixing the Java escaping here and (b) updating
`extractPropertiesFromSql` to unescape Doris string-literal escaping so callers
(and this test) observe the original key/value text.
--
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]