Vallishp commented on code in PR #40153: URL: https://github.com/apache/doris/pull/40153#discussion_r1740097679
########## fe/fe-core/src/main/java/org/apache/doris/tablefunction/MetadataGenerator.java: ########## @@ -1250,4 +1266,110 @@ private static TFetchSchemaTableDataResult tablePropertiesMetadataResult(TSchema result.setStatus(new TStatus(TStatusCode.OK)); return result; } + + private static void partitionsForInternalCatalog(UserIdentity currentUserIdentity, + CatalogIf catalog, DatabaseIf database, List<TableIf> tables, List<TRow> dataBatch) { + for (TableIf table : tables) { + if (!(table instanceof OlapTable)) { + continue; + } + if (!Env.getCurrentEnv().getAccessManager().checkTblPriv(currentUserIdentity, catalog.getName(), + database.getFullName(), table.getName(), PrivPredicate.SHOW)) { + continue; + } + + OlapTable olapTable = (OlapTable) table; + Collection<Partition> allPartitions = olapTable.getAllPartitions(); + + for (Partition partition : allPartitions) { + TRow trow = new TRow(); + trow.addToColumnValue(new TCell().setStringVal(catalog.getName())); // TABLE_CATALOG + trow.addToColumnValue(new TCell().setStringVal(database.getFullName())); // TABLE_SCHEMA + trow.addToColumnValue(new TCell().setStringVal(table.getName())); // TABLE_NAME + trow.addToColumnValue(new TCell().setStringVal(partition.getName())); // PARTITION_NAME + trow.addToColumnValue(new TCell().setStringVal("")); // SUBPARTITION_NAME (not available) + + trow.addToColumnValue(new TCell().setIntVal(0)); //PARTITION_ORDINAL_POSITION (not available) + trow.addToColumnValue(new TCell().setIntVal(0)); //SUBPARTITION_ORDINAL_POSITION (not available) + trow.addToColumnValue(new TCell().setStringVal( + olapTable.getPartitionInfo().getType().toString())); // PARTITION_METHOD + trow.addToColumnValue(new TCell().setStringVal("")); // SUBPARTITION_METHOD + ArrayList<Expr> expr = olapTable.getPartitionInfo().getPartitionExprs(); + String partExpr = (expr != null) ? olapTable.getPartitionInfo().getPartitionExprs().toString() : ""; + + trow.addToColumnValue(new TCell().setStringVal(partExpr)); // PARTITION_EXPRESSION (not available) + trow.addToColumnValue(new TCell().setStringVal("")); // SUBPARTITION_EXPRESSION (not available) + trow.addToColumnValue(new TCell().setStringVal( + olapTable.getPartitionInfo().getPartitionRangeString(partition.getId()))); Review Comment: description is similar to mysql but since we support multiple partition column, still will come as a expression in the patition description. eg: [('4'), ('6')) -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org