Class ImportIntoTemporaryTableQueryRewriter
- java.lang.Object
-
- com.exasol.adapter.dialects.rewriting.AbstractQueryRewriter
-
- com.exasol.adapter.dialects.rewriting.ImportIntoTemporaryTableQueryRewriter
-
- All Implemented Interfaces:
QueryRewriter
public class ImportIntoTemporaryTableQueryRewriter extends AbstractQueryRewriter
Implementation ofAbstractQueryRewriterto generateIMPORT INTO (<columns description>) FROM JDBCqueries.- See Also:
- https://docs.exasol.com/sql/import.htm
-
-
Field Summary
Fields Modifier and Type Field Description protected ConnectionFactoryconnectionFactoryJDBC connection factory-
Fields inherited from class com.exasol.adapter.dialects.rewriting.AbstractQueryRewriter
connectionDefinitionBuilder, dialect, remoteMetadataReader
-
-
Constructor Summary
Constructors Constructor Description ImportIntoTemporaryTableQueryRewriter(SqlDialect dialect, RemoteMetadataReader remoteMetadataReader, ConnectionFactory connectionFactory)Construct a new instance ofImportIntoTemporaryTableQueryRewriter.ImportIntoTemporaryTableQueryRewriter(SqlDialect dialect, RemoteMetadataReader remoteMetadataReader, ConnectionFactory connectionFactory, ConnectionDefinitionBuilder connectionDefinitionBuilder)Construct a new instance ofImportIntoTemporaryTableQueryRewriter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgenerateImportStatement(String connectionDefinition, String pushdownQuery)Generate an IMPORT statement to be executed in the Exasol database, using the passed pushdown query to be executed in the external source be as source data.protected StringgenerateImportStatement(String connectionDefinition, List<com.exasol.adapter.metadata.DataType> selectListDataTypes, String pushdownQuery)This method provides backwards compatibility.-
Methods inherited from class com.exasol.adapter.dialects.rewriting.AbstractQueryRewriter
getConnectionInformation, rewrite
-
-
-
-
Field Detail
-
connectionFactory
protected final ConnectionFactory connectionFactory
JDBC connection factory
-
-
Constructor Detail
-
ImportIntoTemporaryTableQueryRewriter
public ImportIntoTemporaryTableQueryRewriter(SqlDialect dialect, RemoteMetadataReader remoteMetadataReader, ConnectionFactory connectionFactory)
Construct a new instance ofImportIntoTemporaryTableQueryRewriter.- Parameters:
dialect- dialectremoteMetadataReader- remote metadata readerconnectionFactory- factory for the JDBC connection to remote data source
-
ImportIntoTemporaryTableQueryRewriter
public ImportIntoTemporaryTableQueryRewriter(SqlDialect dialect, RemoteMetadataReader remoteMetadataReader, ConnectionFactory connectionFactory, ConnectionDefinitionBuilder connectionDefinitionBuilder)
Construct a new instance ofImportIntoTemporaryTableQueryRewriter.- Parameters:
dialect- dialectremoteMetadataReader- remote metadata readerconnectionFactory- factory for the JDBC connection to remote data sourceconnectionDefinitionBuilder- custom connection definition builder
-
-
Method Detail
-
generateImportStatement
protected String generateImportStatement(String connectionDefinition, List<com.exasol.adapter.metadata.DataType> selectListDataTypes, String pushdownQuery) throws SQLException
Description copied from class:AbstractQueryRewriterThis method provides backwards compatibility. A class extending theAbstractQueryRewriterhas two options:- Option (O1): override the new method
AbstractQueryRewriter.generateImportStatement(String, List, String)enabling to use the new parameterselectListDataTypesto determine the data types of the result set of the query. - Option (O2): only override the old method
AbstractQueryRewriter.generateImportStatement(String, String)and by that falling back to the old way, i.e. inferring the data types of the result set by inspecting its values.
- Overrides:
generateImportStatementin classAbstractQueryRewriter- Parameters:
connectionDefinition- connection definition to be used when connecting to the external sourceselectListDataTypes- expected data types of result setpushdownQuery- source data for the `IMPORT...FROM` statement- Returns:
- IMPORT statement to be executed on the Exasol database
- Throws:
SQLException- if any problem occurs
- Option (O1): override the new method
-
generateImportStatement
protected String generateImportStatement(String connectionDefinition, String pushdownQuery) throws SQLException
Description copied from class:AbstractQueryRewriterGenerate an IMPORT statement to be executed in the Exasol database, using the passed pushdown query to be executed in the external source be as source data.- Specified by:
generateImportStatementin classAbstractQueryRewriter- Parameters:
connectionDefinition- connection definition to be used when connecting to the external sourcepushdownQuery- source data for the `IMPORT...FROM` statement- Returns:
- IMPORT statement to be executed on the Exasol database
- Throws:
SQLException- if any problem occurs
-
-