Skip to content

Issues Querying Redshift Data Catalog in SageMaker Unified Studio

0

Hello everyone,

I'm encountering some difficulties while querying my Redshift database using SageMaker Unified Studio.

I successfully registered and created the Redshift catalog in the Lakehouse by following this demo and this AWS blog.

However, when I attempt to query my Redshift data catalog:

I cannot use the Redshift Engine. When selecting the Athena Engine, I receive the following error: [ErrorCode: INTERNAL_ERROR_QUERY_ENGINE] Amazon Athena experienced an internal error while executing this query. Please contact AWS support for further assistance. You will not be charged for this query. We apologize for the inconvenience.

I've attached a screenshot of the issue. Enter image description here

Has anyone experienced this before or knows how to resolve it? Any help would be greatly appreciated!

Thanks!

  • The sagemaker unified studio role has the AmazonRedhisftFullAccess Policy

1 Answer
0

I apologize for the difficulties you're experiencing with querying your Redshift data catalog in SageMaker Unified Studio. Based on the information provided, there are a few potential issues and solutions to consider:

  1. Access and Permissions: Ensure that the access role for Amazon SageMaker Unified Studio has the necessary permissions to query Amazon Redshift. The role should include permissions for actions like "redshift:GetClusterCredentialsWithIAM", "redshift:GetClusterCredentials", "redshift:DescribeClusters", and "redshift-serverless:GetCredentials" among others.

  2. Network Configuration: Verify that your SageMaker Unified Studio and Amazon Redshift are in the same VPC or have proper network connectivity set up. A connection timeout could indicate networking issues.

  3. Database and Query Validation: Double-check that you've specified the correct database name and that your SQL query is valid. Incorrect database names or invalid queries can lead to execution errors.

  4. Size Limitations: Be aware that there are size limitations for query results. Each row in a result set should be 64 KB or less, and the total result set should not exceed 100 MB. If your query is returning large amounts of data, you may need to modify it to return smaller result sets.

  5. Cross-Region Limitations: Note that cross-Region data sharing using Amazon Redshift is not supported in SageMaker Unified Studio. Ensure your Redshift cluster and SageMaker Unified Studio are in the same region.

  6. Athena Engine Error: The specific error you're encountering with the Athena engine suggests an internal issue. In this case, it's recommended to contact AWS support for further assistance, especially if you have AWS Premium Support.

If these steps don't resolve the issue, you may need to review your Redshift cluster's configuration, including security groups and network settings. Also, ensure that the necessary tags have been added to your Redshift cluster or workgroup to enable access from SageMaker Unified Studio.

Remember to verify all connection details, including the cluster ID, port number (usually 5439 for Redshift), and credentials. If you're still unable to resolve the issue, consider reaching out to AWS support for more detailed troubleshooting.
Sources
Gaining access to Amazon Redshift resources - Amazon SageMaker Unified Studio
Troubleshooting Amazon Redshift Issues - Amazon Machine Learning
Grant access to managed Amazon Redshift assets in Amazon SageMaker Unified Studio - Amazon SageMaker Unified Studio
Troubleshooting issues for Amazon Redshift Data API - Amazon Redshift
SageMaker notebook failed to make connection with RedShift Cluster | AWS re:Post

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.