Repository navigation
Conversation
…zed function name Function names are case-insensitive in SQL, but the UDF metric group was named after BridgingSqlFunction#getName. For a temporary system function that is the spelling used at the call site, so calling one function as myUdf(x) and MYUDF(x) produced two groups, each with part of the samples. Use FunctionIdentifier#normalizeName for functions that are resolved by name, at both places that produce a UDF metric name, so every spelling reports under one lower-case group. An inline function is not resolved by name and keeps its generated, class-based name. Only the metric name changes; operator names and plans are unaffected.
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Function names are case-insensitive in SQL, but the UDF metric group (
udf.<udf_name>) was named after the spelling used at the call site. Calling one function asmyUdf(x)andMYUDF(x)in a query produced two groups,udf.myUdfandudf.MYUDF, each with part of the samples, and a dashboard built for one spelling missed the calls made with another. This pull request names the group after the normalized (lower-case) function name, so every spelling reports under one group. UDF metrics are new in 2.4.0, so changing the name now does not affect existing dashboards.Brief change log
BridgingFunctionGenUtil#udfMetricNameOf, which returnsFunctionIdentifier#normalizeNameof the function name for a function resolved by name, and the unchanged generated name for an inline function.BridgingSqlFunctionCallGen(sync scalar and table functions, async scalar functions) and the async table function correlate entry inBridgingFunctionGenUtil.call(new MyUdf(), $("x"))) is not looked up by name, so it cannot be split by spelling. It keeps its class-based name, since lower-casing it would only make the class harder to recognize.Verifying this change
This change added tests and can be verified as follows:
UdfMetricsITCase#testFunctionNameSpellingsShareOneLowerCaseGroup:mixedCaseUdf(id), MIXEDCASEUDF(id)registers exactly one group,udf.mixedcaseudf, which receives the samples of both calls.UdfMetricsITCase#testAsyncTableGroupNameIsLowerCase: an async table function called asASYNCTABLEUDF(id)reports underudf.asynctableudf. This covers the second place that produces a metric name.UdfMetricsITCase#testInlineFunctionKeepsClassBasedGroupName: an inline Table API call keeps its class-based group name.UdfMetricsITCase,AsyncCalcITCaseandAsyncCorrelateITCasepass.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code 2.1.322 (Claude Opus 5.5)