- Newest
- Most votes
- Most comments
The error you are encountering, "COLUMN_NOT_FOUND: Column 'anonymousid' cannot be resolved or requester is not authorized to access requested resources" suggests that there might be an issue with 1/ how the column name is being referenced in your query or 2/ with the permissions granted to your user for accessing that column in Amazon Athena.
Here are a some ways to troubleshoot:
- Check Column Name Casing: Athena is case-sensitive when it comes to column names. You mentioned that the column is named
anonymousIdbut the error message showsanonymousid(without the capital 'I'). Make sure you are using the exact same casing when referencing the column in your query. - Permissions: Verify that your user has the necessary permissions to access the
anonymousIdcolumn in Athena. Permissions can be controlled using AWS Identity and Access Management (IAM) roles and policies. Ensure that your IAM role or user has the appropriate permissions to read the data in that column. - Data Type Compatibility: Ensure that the data type of the 'anonymousId' column in your query matches the actual data type of the column in your table. Data type mismatches can also result in errors.
UPDATE TO EXISTING ANSWER: The existing answer states that "Athena is case-sensitive when it comes to column names." This was true for Athena engine version 2 (Presto-based) but is no longer the case with Athena engine version 3 (Trino-based), which is the current default engine.
Background: This was a known issue in Athena v2 Athena engine v2 was built on PrestoDB, which had a known limitation with mixed-case column names. The Hive metastore (AWS Glue Data Catalog) lowercases all column names, and when Presto tried to match those lowercase names against the original mixed-case names in the underlying data files, it could fail with errors like COLUMN_NOT_FOUND or silently return NULL values.
This is documented in AWS documentation in [Athena schema updates documentation](https://docs.aws.amazon.com/athena/ latest/ug/handling-schema-updates-chapter.html):
│ "In Athena engine version 2, when ORC tables are set to read by name, Athena requires that all column names in the ORC files be in lower case. Because Apache Spark does not lowercase field names when it generates ORC files, Athena might not be able to read the data so generated. The workaround is to rename the columns to be in lower case, or use Athena engine version 3."
The upstream PrestoDB issue is also documented in prestodb/presto#1802.
This is resolved in Athena engine v3
Athena engine v3 is based on Trino, which performs case-insensitive column name matching. I verified this by creating tables with mixed-case column names (e.g., FirstName, Age in the data files, stored as firstname, age in the Glue Data Catalog) and querying them through Athena v3. Results across all major formats:
| File Format | Column in data file | Column in Glue Catalog | Athena v3 SELECT |
|---|---|---|---|
| Apache Parquet | FirstName, Age | firstname, age | ✅ All data returned correctly |
| JSON (JsonSerDe) | FirstName, Age | firstname, age | ✅ All data returned correctly |
| JSON (JsonSerDe) | FIRSTNAME, AGE | firstname, age | ✅ All data returned correctly |
| CSV (LazySimpleSerDe) | N/A (positional) | firstname, age | ✅ All data returned correctly |
| Apache Iceberg | FirstName, Age | firstname, age | ✅ All data returned correctly |
No COLUMN_NOT_FOUND errors or NULL values in any case.
What likely caused your specific error
Since the case sensitivity issue is resolved in Athena v3, the COLUMN_NOT_FOUND: Column 'anonymousid' cannot be resolved error you encountered was most likely caused by one of the following:
- You were using Athena engine v2 — If your workgroup was still configured to use engine v2 at the time, the case mismatch between anonymousId in your data and anonymousid in the Glue catalog would cause this exact error. Upgrading to engine v3 (now the default) resolves this.
- The column doesn't exist in the Glue table schema — Verify the column is listed in your table definition by running: aws glue get-table --database-name <your-db> --name <your-table> and checking the Columns section.
- AWS Lake Formation permissions — If Lake Formation is enabled, column-level data filters may be silently excluding access to specific columns, resulting in this same error message.
Recommendation: Check which Athena engine version your workgroup is using. If you're still on v2, switching to v3 will resolve case-sensitivity issues with column names. You can check this in the Athena console under Workgroups → select your workgroup → Engine version.
Tested on Athena engine version 3, March 2026.
Relevant content
- AWS OFFICIALUpdated 5 months ago
