github-advanced-security[bot] commented on code in PR #19548:
URL: https://github.com/apache/druid/pull/19548#discussion_r3374164214
##########
processing/src/main/java/org/apache/druid/query/dimension/DimensionSpec.java:
##########
@@ -58,6 +58,22 @@
@Nullable
ExtractionFn getExtractionFn();
+ /**
+ * Returns an {@link ExtractionFn} to be used only for inspecting extraction
metadata, such as
+ * {@link ExtractionFn#preservesOrdering()} and {@link
ExtractionFn#getExtractionType()}, during capability and
+ * cardinality analysis. The returned function must not be applied to values.
+ *
+ * Implementations backed by retained resources (for example cached lookups)
must not acquire or hold those
+ * resources here. Capability checks call this and discard the result
without a close hook, so a retained reference
+ * would be released only by the cleaner/GC and could block resource
reclamation. The default returns
+ * {@link #getExtractionFn()} since most implementations hold no retained
backing resource.
+ */
+ @Nullable
+ default ExtractionFn getExtractionFnForMetadata()
+ {
+ return getExtractionFn();
Review Comment:
## CodeQL / Deprecated method or constructor invocation
Invoking [DimensionSpec.getExtractionFn](1) should be avoided because it has
been deprecated.
[Show more
details](https://github.com/apache/druid/security/code-scanning/11298)
--
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]