diqiu50 commented on code in PR #12120:
URL: https://github.com/apache/gravitino/pull/12120#discussion_r3636255390


##########
catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/operation/DorisTableOperations.java:
##########
@@ -633,7 +635,32 @@ protected Transform[] getTablePartitioning(
       }
       Optional<Transform> transform =
           DorisUtils.extractPartitionInfoFromSql(createTableSql.toString());
-      return transform.map(t -> new Transform[] 
{t}).orElse(Transforms.EMPTY_TRANSFORM);
+      if (!transform.isPresent()) {
+        return Transforms.EMPTY_TRANSFORM;
+      }
+
+      Transform partitioning = transform.get();
+      Map<String, Type> columnTypes =
+          DorisTablePartitionOperations.getColumnTypes(connection, tableName, 
typeConverter);
+      String showPartitionsSql = String.format("SHOW PARTITIONS FROM `%s`", 
tableName);
+      List<Partition> assignments =
+          DorisTablePartitionOperations.loadPartitions(
+              connection, showPartitionsSql, partitioning, columnTypes);

Review Comment:
   Table loading will fail if loadPartition throws an exception, for example, 
for tables with multi-column range partitions.
   
   Why do we load all partitions when loading a table? This can be expensive 
for tables with a large number of partitions.



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