Class NestedFieldVirtualColumn

  • All Implemented Interfaces:
    Cacheable, VirtualColumn

    public class NestedFieldVirtualColumn
    extends Object
    implements VirtualColumn
    Optimized virtual column that can make direct selectors into a NestedDataComplexColumn or any associated nested fields (NestedFieldDictionaryEncodedColumn) including using their indexes.

    This virtual column is used for the SQL operators JSON_VALUE (if processFromRaw is set to false) or JSON_QUERY (if it is true), and accepts 'JSONPath' or 'jq' syntax string representations of paths, or a parsed list of NestedPathPart in order to determine what should be selected from the column.

    Type information for nested fields is completely absent in the SQL planner, so it guesses the best it can to set expectedType from the context of how something is being used, e.g. an aggregators default type or an explicit cast, or, if using the 'RETURNING' syntax which explicitly specifies type. This might not be the same as if it had actual type information, but, we try to stick with whatever we chose there to do the best we can for now.

    Since capabilities(ColumnInspector, String) is determined by the expectedType, the results will be best effor cast to the expected type if the column is not natively the expected type so that this column can fulfill the contract of the type of selector that is likely to be created to read this column.