Package org.apache.druid.sql.avatica
Class DruidMeta
java.lang.Object
org.apache.calcite.avatica.MetaImpl
org.apache.druid.sql.avatica.DruidMeta
- All Implemented Interfaces:
org.apache.calcite.avatica.Meta
public class DruidMeta
extends org.apache.calcite.avatica.MetaImpl
-
Nested Class Summary
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.NamedNested 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
Fields inherited from class org.apache.calcite.avatica.MetaImpl
connection, connProps -
Constructor Summary
ConstructorsConstructorDescriptionDruidMeta(SqlStatementFactory sqlStatementFactory, QueryConfigProvider queryConfigProvider, org.apache.druid.sql.avatica.AvaticaServerConfig config, org.apache.druid.sql.avatica.ErrorHandler errorHandler, ScheduledExecutorService exec, List<Authenticator> authenticators, DruidJdbcResultSet.ResultFetcherFactory fetcherFactory) DruidMeta(SqlStatementFactory sqlStatementFactory, QueryConfigProvider queryConfigProvider, org.apache.druid.sql.avatica.AvaticaServerConfig config, org.apache.druid.sql.avatica.ErrorHandler errorHandler, AuthenticatorMapper authMapper) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcloseConnection(org.apache.calcite.avatica.Meta.ConnectionHandle ch) voidcloseStatement(org.apache.calcite.avatica.Meta.StatementHandle h) voidcommit(org.apache.calcite.avatica.Meta.ConnectionHandle ch) org.apache.calcite.avatica.Meta.ConnectionPropertiesconnectionSync(org.apache.calcite.avatica.Meta.ConnectionHandle ch, org.apache.calcite.avatica.Meta.ConnectionProperties connProps) createIterable(org.apache.calcite.avatica.Meta.StatementHandle statement, org.apache.calcite.avatica.QueryState state, org.apache.calcite.avatica.Meta.Signature signature, List<org.apache.calcite.avatica.remote.TypedValue> parameterValues, org.apache.calcite.avatica.Meta.Frame firstFrame) org.apache.calcite.avatica.Meta.StatementHandlecreateStatement(org.apache.calcite.avatica.Meta.ConnectionHandle ch) Creates a new implementation of the one-pass JDBCStatementclass.protected org.apache.calcite.avatica.Meta.ExecuteResultdoFetch(AbstractDruidJdbcStatement druidStatement, int maxRows) org.apache.calcite.avatica.Meta.ExecuteResultexecute(org.apache.calcite.avatica.Meta.StatementHandle statement, List<org.apache.calcite.avatica.remote.TypedValue> parameterValues, int maxRowsInFirstFrame) org.apache.calcite.avatica.Meta.ExecuteResultexecute(org.apache.calcite.avatica.Meta.StatementHandle statement, List<org.apache.calcite.avatica.remote.TypedValue> parameterValues, long maxRowCount) Deprecated.org.apache.calcite.avatica.Meta.ExecuteBatchResultexecuteBatch(org.apache.calcite.avatica.Meta.StatementHandle statement, List<List<org.apache.calcite.avatica.remote.TypedValue>> parameterValues) org.apache.calcite.avatica.Meta.Framefetch(org.apache.calcite.avatica.Meta.StatementHandle statement, long offset, int fetchMaxRowCount) org.apache.calcite.avatica.Meta.MetaResultSetgetCatalogs(org.apache.calcite.avatica.Meta.ConnectionHandle ch) org.apache.calcite.avatica.Meta.MetaResultSetgetColumns(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.MetaResultSetgetSchemas(org.apache.calcite.avatica.Meta.ConnectionHandle ch, String catalog, org.apache.calcite.avatica.Meta.Pat schemaPattern) org.apache.calcite.avatica.Meta.MetaResultSetgetTables(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.MetaResultSetgetTableTypes(org.apache.calcite.avatica.Meta.ConnectionHandle ch) static <T extends Throwable>
TlogFailure(T error) Logs any throwable at the error level with the throwables message.static <T extends Throwable>
TlogFailure(T error, String message, Object... format) Logs any throwable and string format message with args at the error level.voidopenConnection(org.apache.calcite.avatica.Meta.ConnectionHandle ch, Map<String, String> info) org.apache.calcite.avatica.Meta.StatementHandleCreates a new implementation of the JDBCPreparedStatementclass which allows preparing once, executing many times.org.apache.calcite.avatica.Meta.ExecuteResultprepareAndExecute(org.apache.calcite.avatica.Meta.StatementHandle statement, String sql, long maxRowCount, int maxRowsInFirstFrame, org.apache.calcite.avatica.Meta.PrepareCallback callback) Prepares and executes a JDBCStatement.org.apache.calcite.avatica.Meta.ExecuteResultprepareAndExecute(org.apache.calcite.avatica.Meta.StatementHandle h, String sql, long maxRowCount, org.apache.calcite.avatica.Meta.PrepareCallback callback) Deprecated.org.apache.calcite.avatica.Meta.ExecuteBatchResultprepareAndExecuteBatch(org.apache.calcite.avatica.Meta.StatementHandle statement, List<String> sqlCommands) voidrollback(org.apache.calcite.avatica.Meta.ConnectionHandle ch) voidstop()booleansyncResults(org.apache.calcite.avatica.Meta.StatementHandle sh, org.apache.calcite.avatica.QueryState state, long offset) Methods inherited from class org.apache.calcite.avatica.MetaImpl
checkParameterValueHasNull, collect, collect, columnMetaData, columnMetaData, columnMetaData, columnMetaData, columnMetaData, columnMetaData, createCursor, createEmptyResultSet, createResultSet, fetch, fieldMetaData, getAttributes, getBestRowIdentifier, getClientInfoProperties, getColumnNullability, getColumnPrivileges, getCrossReference, getExportedKeys, getFunctionColumns, getFunctions, getImportedKeys, getIndexInfo, getPrimaryKeys, getProcedureColumns, getProcedures, getPseudoColumns, getSuperTables, getSuperTypes, getTablePrivileges, getTypeInfo, getUDTs, getVersionColumns
-
Constructor Details
-
DruidMeta
@Inject public DruidMeta(SqlStatementFactory sqlStatementFactory, QueryConfigProvider queryConfigProvider, org.apache.druid.sql.avatica.AvaticaServerConfig config, org.apache.druid.sql.avatica.ErrorHandler errorHandler, AuthenticatorMapper authMapper) -
DruidMeta
public DruidMeta(SqlStatementFactory sqlStatementFactory, QueryConfigProvider queryConfigProvider, org.apache.druid.sql.avatica.AvaticaServerConfig config, org.apache.druid.sql.avatica.ErrorHandler errorHandler, ScheduledExecutorService exec, List<Authenticator> authenticators, DruidJdbcResultSet.ResultFetcherFactory fetcherFactory)
-
-
Method Details
-
logFailure
Logs any throwable and string format message with args at the error level.- Type Parameters:
T- any type that extends throwable- Parameters:
error- the Throwable to be loggedmessage- the message to be logged. Can be in string format structureformat- the format arguments for the format message string- Returns:
- the original Throwable
-
logFailure
Logs any throwable at the error level with the throwables message.- Type Parameters:
T- any type that extends throwable- Parameters:
error- the throwable to be logged- Returns:
- the original Throwable
-
stop
- Throws:
InterruptedException
-
openConnection
public void openConnection(org.apache.calcite.avatica.Meta.ConnectionHandle ch, Map<String, String> info) - Specified by:
openConnectionin interfaceorg.apache.calcite.avatica.Meta- Overrides:
openConnectionin classorg.apache.calcite.avatica.MetaImpl
-
closeConnection
public void closeConnection(org.apache.calcite.avatica.Meta.ConnectionHandle ch) - Specified by:
closeConnectionin interfaceorg.apache.calcite.avatica.Meta- Overrides:
closeConnectionin classorg.apache.calcite.avatica.MetaImpl
-
connectionSync
public org.apache.calcite.avatica.Meta.ConnectionProperties connectionSync(org.apache.calcite.avatica.Meta.ConnectionHandle ch, org.apache.calcite.avatica.Meta.ConnectionProperties connProps) - Specified by:
connectionSyncin interfaceorg.apache.calcite.avatica.Meta- Overrides:
connectionSyncin classorg.apache.calcite.avatica.MetaImpl
-
createStatement
public org.apache.calcite.avatica.Meta.StatementHandle createStatement(org.apache.calcite.avatica.Meta.ConnectionHandle ch) Creates a new implementation of the one-pass JDBCStatementclass. Corresponds to the JDBCConnection.createStatement()method.- Specified by:
createStatementin interfaceorg.apache.calcite.avatica.Meta- Overrides:
createStatementin 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) Creates a new implementation of the JDBCPreparedStatementclass which allows preparing once, executing many times. Corresponds to the JDBCConnection.prepareStatement()call. -
prepareAndExecute
@Deprecated 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) Deprecated. -
prepareAndExecute
public org.apache.calcite.avatica.Meta.ExecuteResult prepareAndExecute(org.apache.calcite.avatica.Meta.StatementHandle statement, String sql, long maxRowCount, int maxRowsInFirstFrame, org.apache.calcite.avatica.Meta.PrepareCallback callback) Prepares and executes a JDBCStatement. -
doFetch
protected org.apache.calcite.avatica.Meta.ExecuteResult doFetch(AbstractDruidJdbcStatement druidStatement, int maxRows) -
prepareAndExecuteBatch
-
executeBatch
-
fetch
public org.apache.calcite.avatica.Meta.Frame fetch(org.apache.calcite.avatica.Meta.StatementHandle statement, long offset, int fetchMaxRowCount) throws org.apache.calcite.avatica.NoSuchStatementException, org.apache.calcite.avatica.MissingResultsException - Throws:
org.apache.calcite.avatica.NoSuchStatementExceptionorg.apache.calcite.avatica.MissingResultsException
-
execute
@Deprecated public org.apache.calcite.avatica.Meta.ExecuteResult execute(org.apache.calcite.avatica.Meta.StatementHandle statement, List<org.apache.calcite.avatica.remote.TypedValue> parameterValues, long maxRowCount) Deprecated. -
execute
public org.apache.calcite.avatica.Meta.ExecuteResult execute(org.apache.calcite.avatica.Meta.StatementHandle statement, List<org.apache.calcite.avatica.remote.TypedValue> parameterValues, int maxRowsInFirstFrame) -
createIterable
public Iterable<Object> createIterable(org.apache.calcite.avatica.Meta.StatementHandle statement, org.apache.calcite.avatica.QueryState state, org.apache.calcite.avatica.Meta.Signature signature, List<org.apache.calcite.avatica.remote.TypedValue> parameterValues, org.apache.calcite.avatica.Meta.Frame firstFrame) - Specified by:
createIterablein interfaceorg.apache.calcite.avatica.Meta- Overrides:
createIterablein classorg.apache.calcite.avatica.MetaImpl
-
closeStatement
public void closeStatement(org.apache.calcite.avatica.Meta.StatementHandle h) -
syncResults
public boolean syncResults(org.apache.calcite.avatica.Meta.StatementHandle sh, 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) -
getDatabaseProperties
public Map<org.apache.calcite.avatica.Meta.DatabaseProperty,Object> getDatabaseProperties(org.apache.calcite.avatica.Meta.ConnectionHandle ch) - Specified by:
getDatabasePropertiesin interfaceorg.apache.calcite.avatica.Meta- Overrides:
getDatabasePropertiesin classorg.apache.calcite.avatica.MetaImpl
-
getCatalogs
public org.apache.calcite.avatica.Meta.MetaResultSet getCatalogs(org.apache.calcite.avatica.Meta.ConnectionHandle ch) - Specified by:
getCatalogsin interfaceorg.apache.calcite.avatica.Meta- Overrides:
getCatalogsin classorg.apache.calcite.avatica.MetaImpl
-
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:
getSchemasin interfaceorg.apache.calcite.avatica.Meta- Overrides:
getSchemasin 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:
getTablesin interfaceorg.apache.calcite.avatica.Meta- Overrides:
getTablesin 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:
getColumnsin interfaceorg.apache.calcite.avatica.Meta- Overrides:
getColumnsin classorg.apache.calcite.avatica.MetaImpl
-
getTableTypes
public org.apache.calcite.avatica.Meta.MetaResultSet getTableTypes(org.apache.calcite.avatica.Meta.ConnectionHandle ch) - Specified by:
getTableTypesin interfaceorg.apache.calcite.avatica.Meta- Overrides:
getTableTypesin classorg.apache.calcite.avatica.MetaImpl
-
closeAllConnections
public void closeAllConnections()
-