Class GpExternalTable
java.lang.Object
org.pgcodekeeper.core.database.base.schema.AbstractStatement
org.pgcodekeeper.core.database.pg.schema.PgAbstractStatement
org.pgcodekeeper.core.database.pg.schema.PgAbstractStatementContainer
org.pgcodekeeper.core.database.pg.schema.PgAbstractTable
org.pgcodekeeper.core.database.pg.schema.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.
-
Field Summary
Fields inherited from interface org.pgcodekeeper.core.database.pg.schema.PgForeignOptionContainer
ALTER_FOREIGN_OPTION, DELIM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUrLocation(String location) Adds a URI location for the external table.voidaddUrLocations(List<String> urlLocation) voidappendMoveDataSql(IStatement newCondition, SQLScript script, String tblTmpBareName, List<String> identityCols) 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.voidappendOptions(StringBuilder sbSQL) Appends SQL OPTIONS clause to StringBuilder.booleancompare(IStatement obj) This method does not account for nested child PgStatements.voidcompareOptions(IOptionContainer newContainer, SQLScript script) Compares options between this container and a new container, generating SQL to update differences.voidcomputeHash(Hasher hasher) Computes the hash of the implementing object using the provided hasher.Returns the ALTER statement header for this object.Gets the type name of this statement for SQL generation.voidsetCommand(String command) voidsetDistribution(String distribution) voidsetEncoding(String encoding) voidsetExLocation(String exLocation) voidsetFormatOptions(String formatOptions) voidsetFormatType(String formatType) voidsetIsLogErrors(boolean isLogErrors) voidsetRejectLimit(int rejectLimit) voidsetRowReject(boolean isRowReject) voidsetWeb(boolean isWeb) voidsetWritable(boolean isWritable) Methods inherited from class org.pgcodekeeper.core.database.pg.schema.PgAbstractTable
addChild, addColumn, addInherits, addOption, appendAlterSQL, appendComments, compareChildren, compareIgnoringColumnOrder, computeChildrenHash, fillChildrenList, getChild, getChildrenByType, getColumn, getColumns, getConstraint, getConstraints, getCreationSQL, getInherits, getOptions, getRelationColumns, hasInherits, isClustered, isRecreated, putTriggerState, setHasOids, sortColumnsMethods inherited from class org.pgcodekeeper.core.database.pg.schema.PgAbstractStatementContainer
getIndex, getIndexes, getPolicies, getPolicy, getRule, getTrigger, getTriggersMethods inherited from class org.pgcodekeeper.core.database.pg.schema.PgAbstractStatement
addPrivilege, appendDefaultPrivileges, appendOwnerSQL, formatSql, getQuoter, getRenameCommand, isOwnedMethods inherited from class org.pgcodekeeper.core.database.base.schema.AbstractStatement
addDependency, appendAlterComments, appendPrivileges, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, deepCopy, equals, fillDescendantsList, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSeparator, getSQL, getTwin, hasChildren, hashCode, isLib, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, shallowCopy, toStringMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IOptionContainer
addOption, getOptionsMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IRelation
getRelationColumnsMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISearchPath
getContainingSchema, getDatabase, getSchemaName, toObjectReferenceMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IStatement
addDependency, appendAlterSQL, appendOwnerSQL, canDrop, canDropBeforeCreate, clearPrivileges, deepCopy, formatSql, getAuthor, getBareName, getChildren, getComment, getCreationSQL, getDependencies, getDescendants, getDropSQL, getLibName, getLocation, getName, getOwner, getParent, getPrivileges, getQualifiedName, getQuotedName, getQuoter, getRenameCommand, getSeparator, getSQL, getTwin, hasChildren, isLib, isOwned, quote, setComment, setLibName, setLocation, setOwner, shallowCopyMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IStatementContainer
addChild, getChild, getChildrenByTypeMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ITable
compareIgnoringColumnOrder, getColumn, getColumns, getConstraints, getStatementType, isRecreated
-
Constructor Details
-
GpExternalTable
Creates a new Greenplum external table.- Parameters:
name- table name
-
-
Method Details
-
getTypeName
Description copied from interface:IStatementGets the type name of this statement for SQL generation.- Specified by:
getTypeNamein interfaceIStatement- Returns:
- the type name
-
appendOptions
Description copied from interface:PgForeignOptionContainerAppends SQL OPTIONS clause to StringBuilder.- Specified by:
appendOptionsin interfacePgForeignOptionContainer- Parameters:
sbSQL- the StringBuilder to append to
-
appendMoveDataSql
public void appendMoveDataSql(IStatement newCondition, SQLScript script, String tblTmpBareName, List<String> identityCols) Description copied from interface:ITableAdds 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:
appendMoveDataSqlin interfaceITable- Overrides:
appendMoveDataSqlin classPgAbstractTable
-
compareOptions
Description copied from interface:IOptionContainerCompares options between this container and a new container, generating SQL to update differences.- Specified by:
compareOptionsin interfaceIOptionContainer- Specified by:
compareOptionsin interfacePgForeignOptionContainer- Parameters:
newContainer- the new container to compare againstscript- the script to append changes to
-
getAlterHeader
Description copied from interface:PgForeignOptionContainerReturns the ALTER statement header for this object.- Specified by:
getAlterHeaderin interfacePgForeignOptionContainer- 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
-
addUrLocations
-
addUrLocation
Adds a URI location for the external table.- Parameters:
location- URI location to add
-
setExLocation
-
setCommand
-
setFormatType
-
setFormatOptions
-
setRowReject
public void setRowReject(boolean isRowReject) -
setEncoding
-
setIsLogErrors
public void setIsLogErrors(boolean isLogErrors) -
computeHash
Description copied from interface:IHashableComputes the hash of the implementing object using the provided hasher. The implementation should call appropriateputmethods on the hasher for all fields that should contribute to the hash value.- Specified by:
computeHashin interfaceIHashable- Overrides:
computeHashin classPgAbstractTable- Parameters:
hasher- the hasher instance to use for hash computation
-
compare
Description copied from class:AbstractStatementThis method does not account for nested child PgStatements. Shallow version ofAbstractStatement.equals(Object)- Specified by:
comparein interfaceIStatement- Overrides:
comparein classPgAbstractTable
-