Class AbstractRead<T>

java.lang.Object
org.apache.drill.metastore.operate.AbstractRead<T>
Type Parameters:
T - Metastore metadata unit
All Implemented Interfaces:
Read<T>
Direct Known Subclasses:
IcebergRead, MongoRead, RdbmsRead

public abstract class AbstractRead<T> extends Object implements Read<T>
Abstract implementation of Read<T> interface which contains all boilerplace code for collecting metadata types, columns and filter condition. Given metadata types are also validated during execution.
  • Field Details

  • Constructor Details

  • Method Details

    • metadataTypes

      public Read<T> metadataTypes(Set<MetadataType> metadataTypes)
      Description copied from interface: Read
      Provides set of metadata types to be read. Note: providing at least one metadata type is required. If all metadata types should be read, MetadataType.ALL can be passed.
      Specified by:
      metadataTypes in interface Read<T>
      Parameters:
      metadataTypes - set of metadata types
      Returns:
      current instance of Read interface implementation
    • filter

      public Read<T> filter(FilterExpression filter)
      Description copied from interface: Read
      Provides filter expression by which metastore component data will be filtered. If filter expression is not indicated, all Metastore component data will be read.
      Specified by:
      filter in interface Read<T>
      Parameters:
      filter - filter expression
      Returns:
      current instance of Read interface implementation
    • columns

      public Read<T> columns(List<MetastoreColumn> columns)
      Description copied from interface: Read
      Provides list of columns to be read from Metastore component. If no columns are indicated, all columns will be read. Depending on Metastore component implementation, providing list of columns to be read, can improve retrieval performance.
      Specified by:
      columns in interface Read<T>
      Parameters:
      columns - list of columns to be read from Metastore component
      Returns:
      current instance of Read interface implementation
    • execute

      public final List<T> execute()
      Description copied from interface: Read
      Executes read operation from Metastore component, returns obtained result in a form of list of component units which later can be transformed into suitable format.
      Specified by:
      execute in interface Read<T>
      Returns:
      list of component units
    • internalExecute

      protected abstract List<T> internalExecute()