github-actions[bot] commented on code in PR #60871:
URL: https://github.com/apache/doris/pull/60871#discussion_r3321849155


##########
fe/fe-core/src/main/java/org/apache/doris/common/proc/PartitionsProcDir.java:
##########
@@ -600,7 +610,8 @@ private List<Pair<List<Comparable>, TRow>> 
getPartitionInfosInrernal() throws An
                 partitionInfo.add(isInMemory);
                 trow.addToColumnValue(new TCell().setBoolVal(isInMemory));
                 // replica allocation
-                String replica = 
tblPartitionInfo.getReplicaAllocation(partitionId).toCreateStmt();
+                String replica = getReplicaAllocationDisplay(

Review Comment:
   This helper output is also used to populate the `TRow` returned by 
`getPartitionInfosForTvf()`, but the BE `MetaScanner` only produces SQL NULL 
when `TCell.isNull` is set (`be/src/exec/scan/meta_scanner.cpp` checks 
`cell.__isset.isNull && cell.isNull`). `FeConstants.null_string` is converted 
to NULL only by the FE SHOW `ResultSet` serialization path, so in cloud mode 
`select ReplicaAllocation from partitions(...)` will return the literal `\N` 
string instead of NULL. Please keep the SHOW row representation separate from 
the TVF `TCell` representation, e.g. add `FeConstants.null_string` to 
`partitionInfo` for SHOW but set `new TCell().setIsNull(true)` for the TVF cell 
in cloud mode.



##########
fe/fe-core/src/main/java/org/apache/doris/tablefunction/MetadataGenerator.java:
##########
@@ -1922,15 +1922,17 @@ private static void 
partitionsForInternalCatalog(UserIdentity currentUserIdentit
                             + sizePair.second;
                     trow.addToColumnValue(new 
TCell().setStringVal(readableDateSize)); // REMOTE_DATA_SIZE
                     trow.addToColumnValue(new 
TCell().setStringVal(partition.getState().toString())); // STATE
-                    trow.addToColumnValue(new 
TCell().setStringVal(partitionInfo.getReplicaAllocation(partitionId)
-                            .toCreateStmt())); // REPLICA_ALLOCATION
+                    String replicaAllocation = 
PartitionsProcDir.getReplicaAllocationDisplay(
+                            
partitionInfo.getReplicaAllocation(partitionId).toCreateStmt());
+                    trow.addToColumnValue(new 
TCell().setStringVal(replicaAllocation)); // REPLICA_ALLOCATION

Review Comment:
   For `information_schema.partitions`, this `TCell` is consumed by 
`SchemaPartitionsScanner::insert_block_column`, which ignores both 
`FeConstants.null_string` and `TCell.isNull` and always appends 
`cell.stringVal` with a non-null nullmap 
(`be/src/information_schema/schema_scanner.cpp:473-532`). Therefore cloud 
queries of `information_schema.partitions.REPLICA_ALLOCATION` will see a 
literal `\N` value, not SQL NULL (and not the existing `"NULL"` convention used 
by other unavailable columns in this method). Please either preserve the 
existing information_schema string convention here or update the BE schema 
scanner to honor `TCell.isNull` before setting this field to a null sentinel.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to