Package org.apache.calcite.jdbc
Class CalciteMetaImpl
java.lang.Object
org.apache.calcite.avatica.MetaImpl
org.apache.calcite.jdbc.CalciteMetaImpl
- All Implemented Interfaces:
org.apache.calcite.avatica.Meta
public class CalciteMetaImpl
extends org.apache.calcite.avatica.MetaImpl
Helper for implementing the
getXxx
methods such as
AvaticaDatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Metadata describing a Calcite table.Nested classes/interfaces inherited from class org.apache.calcite.avatica.MetaImpl
org.apache.calcite.avatica.MetaImpl.ColumnNoNulls, org.apache.calcite.avatica.MetaImpl.ColumnNullable, org.apache.calcite.avatica.MetaImpl.ColumnNullableUnknown, org.apache.calcite.avatica.MetaImpl.MetaAttribute, org.apache.calcite.avatica.MetaImpl.MetaBestRowIdentifier, org.apache.calcite.avatica.MetaImpl.MetaCatalog, org.apache.calcite.avatica.MetaImpl.MetaClientInfoProperty, org.apache.calcite.avatica.MetaImpl.MetaColumn, org.apache.calcite.avatica.MetaImpl.MetaColumnPrivilege, org.apache.calcite.avatica.MetaImpl.MetaCrossReference, org.apache.calcite.avatica.MetaImpl.MetaExportedKey, org.apache.calcite.avatica.MetaImpl.MetaFunction, org.apache.calcite.avatica.MetaImpl.MetaFunctionColumn, org.apache.calcite.avatica.MetaImpl.MetaImportedKey, org.apache.calcite.avatica.MetaImpl.MetaIndexInfo, org.apache.calcite.avatica.MetaImpl.MetaPrimaryKey, org.apache.calcite.avatica.MetaImpl.MetaProcedure, org.apache.calcite.avatica.MetaImpl.MetaProcedureColumn, org.apache.calcite.avatica.MetaImpl.MetaPseudoColumn, org.apache.calcite.avatica.MetaImpl.MetaSchema, org.apache.calcite.avatica.MetaImpl.MetaSuperTable, org.apache.calcite.avatica.MetaImpl.MetaSuperType, org.apache.calcite.avatica.MetaImpl.MetaTable, org.apache.calcite.avatica.MetaImpl.MetaTablePrivilege, org.apache.calcite.avatica.MetaImpl.MetaTableType, org.apache.calcite.avatica.MetaImpl.MetaTypeInfo, org.apache.calcite.avatica.MetaImpl.MetaUdt, org.apache.calcite.avatica.MetaImpl.MetaVersionColumn, org.apache.calcite.avatica.MetaImpl.Named
Nested classes/interfaces inherited from interface org.apache.calcite.avatica.Meta
org.apache.calcite.avatica.Meta.ConnectionHandle, org.apache.calcite.avatica.Meta.ConnectionProperties, org.apache.calcite.avatica.Meta.CursorFactory, org.apache.calcite.avatica.Meta.DatabaseProperty, org.apache.calcite.avatica.Meta.ExecuteBatchResult, org.apache.calcite.avatica.Meta.ExecuteResult, org.apache.calcite.avatica.Meta.Factory, org.apache.calcite.avatica.Meta.Frame, org.apache.calcite.avatica.Meta.MetaResultSet, org.apache.calcite.avatica.Meta.Pat, org.apache.calcite.avatica.Meta.PrepareCallback, org.apache.calcite.avatica.Meta.Signature, org.apache.calcite.avatica.Meta.StatementHandle, org.apache.calcite.avatica.Meta.StatementType, org.apache.calcite.avatica.Meta.Style
-
Field Summary
Modifier and TypeFieldDescriptionThe columns returned byDatabaseMetaData.getCatalogs()
.Column names returned byDatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
.The columns returned byDatabaseMetaData.getFunctions(java.lang.String, java.lang.String, java.lang.String)
.The columns returned byDatabaseMetaData.getSchemas()
.The columns returned byDatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
.The columns returned byDatabaseMetaData.getTableTypes()
.The columns returned byDatabaseMetaData.getTypeInfo()
.Fields inherited from class org.apache.calcite.avatica.MetaImpl
connection, connProps
-
Constructor Summary
ModifierConstructorDescriptionCalciteMetaImpl
(org.apache.calcite.jdbc.CalciteConnectionImpl connection) Deprecated.protected
CalciteMetaImpl
(org.apache.calcite.jdbc.CalciteConnectionImpl connection, CalciteMetaTableFactory metaTableFactory, CalciteMetaColumnFactory metaColumnFactory) Internal constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected Enumerable<org.apache.calcite.avatica.MetaImpl.MetaTypeInfo>
void
closeStatement
(org.apache.calcite.avatica.Meta.StatementHandle h) Enumerable<org.apache.calcite.avatica.MetaImpl.MetaColumn>
columns
(org.apache.calcite.avatica.MetaImpl.MetaTable table_) void
commit
(org.apache.calcite.avatica.Meta.ConnectionHandle ch) static CalciteConnection
connect
(CalciteSchema schema, @Nullable JavaTypeFactory typeFactory) A trojan-horse method, subject to change without notice.static CalciteMetaImpl
create
(CalciteConnection connection) Creates a CalciteMetaImpl.static CalciteMetaImpl
create
(CalciteConnection connection, CalciteMetaTableFactory metaTableFactory, CalciteMetaColumnFactory metaColumnFactory) Creates a CalciteMetaImpl.static DataContext
createDataContext
(CalciteConnection connection) A trojan-horse method, subject to change without notice.createIterable
(org.apache.calcite.avatica.Meta.StatementHandle handle, org.apache.calcite.avatica.QueryState state, org.apache.calcite.avatica.Meta.Signature signature, @Nullable List<org.apache.calcite.avatica.remote.TypedValue> parameterValues, @Nullable org.apache.calcite.avatica.Meta.Frame firstFrame) protected org.apache.calcite.avatica.Meta.MetaResultSet
createResultSet
(Map<String, Object> internalParameters, List<org.apache.calcite.avatica.ColumnMetaData> columns, org.apache.calcite.avatica.Meta.CursorFactory cursorFactory, org.apache.calcite.avatica.Meta.Frame firstFrame) org.apache.calcite.avatica.Meta.StatementHandle
createStatement
(org.apache.calcite.avatica.Meta.ConnectionHandle ch) org.apache.calcite.avatica.Meta.ExecuteResult
execute
(org.apache.calcite.avatica.Meta.StatementHandle h, List<org.apache.calcite.avatica.remote.TypedValue> parameterValues, int maxRowsInFirstFrame) org.apache.calcite.avatica.Meta.ExecuteResult
execute
(org.apache.calcite.avatica.Meta.StatementHandle h, List<org.apache.calcite.avatica.remote.TypedValue> parameterValues, long maxRowCount) org.apache.calcite.avatica.Meta.ExecuteBatchResult
executeBatch
(org.apache.calcite.avatica.Meta.StatementHandle h, List<List<org.apache.calcite.avatica.remote.TypedValue>> parameterValueLists) org.apache.calcite.avatica.Meta.Frame
fetch
(org.apache.calcite.avatica.Meta.StatementHandle h, long offset, int fetchMaxRowCount) org.apache.calcite.avatica.Meta.MetaResultSet
getCatalogs
(org.apache.calcite.avatica.Meta.ConnectionHandle ch) org.apache.calcite.avatica.Meta.MetaResultSet
getColumns
(org.apache.calcite.avatica.Meta.ConnectionHandle ch, String catalog, org.apache.calcite.avatica.Meta.Pat schemaPattern, org.apache.calcite.avatica.Meta.Pat tableNamePattern, org.apache.calcite.avatica.Meta.Pat columnNamePattern) getDatabaseProperties
(org.apache.calcite.avatica.Meta.ConnectionHandle ch) org.apache.calcite.avatica.Meta.MetaResultSet
getFunctions
(org.apache.calcite.avatica.Meta.ConnectionHandle ch, String catalog, org.apache.calcite.avatica.Meta.Pat schemaPattern, org.apache.calcite.avatica.Meta.Pat functionNamePattern) org.apache.calcite.avatica.Meta.MetaResultSet
getSchemas
(org.apache.calcite.avatica.Meta.ConnectionHandle ch, String catalog, org.apache.calcite.avatica.Meta.Pat schemaPattern) org.apache.calcite.avatica.Meta.MetaResultSet
getTables
(org.apache.calcite.avatica.Meta.ConnectionHandle ch, String catalog, org.apache.calcite.avatica.Meta.Pat schemaPattern, org.apache.calcite.avatica.Meta.Pat tableNamePattern, List<String> typeList) org.apache.calcite.avatica.Meta.MetaResultSet
getTableTypes
(org.apache.calcite.avatica.Meta.ConnectionHandle ch) org.apache.calcite.avatica.Meta.MetaResultSet
getTypeInfo
(org.apache.calcite.avatica.Meta.ConnectionHandle ch) static Pattern
likeToRegex
(org.apache.calcite.avatica.Meta.Pat pattern) Converts a LIKE-style pattern (where '%' represents a wild-card, escaped using '\') to a Java regex.org.apache.calcite.avatica.Meta.StatementHandle
org.apache.calcite.avatica.Meta.ExecuteResult
prepareAndExecute
(org.apache.calcite.avatica.Meta.StatementHandle h, String sql, long maxRowCount, int maxRowsInFirstFrame, org.apache.calcite.avatica.Meta.PrepareCallback callback) org.apache.calcite.avatica.Meta.ExecuteResult
prepareAndExecute
(org.apache.calcite.avatica.Meta.StatementHandle h, String sql, long maxRowCount, org.apache.calcite.avatica.Meta.PrepareCallback callback) org.apache.calcite.avatica.Meta.ExecuteBatchResult
prepareAndExecuteBatch
(org.apache.calcite.avatica.Meta.StatementHandle h, List<String> sqlCommands) void
rollback
(org.apache.calcite.avatica.Meta.ConnectionHandle ch) boolean
syncResults
(org.apache.calcite.avatica.Meta.StatementHandle h, org.apache.calcite.avatica.QueryState state, long offset) Methods inherited from class org.apache.calcite.avatica.MetaImpl
checkParameterValueHasNull, closeConnection, collect, collect, columnMetaData, columnMetaData, columnMetaData, columnMetaData, connectionSync, createCursor, createEmptyResultSet, fetch, fieldMetaData, getAttributes, getBestRowIdentifier, getClientInfoProperties, getColumnNullability, getColumnPrivileges, getCrossReference, getExportedKeys, getFunctionColumns, getImportedKeys, getIndexInfo, getPrimaryKeys, getProcedureColumns, getProcedures, getPseudoColumns, getSuperTables, getSuperTypes, getTablePrivileges, getUDTs, getVersionColumns, openConnection
-
Field Details
-
CATALOG_COLUMNS
The columns returned byDatabaseMetaData.getCatalogs()
. -
COLUMN_COLUMNS
Column names returned byDatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
. -
FUNCTION_COLUMNS
The columns returned byDatabaseMetaData.getFunctions(java.lang.String, java.lang.String, java.lang.String)
. -
SCHEMA_COLUMNS
The columns returned byDatabaseMetaData.getSchemas()
. -
TABLE_COLUMNS
The columns returned byDatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
. -
TABLE_TYPE_COLUMNS
The columns returned byDatabaseMetaData.getTableTypes()
. -
TYPE_INFO_COLUMNS
The columns returned byDatabaseMetaData.getTypeInfo()
.
-
-
Constructor Details
-
CalciteMetaImpl
Deprecated.Usecreate(CalciteConnection)
instead.Creates a CalciteMetaImpl. -
CalciteMetaImpl
protected CalciteMetaImpl(org.apache.calcite.jdbc.CalciteConnectionImpl connection, CalciteMetaTableFactory metaTableFactory, CalciteMetaColumnFactory metaColumnFactory) Internal constructor. Protected to allow subclassing.
-
-
Method Details
-
create
Creates a CalciteMetaImpl.- Parameters:
connection
- Calcite connection
-
create
public static CalciteMetaImpl create(CalciteConnection connection, CalciteMetaTableFactory metaTableFactory, CalciteMetaColumnFactory metaColumnFactory) Creates a CalciteMetaImpl.- Parameters:
connection
- Calcite connectionmetaTableFactory
- Factory for creating MetaTable (or subclass)metaColumnFactory
- Factory for creating MetaColumn (or subclass)
-
likeToRegex
Converts a LIKE-style pattern (where '%' represents a wild-card, escaped using '\') to a Java regex. -
createStatement
public org.apache.calcite.avatica.Meta.StatementHandle createStatement(org.apache.calcite.avatica.Meta.ConnectionHandle ch) - Specified by:
createStatement
in interfaceorg.apache.calcite.avatica.Meta
- Overrides:
createStatement
in classorg.apache.calcite.avatica.MetaImpl
-
closeStatement
public void closeStatement(org.apache.calcite.avatica.Meta.StatementHandle h) -
createResultSet
protected org.apache.calcite.avatica.Meta.MetaResultSet createResultSet(Map<String, Object> internalParameters, List<org.apache.calcite.avatica.ColumnMetaData> columns, org.apache.calcite.avatica.Meta.CursorFactory cursorFactory, org.apache.calcite.avatica.Meta.Frame firstFrame) - Overrides:
createResultSet
in classorg.apache.calcite.avatica.MetaImpl
-
getDatabaseProperties
public Map<org.apache.calcite.avatica.Meta.DatabaseProperty,Object> getDatabaseProperties(org.apache.calcite.avatica.Meta.ConnectionHandle ch) - Specified by:
getDatabaseProperties
in interfaceorg.apache.calcite.avatica.Meta
- Overrides:
getDatabaseProperties
in classorg.apache.calcite.avatica.MetaImpl
-
getTables
public org.apache.calcite.avatica.Meta.MetaResultSet getTables(org.apache.calcite.avatica.Meta.ConnectionHandle ch, String catalog, org.apache.calcite.avatica.Meta.Pat schemaPattern, org.apache.calcite.avatica.Meta.Pat tableNamePattern, List<String> typeList) - Specified by:
getTables
in interfaceorg.apache.calcite.avatica.Meta
- Overrides:
getTables
in classorg.apache.calcite.avatica.MetaImpl
-
getTypeInfo
public org.apache.calcite.avatica.Meta.MetaResultSet getTypeInfo(org.apache.calcite.avatica.Meta.ConnectionHandle ch) - Specified by:
getTypeInfo
in interfaceorg.apache.calcite.avatica.Meta
- Overrides:
getTypeInfo
in classorg.apache.calcite.avatica.MetaImpl
-
getColumns
public org.apache.calcite.avatica.Meta.MetaResultSet getColumns(org.apache.calcite.avatica.Meta.ConnectionHandle ch, String catalog, org.apache.calcite.avatica.Meta.Pat schemaPattern, org.apache.calcite.avatica.Meta.Pat tableNamePattern, org.apache.calcite.avatica.Meta.Pat columnNamePattern) - Specified by:
getColumns
in interfaceorg.apache.calcite.avatica.Meta
- Overrides:
getColumns
in classorg.apache.calcite.avatica.MetaImpl
-
allTypeInfo
-
columns
public Enumerable<org.apache.calcite.avatica.MetaImpl.MetaColumn> columns(org.apache.calcite.avatica.MetaImpl.MetaTable table_) -
getSchemas
public org.apache.calcite.avatica.Meta.MetaResultSet getSchemas(org.apache.calcite.avatica.Meta.ConnectionHandle ch, String catalog, org.apache.calcite.avatica.Meta.Pat schemaPattern) - Specified by:
getSchemas
in interfaceorg.apache.calcite.avatica.Meta
- Overrides:
getSchemas
in classorg.apache.calcite.avatica.MetaImpl
-
getCatalogs
public org.apache.calcite.avatica.Meta.MetaResultSet getCatalogs(org.apache.calcite.avatica.Meta.ConnectionHandle ch) - Specified by:
getCatalogs
in interfaceorg.apache.calcite.avatica.Meta
- Overrides:
getCatalogs
in classorg.apache.calcite.avatica.MetaImpl
-
getTableTypes
public org.apache.calcite.avatica.Meta.MetaResultSet getTableTypes(org.apache.calcite.avatica.Meta.ConnectionHandle ch) - Specified by:
getTableTypes
in interfaceorg.apache.calcite.avatica.Meta
- Overrides:
getTableTypes
in classorg.apache.calcite.avatica.MetaImpl
-
getFunctions
public org.apache.calcite.avatica.Meta.MetaResultSet getFunctions(org.apache.calcite.avatica.Meta.ConnectionHandle ch, String catalog, org.apache.calcite.avatica.Meta.Pat schemaPattern, org.apache.calcite.avatica.Meta.Pat functionNamePattern) - Specified by:
getFunctions
in interfaceorg.apache.calcite.avatica.Meta
- Overrides:
getFunctions
in classorg.apache.calcite.avatica.MetaImpl
-
createIterable
public Iterable<Object> createIterable(org.apache.calcite.avatica.Meta.StatementHandle handle, org.apache.calcite.avatica.QueryState state, org.apache.calcite.avatica.Meta.Signature signature, @Nullable List<org.apache.calcite.avatica.remote.TypedValue> parameterValues, @Nullable org.apache.calcite.avatica.Meta.Frame firstFrame) - Specified by:
createIterable
in interfaceorg.apache.calcite.avatica.Meta
- Overrides:
createIterable
in classorg.apache.calcite.avatica.MetaImpl
-
prepare
public org.apache.calcite.avatica.Meta.StatementHandle prepare(org.apache.calcite.avatica.Meta.ConnectionHandle ch, String sql, long maxRowCount) -
prepareAndExecute
public org.apache.calcite.avatica.Meta.ExecuteResult prepareAndExecute(org.apache.calcite.avatica.Meta.StatementHandle h, String sql, long maxRowCount, org.apache.calcite.avatica.Meta.PrepareCallback callback) throws org.apache.calcite.avatica.NoSuchStatementException - Throws:
org.apache.calcite.avatica.NoSuchStatementException
-
prepareAndExecute
public org.apache.calcite.avatica.Meta.ExecuteResult prepareAndExecute(org.apache.calcite.avatica.Meta.StatementHandle h, String sql, long maxRowCount, int maxRowsInFirstFrame, org.apache.calcite.avatica.Meta.PrepareCallback callback) throws org.apache.calcite.avatica.NoSuchStatementException - Throws:
org.apache.calcite.avatica.NoSuchStatementException
-
fetch
public org.apache.calcite.avatica.Meta.Frame fetch(org.apache.calcite.avatica.Meta.StatementHandle h, long offset, int fetchMaxRowCount) throws org.apache.calcite.avatica.NoSuchStatementException - Throws:
org.apache.calcite.avatica.NoSuchStatementException
-
execute
public org.apache.calcite.avatica.Meta.ExecuteResult execute(org.apache.calcite.avatica.Meta.StatementHandle h, List<org.apache.calcite.avatica.remote.TypedValue> parameterValues, long maxRowCount) throws org.apache.calcite.avatica.NoSuchStatementException - Throws:
org.apache.calcite.avatica.NoSuchStatementException
-
execute
public org.apache.calcite.avatica.Meta.ExecuteResult execute(org.apache.calcite.avatica.Meta.StatementHandle h, List<org.apache.calcite.avatica.remote.TypedValue> parameterValues, int maxRowsInFirstFrame) throws org.apache.calcite.avatica.NoSuchStatementException - Throws:
org.apache.calcite.avatica.NoSuchStatementException
-
executeBatch
public org.apache.calcite.avatica.Meta.ExecuteBatchResult executeBatch(org.apache.calcite.avatica.Meta.StatementHandle h, List<List<org.apache.calcite.avatica.remote.TypedValue>> parameterValueLists) throws org.apache.calcite.avatica.NoSuchStatementException - Throws:
org.apache.calcite.avatica.NoSuchStatementException
-
prepareAndExecuteBatch
public org.apache.calcite.avatica.Meta.ExecuteBatchResult prepareAndExecuteBatch(org.apache.calcite.avatica.Meta.StatementHandle h, List<String> sqlCommands) throws org.apache.calcite.avatica.NoSuchStatementException - Throws:
org.apache.calcite.avatica.NoSuchStatementException
-
createDataContext
A trojan-horse method, subject to change without notice. -
connect
public static CalciteConnection connect(CalciteSchema schema, @Nullable JavaTypeFactory typeFactory) A trojan-horse method, subject to change without notice. -
syncResults
public boolean syncResults(org.apache.calcite.avatica.Meta.StatementHandle h, org.apache.calcite.avatica.QueryState state, long offset) -
commit
public void commit(org.apache.calcite.avatica.Meta.ConnectionHandle ch) -
rollback
public void rollback(org.apache.calcite.avatica.Meta.ConnectionHandle ch)
-
create(CalciteConnection)
instead.