Class TableSchema
java.lang.Object
com.clickhouse.client.api.metadata.TableSchema
-
Constructor Summary
ConstructorsConstructorDescriptionTableSchema(String tableName, String query, String databaseName, Collection<ClickHouseColumn> columns) TableSchema(Collection<ClickHouseColumn> columns) -
Method Summary
Modifier and TypeMethodDescriptioncolumnIndexToName(int index) Takes absolute index (starting from 1) and return corresponding column.getColumnByIndex(int colIndex) Returns column by index.getColumnByName(String name) Returns unmodifiable collection of columns.getQuery()booleanindexToName(int index) Takes absolute index (starting from 0) and returns corresponding column.intnameToColumnIndex(String name) Takes column name and return corresponding index (starting from 1).intnameToIndex(String name) Takes column name and return corresponding index (starting from 0).toString()
-
Constructor Details
-
TableSchema
-
TableSchema
public TableSchema(String tableName, String query, String databaseName, Collection<ClickHouseColumn> columns)
-
-
Method Details
-
getColumns
Returns unmodifiable collection of columns.- Returns:
- - collection of columns in the table
-
getDatabaseName
-
getTableName
-
hasDefaults
public boolean hasDefaults() -
getQuery
-
getColumnByName
-
getColumnByIndex
Returns column by index. Index starts with 1.- Parameters:
colIndex- - column index;- Returns:
-
indexToName
Takes absolute index (starting from 0) and returns corresponding column.- Parameters:
index- - column index starting from 0- Returns:
- - column name
-
columnIndexToName
Takes absolute index (starting from 1) and return corresponding column. Equals toindexToName(index - 1.- Parameters:
index- - column index starting from 1- Returns:
- - column name.
-
nameToColumnIndex
Takes column name and return corresponding index (starting from 1). Equals tonameToIndex(name) + 1.- Parameters:
name- - column name- Returns:
- - column index starting from 1
-
nameToIndex
Takes column name and return corresponding index (starting from 0).- Parameters:
name- - column name- Returns:
- - column index starting from 0
-
toString
-