Class ConnectorTablePartitioning


  • public class ConnectorTablePartitioning
    extends Object
    The partitioning of split groups in a table. A table is partitioned on columns {C1,...,Cn} if rows with the same values on the respective columns are always in the same split group.

    This class was previously name ConnectorNodePartitioning. The new semantics is more flexible. It enables expression of more sophisticated table organization. Node partitioning is a form of partitioning between split groups, where each split group contains all splits on a Node.

    Unless the connector declares itself as supporting grouped scheduling in ConnectorSplitManager, Trino engine treats all splits on a node as a single split group. As a result, the connector does not need to provide additional guarantee as a result of this change for previously-declared node partitioning. Therefore, this change in SPI is backward compatible.

    For now, all splits in each split group must be assigned the same Node by ConnectorNodePartitioningProvider. With future changes to the engine, connectors will no longer be required to declare a mapping from split groups to nodes. Artificially requiring such a mapping regardless of whether the engine can take advantage of the TablePartitioning negatively affects performance.

    • Method Detail

      • getPartitioningHandle

        public ConnectorPartitioningHandle getPartitioningHandle()
        A handle to the partitioning scheme used to divide the table across worker nodes.
      • getPartitioningColumns

        public List<ColumnHandle> getPartitioningColumns()
        The columns used to partition the table across the worker nodes. An empty list means the table is entirely contained on a single worker.

        If the table is node partitioned, the connector guarantees that each combination of values for the distributed columns will be contained within a single worker.

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object