Class GpExternalTable

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

public class GpExternalTable extends PgAbstractTable implements IForeignTable, PgForeignOptionContainer
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

    • getTypeName

      public String getTypeName()
      Description copied from interface: IStatement
      Gets the type name of this statement for SQL generation.
      Specified by:
      getTypeName in interface IStatement
      Returns:
      the type name
    • 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
    • appendMoveDataSql

      public void appendMoveDataSql(IStatement newCondition, SQLScript script, String tblTmpBareName, List<String> identityCols)
      Description copied from interface: ITable
      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.
      Specified by:
      appendMoveDataSql in interface ITable
      Overrides:
      appendMoveDataSql in class PgAbstractTable
    • 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
    • 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")
    • setWritable

      public void setWritable(boolean isWritable)
    • setWeb

      public void setWeb(boolean isWeb)
    • setRejectLimit

      public void setRejectLimit(int rejectLimit)
    • setDistribution

      public void setDistribution(String distribution)
    • addUrLocations

      public void addUrLocations(List<String> urlLocation)
    • 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)
    • 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 PgAbstractTable
      Parameters:
      hasher - the hasher instance to use for hash computation
    • compare

      public boolean compare(IStatement obj)
      Description copied from class: AbstractStatement
      This method does not account for nested child PgStatements. Shallow version of AbstractStatement.equals(Object)
      Specified by:
      compare in interface IStatement
      Overrides:
      compare in class PgAbstractTable