Copilot commented on code in PR #11732:
URL: https://github.com/apache/gravitino/pull/11732#discussion_r3550338869


##########
catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/utils/DorisUtils.java:
##########
@@ -45,7 +45,7 @@
 public final class DorisUtils {
   private static final Logger LOGGER = 
LoggerFactory.getLogger(DorisUtils.class);
   private static final Pattern PARTITION_INFO_PATTERN =
-      Pattern.compile("PARTITION BY \\b(LIST|RANGE)\\b\\((.+)\\)");
+      Pattern.compile("PARTITION BY \\b(LIST|RANGE)\\b\\s*\\((.+)\\)");
 

Review Comment:
   The regex change to tolerate whitespace after LIST/RANGE ("...\\b\\s*\\(") 
is not covered by the existing unit tests. 
`TestDorisUtils.testExtractPartitionInfoFromSql()` only exercises `PARTITION BY 
LIST(` / `RANGE(` without the Doris 3.0+ whitespace (`LIST (` / `RANGE (`), so 
a regression here would go unnoticed without the ITs.



##########
catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/utils/DorisUtils.java:
##########
@@ -45,7 +45,7 @@
 public final class DorisUtils {
   private static final Logger LOGGER = 
LoggerFactory.getLogger(DorisUtils.class);
   private static final Pattern PARTITION_INFO_PATTERN =
-      Pattern.compile("PARTITION BY \\b(LIST|RANGE)\\b\\((.+)\\)");
+      Pattern.compile("PARTITION BY \\b(LIST|RANGE)\\b\\s*\\((.+)\\)");
 

Review Comment:
   The PR description lists additional partition-parsing changes 
(comma/whitespace-tolerant column splitting, backtick stripping, and 
multi-column LIST value parsing), but in the current code the only change in 
`DorisUtils` is the `\\s*` tweak in `PARTITION_INFO_PATTERN`. If those other 
fixes are out of scope for this PR, the description should be trimmed to avoid 
overstating what was delivered; otherwise, the missing parsing changes need to 
be included.



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