|
108 | 108 |
|
109 | 109 | import static com.facebook.airlift.concurrent.MoreFutures.toListenableFuture;
|
110 | 110 | import static com.facebook.presto.SystemSessionProperties.isIgnoreStatsCalculatorFailures;
|
| 111 | +import static com.facebook.presto.common.RuntimeMetricName.GET_IDENTIFIER_NORMALIZATION_TIME_NANOS; |
111 | 112 | import static com.facebook.presto.common.RuntimeMetricName.GET_LAYOUT_TIME_NANOS;
|
112 | 113 | import static com.facebook.presto.common.RuntimeMetricName.GET_MATERIALIZED_VIEW_STATUS_TIME_NANOS;
|
113 | 114 | import static com.facebook.presto.common.RuntimeUnit.NANO;
|
@@ -1491,13 +1492,18 @@ public void addConstraint(Session session, TableHandle tableHandle, TableConstra
|
1491 | 1492 | @Override
|
1492 | 1493 | public String normalizeIdentifier(Session session, String catalogName, String identifier)
|
1493 | 1494 | {
|
| 1495 | + long startTime = System.nanoTime(); |
| 1496 | + String normalizedString = identifier.toLowerCase(ENGLISH); |
1494 | 1497 | Optional<CatalogMetadata> catalogMetadata = getOptionalCatalogMetadata(session, transactionManager, catalogName);
|
1495 | 1498 | if (catalogMetadata.isPresent()) {
|
1496 | 1499 | ConnectorId connectorId = catalogMetadata.get().getConnectorId();
|
1497 | 1500 | ConnectorMetadata metadata = catalogMetadata.get().getMetadataFor(connectorId);
|
1498 |
| - return metadata.normalizeIdentifier(session.toConnectorSession(connectorId), identifier); |
| 1501 | + normalizedString = metadata.normalizeIdentifier(session.toConnectorSession(connectorId), identifier); |
| 1502 | + session.getRuntimeStats().addMetricValue(GET_IDENTIFIER_NORMALIZATION_TIME_NANOS, NANO, System.nanoTime() - startTime); |
| 1503 | + return normalizedString; |
1499 | 1504 | }
|
1500 |
| - return identifier.toLowerCase(ENGLISH); |
| 1505 | + session.getRuntimeStats().addMetricValue(GET_IDENTIFIER_NORMALIZATION_TIME_NANOS, NANO, System.nanoTime() - startTime); |
| 1506 | + return normalizedString; |
1501 | 1507 | }
|
1502 | 1508 |
|
1503 | 1509 | private ViewDefinition deserializeView(String data)
|
|
0 commit comments