Class GpExternalTable

All Implemented Interfaces:
IHashable, IForeignTable, IOptionContainer, IRelation, ISearchPath, IStatement, IStatementContainer, PgForeignOptionContainer

public final class GpExternalTable extends AbstractPgTable implements PgForeignOptionContainer, IForeignTable
Greenplum external table implementation. External tables allow access to data stored outside the database, such as flat files, web services, or other external data sources.
  • Constructor Details

    • GpExternalTable

      public GpExternalTable(String name)
      Creates a new Greenplum external table.
      Parameters:
      name - table name
  • Method Details

    • compareOptions

      public void compareOptions(IOptionContainer newContainer, SQLScript script)
      Description copied from interface: IOptionContainer
      Compares options between this container and a new container, generating SQL to update differences.
      Specified by:
      compareOptions in interface IOptionContainer
      Specified by:
      compareOptions in interface PgForeignOptionContainer
      Parameters:
      newContainer - the new container to compare against
      script - the script to append changes to
    • appendOptions

      public void appendOptions(StringBuilder sbSQL)
      Description copied from interface: PgForeignOptionContainer
      Appends SQL OPTIONS clause to StringBuilder.
      Specified by:
      appendOptions in interface PgForeignOptionContainer
      Parameters:
      sbSQL - the StringBuilder to append to
    • getAlterHeader

      public String getAlterHeader()
      Description copied from interface: PgForeignOptionContainer
      Returns the ALTER statement header for this object.
      Specified by:
      getAlterHeader in interface PgForeignOptionContainer
      Returns:
      ALTER statement prefix (e.g., "ALTER FOREIGN TABLE table_name")
    • getAlterTable

      public String getAlterTable(boolean only)
      Description copied from class: AbstractTable
      Generates beginning of alter table statement.
      Specified by:
      getAlterTable in class AbstractTable
      Parameters:
      only - if true, append 'ONLY' to statement
      Returns:
      alter table statement beginning in String format
    • getTypeName

      public String getTypeName()
      Description copied from class: PgStatement
      Gets the type name of this statement for SQL generation.
      Overrides:
      getTypeName in class PgStatement
      Returns:
      the type name
    • setWritable

      public void setWritable(boolean isWritable)
    • setWeb

      public void setWeb(boolean isWeb)
    • setRejectLimit

      public void setRejectLimit(int rejectLimit)
    • setDistribution

      public void setDistribution(String distribution)
    • setUrLocation

      public void setUrLocation(List<String> urLocation)
    • addUrLocation

      public void addUrLocation(String location)
      Adds a URI location for the external table.
      Parameters:
      location - URI location to add
    • setExLocation

      public void setExLocation(String exLocation)
    • setCommand

      public void setCommand(String command)
    • setFormatType

      public void setFormatType(String formatType)
    • setFormatOptions

      public void setFormatOptions(String formatOptions)
    • setRowReject

      public void setRowReject(boolean isRowReject)
    • setEncoding

      public void setEncoding(String encoding)
    • setIsLogErrors

      public void setIsLogErrors(boolean isLogErrors)
    • compare

      public boolean compare(PgStatement obj)
      Description copied from class: PgStatement
      This method does not account for nested child PgStatements. Shallow version of PgStatement.equals(Object)
      Overrides:
      compare in class AbstractPgTable
    • computeHash

      public void computeHash(Hasher hasher)
      Description copied from interface: IHashable
      Computes the hash of the implementing object using the provided hasher. The implementation should call appropriate put methods on the hasher for all fields that should contribute to the hash value.
      Specified by:
      computeHash in interface IHashable
      Overrides:
      computeHash in class AbstractPgTable
      Parameters:
      hasher - the hasher instance to use for hash computation
    • shallowCopy

      public AbstractTable shallowCopy()
      Description copied from class: PgStatement
      Copies all object properties into a new object and leaves all its children empty.
      Overrides:
      shallowCopy in class AbstractPgTable
      Returns:
      shallow copy of a DB object.
    • appendMoveDataSql

      public void appendMoveDataSql(PgStatement newCondition, SQLScript script, String tblTmpBareName, List<String> identityCols)
      Description copied from class: AbstractTable
      Adds commands to the script for move data from the temporary table to the new table, given the identity columns, and a command to delete the temporary table.
      Overrides:
      appendMoveDataSql in class AbstractTable