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


##########
catalogs-contrib/catalog-jdbc-clickhouse/src/main/java/org/apache/gravitino/catalog/clickhouse/operations/ClickHouseTableSqlUtils.java:
##########
@@ -178,49 +185,30 @@ private static String 
normalizeShardingKeyExpression(String expression) {
     return normalizeIndexExpression(current);
   }
 
-  private static Transform parsePartitionExpression(
-      String expression, String originalPartitionKey) {
+  @Nullable
+  private static Transform parsePartitionExpression(String expression) {
     String trimmedExpression = StringUtils.trim(expression);
 
     Matcher toYearMatcher = TO_YEAR_PATTERN.matcher(trimmedExpression);
     if (toYearMatcher.matches()) {
       String identifier = normalizeIdentifier(toYearMatcher.group(1));
-      Preconditions.checkArgument(
-          StringUtils.isNotBlank(identifier),
-          "Unsupported partition expression: " + originalPartitionKey);
-      return Transforms.year(identifier);
+      return isStrictIdentifier(identifier) ? Transforms.year(identifier) : 
null;

Review Comment:
   `isStrictIdentifier` will fail in the case "PARTITION BY 
toYYYYMM(`event-time`)" as it will move all back quote "`".



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