Class FrameCursorUtils


  • public class FrameCursorUtils
    extends Object
    • Field Detail

      • SUBQUERY_ROW_TOO_LARGE_EXCEPTION

        public static final DruidException SUBQUERY_ROW_TOO_LARGE_EXCEPTION
        Exception to be thrown when the subquery's rows are too wide to fit in a single frame. In such case, byte based limiting should be disabled or the user should modify the query.

        NOTE: This error message is not appropriate when a similar exception is hit in MSQ, since this workaround is not applicable in that scenario

    • Method Detail

      • buildFilter

        @Nullable
        public static Filter buildFilter​(@Nullable
                                         Filter filter,
                                         org.joda.time.Interval interval)
        Builds a Filter from a Filter plus an Interval. Useful when we want to do a time filter on a frame, but can't push the time filter into the frame itself (perhaps because it isn't time-sorted).
      • cursorToFramesIterable

        public static Iterable<Frame> cursorToFramesIterable​(Cursor cursor,
                                                             FrameWriterFactory frameWriterFactory)
        Writes a Cursor to a sequence of Frame. This method iterates over the rows of the cursor, and writes the columns to the frames. The iterable is lazy, and it traverses the required portion of the cursor as required.

        If the type is missing from the signature, the method throws an exception without advancing/modifying/closing the cursor

      • cursorToFramesSequence

        public static Sequence<Frame> cursorToFramesSequence​(Cursor cursor,
                                                             FrameWriterFactory frameWriterFactory)
        Writes a Cursor to a sequence of Frame. This method iterates over the rows of the cursor, and writes the columns to the frames
        Parameters:
        cursor - Cursor to write to the frame
        frameWriterFactory - Frame writer factory to write to the frame. It also determines the signature of the rows that are written to the frames
      • throwIfColumnsHaveUnknownType

        public static void throwIfColumnsHaveUnknownType​(RowSignature rowSignature)
        Throws UnsupportedColumnTypeException if the row signature has columns with unknown types. This is used to pre-determine if the frames can be materialized as rows, without touching the resource generating the frames.