abhishekrb19 commented on code in PR #18966:
URL: https://github.com/apache/druid/pull/18966#discussion_r2762640428


##########
sql/src/main/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCache.java:
##########
@@ -358,10 +358,34 @@ private Map<String, PhysicalDatasourceMetadata> 
queryDataSourceInformation(Set<S
   private void updateDSMetadata(String dataSource, PhysicalDatasourceMetadata 
physicalDatasourceMetadata)
   {
     final PhysicalDatasourceMetadata oldTable = tables.put(dataSource, 
physicalDatasourceMetadata);
-    if (oldTable == null || 
!oldTable.getRowSignature().equals(physicalDatasourceMetadata.getRowSignature()))
 {
-      log.info("[%s] has new signature: %s.", dataSource, 
physicalDatasourceMetadata.getRowSignature());
+    final RowSignature newRowSignature = 
physicalDatasourceMetadata.getRowSignature();
+    final int newColumnCount = newRowSignature.getColumnNames().size();
+
+    final ServiceMetricEvent.Builder builder =
+        new ServiceMetricEvent.Builder().setDimension(DruidMetrics.DATASOURCE, 
dataSource);
+
+    if (oldTable == null) {
+      log.info(
+          "Row signature for datasource[%s] initialized with [%d] columns - 
signature[%s]",
+          dataSource, newColumnCount, newRowSignature
+      );
+
+      emitMetric(Metric.SCHEMA_ROW_SIGNATURE_INITIALIZED, 1, builder);

Review Comment:
   Right, I mainly added the `SCHEMA_ROW_SIGNATURE_INITIALIZED` metric to 
differentiate between the different code paths. I've removed it for now as you 
note the updated logs and the signature update metric should provide better 
insights.



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