Package org.pgcodekeeper.core.schema.pg
Class GpExternalTable
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.PgStatementContainer
org.pgcodekeeper.core.schema.AbstractTable
org.pgcodekeeper.core.schema.pg.AbstractPgTable
org.pgcodekeeper.core.schema.pg.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.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GOFields inherited from interface org.pgcodekeeper.core.schema.IOptionContainer
GP_OPTION_LISTFields inherited from interface org.pgcodekeeper.core.schema.pg.PgForeignOptionContainer
ALTER_FOREIGN_OPTION, DELIM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUrLocation(String location) Adds a URI location for the external table.voidappendMoveDataSql(PgStatement 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(PgStatement 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.getAlterTable(boolean only) Generates beginning of alter table statement.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) voidsetUrLocation(List<String> urLocation) voidsetWeb(boolean isWeb) voidsetWritable(boolean isWritable) Copies all object properties into a new object and leaves all its children empty.Methods inherited from class org.pgcodekeeper.core.schema.pg.AbstractPgTable
addInherits, appendAlterSQL, appendComments, getColsForMovingData, getCreationSQL, getInherits, getRelationColumns, hasInherits, putTriggerState, setHasOids, sortColumnsMethods inherited from class org.pgcodekeeper.core.schema.AbstractTable
addColumn, addConstraint, addOption, columnAdder, compareChildren, compareIgnoringColumnOrder, computeChildrenHash, containsColumn, getColumn, getColumns, getConstraint, getConstraints, getOption, getOptions, getStatementType, isRecreatedMethods inherited from class org.pgcodekeeper.core.schema.PgStatementContainer
addChild, addIndex, addPolicy, addRule, addTrigger, getChild, getContainingSchema, getIndex, getIndexes, getPolicies, getPolicy, getRule, getRules, getTrigger, getTriggers, isClusteredMethods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendOwnerSQL, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, deepCopy, equals, getAuthor, getBareName, getChildren, getComment, getDbType, getDeps, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSQL, getTwin, hasChildren, hashCode, isLib, isOwned, isSubElement, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, toStringMethods inherited from interface org.pgcodekeeper.core.schema.IOptionContainer
addOption, getOptionsMethods inherited from interface org.pgcodekeeper.core.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getName, getParent, getQualifiedName, getStatementType
-
Constructor Details
-
GpExternalTable
Creates a new Greenplum external table.- Parameters:
name- table name
-
-
Method Details
-
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
-
appendOptions
Description copied from interface:PgForeignOptionContainerAppends SQL OPTIONS clause to StringBuilder.- Specified by:
appendOptionsin interfacePgForeignOptionContainer- Parameters:
sbSQL- the StringBuilder to append 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")
-
getAlterTable
Description copied from class:AbstractTableGenerates beginning of alter table statement.- Specified by:
getAlterTablein classAbstractTable- Parameters:
only- if true, append 'ONLY' to statement- Returns:
- alter table statement beginning in String format
-
getTypeName
Description copied from class:PgStatementGets the type name of this statement for SQL generation.- Overrides:
getTypeNamein classPgStatement- Returns:
- the type name
-
setWritable
public void setWritable(boolean isWritable) -
setWeb
public void setWeb(boolean isWeb) -
setRejectLimit
public void setRejectLimit(int rejectLimit) -
setDistribution
-
setUrLocation
-
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) -
compare
Description copied from class:PgStatementThis method does not account for nested child PgStatements. Shallow version ofPgStatement.equals(Object)- Overrides:
comparein classAbstractPgTable
-
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 classAbstractPgTable- Parameters:
hasher- the hasher instance to use for hash computation
-
shallowCopy
Description copied from class:PgStatementCopies all object properties into a new object and leaves all its children empty.- Overrides:
shallowCopyin classAbstractPgTable- Returns:
- shallow copy of a DB object.
-
appendMoveDataSql
public void appendMoveDataSql(PgStatement newCondition, SQLScript script, String tblTmpBareName, List<String> identityCols) Description copied from class:AbstractTableAdds 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:
appendMoveDataSqlin classAbstractTable
-