Class RedshiftMetadataHandler
- java.lang.Object
-
- com.amazonaws.athena.connector.lambda.handlers.MetadataHandler
-
- com.amazonaws.athena.connectors.jdbc.manager.JdbcMetadataHandler
-
- com.amazonaws.athena.connectors.postgresql.PostGreSqlMetadataHandler
-
- com.amazonaws.athena.connectors.redshift.RedshiftMetadataHandler
-
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestStreamHandler
public class RedshiftMetadataHandler extends PostGreSqlMetadataHandler
Handles metadata for PostGreSql. User must have access to `schemata`, `tables`, `columns`, `partitions` tables in information_schema.
-
-
Field Summary
-
Fields inherited from class com.amazonaws.athena.connectors.postgresql.PostGreSqlMetadataHandler
ALL_PARTITIONS, BLOCK_PARTITION_COLUMN_NAME, BLOCK_PARTITION_SCHEMA_COLUMN_NAME, GET_PARTITIONS_QUERY, JDBC_PROPERTIES, NON_DEFAULT_COLLATE
-
Fields inherited from class com.amazonaws.athena.connectors.jdbc.manager.JdbcMetadataHandler
jdbcQueryPassthrough, TABLES_AND_VIEWS
-
Fields inherited from class com.amazonaws.athena.connector.lambda.handlers.MetadataHandler
configOptions, DISABLE_SPILL_ENCRYPTION, KMS_KEY_ID_ENV, SPILL_BUCKET_ENV, SPILL_PREFIX_ENV
-
-
Constructor Summary
Constructors Constructor Description RedshiftMetadataHandler(DatabaseConnectionConfig databaseConnectionConfig, Map<String,String> configOptions)
RedshiftMetadataHandler(Map<String,String> configOptions)
Instantiates handler to be used by Lambda function directly.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
caseInsensitiveSchemaResolver(Connection connection, String databaseName)
GetDataSourceCapabilitiesResponse
doGetDataSourceCapabilities(BlockAllocator allocator, GetDataSourceCapabilitiesRequest request)
Used to describe the types of capabilities supported by a data source.protected PreparedStatement
getMaterializedViewOrExternalTable(Connection connection, String tableName, String databaseName)
Returns Materialized View for Postgresql Or External Tables for Redshift - Case Insensitive Note: Redshift maintain Materialized View in the normal schema metadata as regular tables; however maintains External Tables in a separate metadata tablesprotected List<TableName>
getPaginatedResults(Connection connection, String databaseName, int token, int limit)
-
Methods inherited from class com.amazonaws.athena.connectors.postgresql.PostGreSqlMetadataHandler
caseInsensitiveNameResolver, caseInsensitiveTableMaterialViewMatch, caseInsensitiveTableSearch, doGetSplits, getArrayArrowTypeFromTypeName, getCharColumns, getPartitions, getPartitionSchema, listPaginatedTables, listTables
-
Methods inherited from class com.amazonaws.athena.connectors.jdbc.manager.JdbcMetadataHandler
convertDatasourceTypeToArrow, doGetQueryPassthroughSchema, doGetTable, doListSchemaNames, doListTables, escapeNamePattern, getCredentialProvider, getJdbcConnectionFactory, getSplitClauses, setupQueryPassthroughSplit
-
Methods inherited from class com.amazonaws.athena.connector.lambda.handlers.MetadataHandler
doGetTableLayout, doHandleRequest, doPing, enhancePartitionSchema, getSecret, handleRequest, makeEncryptionKey, makeSpillLocation, onPing, resolveSecrets
-
-
-
-
Constructor Detail
-
RedshiftMetadataHandler
public RedshiftMetadataHandler(Map<String,String> configOptions)
Instantiates handler to be used by Lambda function directly. Recommend usingRedshiftMuxCompositeHandler
instead.
-
RedshiftMetadataHandler
public RedshiftMetadataHandler(DatabaseConnectionConfig databaseConnectionConfig, Map<String,String> configOptions)
-
-
Method Detail
-
caseInsensitiveSchemaResolver
public String caseInsensitiveSchemaResolver(Connection connection, String databaseName) throws SQLException
- Overrides:
caseInsensitiveSchemaResolver
in classPostGreSqlMetadataHandler
- Throws:
SQLException
-
doGetDataSourceCapabilities
public GetDataSourceCapabilitiesResponse doGetDataSourceCapabilities(BlockAllocator allocator, GetDataSourceCapabilitiesRequest request)
Description copied from class:MetadataHandler
Used to describe the types of capabilities supported by a data source. An engine can use this to determine what portions of the query to push down. A connector that returns any optimization will guarantee that the associated predicate will be pushed down.- Overrides:
doGetDataSourceCapabilities
in classPostGreSqlMetadataHandler
- Parameters:
allocator
- Tool for creating and managing Apache Arrow Blocks.request
- Provides details about the catalog being used.- Returns:
- A GetDataSourceCapabilitiesResponse object which returns a map of supported optimizations that the connector is advertising to the consumer. The connector assumes all responsibility for whatever is passed here.
-
getPaginatedResults
protected List<TableName> getPaginatedResults(Connection connection, String databaseName, int token, int limit) throws SQLException
- Overrides:
getPaginatedResults
in classPostGreSqlMetadataHandler
- Throws:
SQLException
-
getMaterializedViewOrExternalTable
protected PreparedStatement getMaterializedViewOrExternalTable(Connection connection, String tableName, String databaseName) throws SQLException
Description copied from class:PostGreSqlMetadataHandler
Returns Materialized View for Postgresql Or External Tables for Redshift - Case Insensitive Note: Redshift maintain Materialized View in the normal schema metadata as regular tables; however maintains External Tables in a separate metadata tables- Overrides:
getMaterializedViewOrExternalTable
in classPostGreSqlMetadataHandler
- Returns:
- Prepared Statement
- Throws:
SQLException
-
-