Class NaturallyJoinedTable

  • All Implemented Interfaces:
    TableDataSource

    public final class NaturallyJoinedTable
    extends JoinedTable
    A table that is the cartesian product of two tables. This provides better memory-use and efficiency than a materialized table backed by a VirtualTable.
    • Field Detail

      • left_row_count

        private final int left_row_count
        The row counts of the left and right tables.
      • right_row_count

        private final int right_row_count
        The row counts of the left and right tables.
      • left_set

        private final IntegerVector left_set
        The lookup row set for the left and right tables. Basically, these point to each row in either the left or right tables.
      • right_set

        private final IntegerVector right_set
        The lookup row set for the left and right tables. Basically, these point to each row in either the left or right tables.
      • left_is_simple_enum

        private final boolean left_is_simple_enum
      • right_is_simple_enum

        private final boolean right_is_simple_enum
    • Constructor Detail

      • NaturallyJoinedTable

        public NaturallyJoinedTable​(Table left,
                                    Table right)
        Constructs the table.
    • Method Detail

      • createLookupRowList

        private static IntegerVector createLookupRowList​(Table t)
        Creates a lookup list for rows in the given table.
      • getLeftRowIndex

        private int getLeftRowIndex​(int row_index)
        Given a row index between 0 and left table row count, this will return a row index into the left table's row domain.
      • getRightRowIndex

        private int getRightRowIndex​(int row_index)
        Given a row index between 0 and right table row count, this will return a row index into the right table's row domain.
      • resolveRowForTableAt

        protected int resolveRowForTableAt​(int row_number,
                                           int table_num)
        Description copied from class: JoinedTable
        Given a row and a table index (to a parent reference table), this will return the row index in the given parent table for the given row.
        Specified by:
        resolveRowForTableAt in class JoinedTable
      • resolveAllRowsForTableAt

        protected void resolveAllRowsForTableAt​(IntegerVector row_set,
                                                int table_num)
        Description copied from class: JoinedTable
        Given an IntegerVector that represents a list of pointers to rows in this table, this resolves the rows to row indexes in the given parent table. This method changes the 'row_set' IntegerVector object.
        Specified by:
        resolveAllRowsForTableAt in class JoinedTable