fix filtering nested field virtual column when used with non nested column input#13779
Conversation
| theColumn.makeVectorValueSelector(offset), | ||
| capabilities.toColumnType(), | ||
| expectedType | ||
| expectedType != null ? expectedType : capabilities.toColumnType() // cast to itself in case the underlying column doesn't support object selector... |
There was a problem hiding this comment.
The comment here isn't adding any value for me?
|
|
||
| if (capabilities != null) { | ||
| if (!capabilities.isPrimitive() && capabilities.isDictionaryEncoded().isTrue()) { | ||
| // if the underlying column is a nested column (and persisted to disk, re: the dictionary encoded check) |
There was a problem hiding this comment.
Do we really have no better way of determining if we have been persisted than checking isDictionaryEncoded()? Given that we are already a NestedFieldVirtualColumn and supposedly working with a NestedField that we understand the class of, I wonder if we couldn't have something more specific. Maybe for another day, but perhaps we could have a NestedFieldColumnCapabilities that we could cast to and get access to more specific methods?
There was a problem hiding this comment.
yeah, im certain there is a cooler way to do this, especially when the underlying inspector is the segment, but i'll save that for another day
|
i cancelled travis since it seems redundant |
Description
This PR fixes an issue when filtering on a
NestedFieldVirtualColumnthat is using an input column that is not a nested column, such as a standard string, long, float, or double column. #13732 updatedNestedFieldVirtualColumnto be permissive and still able to create selectors when used with other column types, but I forgot to add this handling to thegetIndexSuppliermethod, so attempting to filter these columns with a filter which would typically use an index, would result in an exception being thrown about the column being the wrong type, something likeThis PR fixes this method to use the same logic as the selector methods, returning the underlying columns index supplier directly if selecting the 'root' path, else null as if the column didn't exist.
This PR has: