github-code-scanning[bot] commented on code in PR #13732:
URL: https://github.com/apache/druid/pull/13732#discussion_r1093990565
##########
processing/src/main/java/org/apache/druid/segment/virtual/NestedFieldVirtualColumn.java:
##########
@@ -233,20 +245,49 @@
ReadableOffset offset
)
{
- final NestedDataComplexColumn column =
NestedDataComplexColumn.fromColumnSelector(columnSelector, columnName);
- if (column == null) {
- // complex column itself didn't exist
- return DimensionSelector.constant(null);
+ ColumnHolder holder = columnSelector.getColumnHolder(columnName);
+ if (holder == null) {
+ // column doesn't exist
+ return dimensionSpec.decorate(DimensionSelector.constant(null));
}
if (hasNegativeArrayIndex) {
- return new FieldDimensionSelector(
- new RawFieldLiteralColumnValueSelector(
- column.makeColumnValueSelector(offset),
- parts
- )
- );
+ // if the path has negative array elements, then we have to use the
'raw' processing of the FieldDimensionSelector
+ // created with the column selector factory instead of using the
optimized nested field column, return null
+ // to fall through
+ return null;
+ }
+
+ return dimensionSpec.decorate(makeDimensionSelectorUndecorated(holder,
offset, dimensionSpec.getExtractionFn()));
Review Comment:
## 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/4223)
--
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]