kfaraz commented on code in PR #18547:
URL: https://github.com/apache/druid/pull/18547#discussion_r2370970509
##########
sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:
##########
@@ -687,18 +704,24 @@ private static Object[] buildRowForDiscoverableDataServer(
} else {
currentSize = serverFromInventoryView.getCurrSize();
}
- return new Object[]{
- node.getHostAndPortToUse(),
- node.getHost(),
- (long) node.getPlaintextPort(),
- (long) node.getTlsPort(),
- StringUtils.toLowerCase(discoveryDruidNode.getNodeRole().toString()),
- druidServerToUse.getTier(),
- currentSize,
- druidServerToUse.getMaxSize(),
- null,
- toStringOrNull(discoveryDruidNode.getStartTime())
- };
+ try {
+ return new Object[]{
+ node.getHostAndPortToUse(),
+ node.getHost(),
+ (long) node.getPlaintextPort(),
+ (long) node.getTlsPort(),
+
StringUtils.toLowerCase(discoveryDruidNode.getNodeRole().toString()),
+ druidServerToUse.getTier(),
+ currentSize,
+ druidServerToUse.getMaxSize(),
+ null,
+ toStringOrNull(discoveryDruidNode.getStartTime()),
+ node.getLabels() == null ? null :
jsonMapper.writeValueAsString(node.getLabels())
Review Comment:
Yeah, we can stick to plain JSON since several other system tables are
already returning full objects.
For example, `sys.segments` table:
https://github.com/apache/druid/blob/95de4c4b1ea134e32f322efb0e63f1112a64b5ab/sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java#L363-L367
--
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]