public class TSQLTable extends TSQLSchemaObject
dataObjectType, name, nameKeepCase, sqlEnv| Constructor and Description |
|---|
TSQLTable(TSQLSchema sqlSchema,
String tableName)
create a new table belong to a schema
|
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(String columnName)
add a new column to the table
|
void |
addColumn(String columnName,
TTypeName columnDataType) |
void |
addUnresolvedStar()
Records that the table's width is not fully known: its definition or the lineage that wrote it back read a
star (
SELECT *) it could not expand. |
void |
fillColumnDataType(String columnName,
TTypeName columnDataType)
Gives the column
columnName the data type columnDataType when the column has none: another
definition of the table that knows the type completes the column, as when metadata from several files is
merged. |
TSQLColumn |
getColumn(String columnName) |
List<TSQLColumn> |
getColumnList()
column list
|
ArrayList<String> |
getColumns(boolean columnNameOnly) |
String |
getDefinition()
This is the script that used to create this view(
isView() returns true). |
boolean |
hasAllColumnsKnown()
Whether every column of the table is known: it has columns, and none is a star it could not expand
(
addUnresolvedStar()). |
boolean |
isSealed()
Check if this table is sealed (Phase 6).
|
boolean |
isView()
Used to check whether this is a view.
|
TSQLTable |
newVersion()
Replaces this table in its schema with a new table of the same name, columns, kind and definition, and returns
the new one.
|
void |
seal()
Seal this table to prevent further modifications (Phase 6).
|
boolean |
searchColumn(String columnName) |
void |
setDefinition(String definition) |
void |
setView(boolean view) |
getPriority, getQualifiedName, getSchema, setPrioritycompareTo, compareTo, compareTo, compareTo, getDataObjectType, getName, getNameKeepCase, getSqlEnv, isDelimitedIdentifier, isDelimitedIdentifier, normalizeIdentifier, setDataObjectTypepublic TSQLTable(TSQLSchema sqlSchema, String tableName)
sqlSchema - schematableName - table namepublic void seal()
See TSQLEnv#seal() for detailed documentation.
public boolean isSealed()
public void setView(boolean view)
public boolean isView()
public void setDefinition(String definition)
public String getDefinition()
isView() returns true).public List<TSQLColumn> getColumnList()
public void addColumn(String columnName)
columnName - column namepublic void addUnresolvedStar()
SELECT *) it could not expand. The entry is stored as * and marked
(TSQLColumn.isUnresolvedStar()); it is not a column of the table, and a column the table already holds
under that name (a column NAMED *) is left as it is.public TSQLTable newVersion()
public boolean searchColumn(String columnName)
public boolean hasAllColumnsKnown()
addUnresolvedStar()). Only then does searchColumn(java.lang.String) returning false prove the table has no
column of that name.public TSQLColumn getColumn(String columnName)
public void fillColumnDataType(String columnName, TTypeName columnDataType)
columnName the data type columnDataType when the column has none: another
definition of the table that knows the type completes the column, as when metadata from several files is
merged. A type the column already has is kept, and nothing happens when the table has no such column.columnName - column name, as for addColumn(String, TTypeName)columnDataType - the type; nothing happens when it is nullpublic ArrayList<String> getColumns(boolean columnNameOnly)