Class FullNameTableProvider

java.lang.Object
org.apache.beam.sdk.extensions.sql.meta.provider.FullNameTableProvider
All Implemented Interfaces:
CustomTableResolver, TableProvider
Direct Known Subclasses:
DataCatalogTableProvider

public abstract class FullNameTableProvider extends Object implements TableProvider, CustomTableResolver
Base class for table providers that look up table metadata using full table names, instead of querying it by parts of the name separately.
  • Constructor Details

    • FullNameTableProvider

      protected FullNameTableProvider()
  • Method Details

    • getTableByFullName

      public abstract Table getTableByFullName(TableName fullTableName)
    • registerKnownTableNames

      public void registerKnownTableNames(List<TableName> tableNames)
      Description copied from interface: CustomTableResolver
      Register the table names as extracted from the FROM clause.

      Calcite doesn't provide these full names to table providers and queries them with individual parts of the identifiers without giving any extra context. So if a table provider needs to implement some custom table name resolution strategy it doesn't have information to do so. E.g. if you want to take the compound SQL identifiers that were originally split by dots, join them into a single string, and then query a back-end service, this interface makes this possible.

      Specified by:
      registerKnownTableNames in interface CustomTableResolver
    • getSubProvider

      public TableProvider getSubProvider(String name)
      Description copied from interface: TableProvider
      Returns a sub-provider, e.g. sub-schema. Temporary, this logic needs to live in BeamCalciteSchema.
      Specified by:
      getSubProvider in interface TableProvider