[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A3GMXMXXJKGVFTHPBD8HT4":3,"skill-same:01M7A3GMXMXXJKGVFTHPBD8HT4":153},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M7A3GMXMXXJKGVFTHPBD8HT4","athena-query-failure-troubleshooter",null,"Diagnoses Amazon Athena query failures through a thirteen-category diagnostic tree: S3 bucket access denied (Glue Data Catalog vs S3 data bucket permissions), SerDe mismatch (OpenCSVSerDe vs LazySimpleSerDe vs ParquetHiveSerDe), column type mismatch (STRING vs INT vs DOUBLE), partition projection errors, incorrect table location, stale Glue Catalog partitions (MSCK REPAIR), CTAS (CREATE TABLE AS) destination bucket permissions, workgroup output location, service query timeout (30-min limit), data format inference errors, SerDe property misconfiguration (quoteChar, escapeChar, separatorChar), ARRAY\u002FSTRUCT nested type issues, and date format parsing. Walks symptoms to a verified root cause with evidence-backed probes; emits ROOT_CAUSE_IDENTIFIED or INSUFFICIENT_DATA.","jhkchan\u002Faws-agent-skills","jhkchan","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1083902?v=4","01M7A2SVQYP9GQTPTDXP5JKYQ4","Jacky Chan","01M7A2SVS117YWCTZABB75HZR1",4,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: athena-query-failure-troubleshooter\ndescription: 'Diagnoses Amazon Athena query failures through a thirteen-category diagnostic tree: S3 bucket access denied (Glue Data Catalog vs S3 data bucket permissions), SerDe mismatch (OpenCSVSerDe vs LazySimpleSerDe vs ParquetHiveSerDe), column type mismatch (STRING vs INT vs DOUBLE), partition projection errors, incorrect table location, stale Glue Catalog partitions (MSCK REPAIR), CTAS (CREATE TABLE AS) destination bucket permissions, workgroup output location, service query timeout (30-min limit), data format inference errors, SerDe property misconfiguration (quoteChar, escapeChar, separatorChar), ARRAY\u002FSTRUCT nested type issues, and date format parsing. Walks symptoms to a verified root cause with evidence-backed probes; emits ROOT_CAUSE_IDENTIFIED or INSUFFICIENT_DATA.'\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline symptom classification works from pasted error messages, DDL, and query text. Live-account diagnosis uses aws athena get-query-execution, aws athena get-work-group, aws glue get-table, aws glue get-partitions, aws glue get-database, aws s3 ls \u002F api head-bucket, aws cloudwatch get-metric-statistics on AWS\u002FAthena, and aws logs get-query-results (AWS CLI v2, SSO or key-based credentials).\nmetadata:\n  domain: aws-cloudops\n  complexity: high\n  requires_llm: 'true'\n  phase: '2'\n  supports_pipeline: 'true'\n  entry_point: 'false'\n  family: Analytics\n  task_type: troubleshoot\n  skill_class: capability\n  lifecycle_status: active\n  verdict_shape: ROOT_CAUSE_IDENTIFIED | INSUFFICIENT_DATA\n  when_to_use: Diagnosing an Athena query failure (column returns NULL or wrong values, query returns zero rows unexpectedly, S3 access denied, serde parsing error, column type mismatch, partition projection stale partitions, CTAS destination permission denied, workgroup output location misconfigured, query exceeds 30-minute service timeout, format inference fails, nested ARRAY\u002FSTRUCT type error, or date parsing error), walking a symptom to the failed config layer with verify commands, validating why a \"SELECT * FROM table LIMIT 10\" returns garbled data or empty results, or triaging a \"the Athena query broke\" page where the root cause may be the SerDe, the Glue table definition, the partition metadata, the S3 permission, or the workgroup config — not necessarily the query SQL itself.\n  when_not_to_use: Athena query performance optimization (use the athena-query-optimizer skill), Athena workgroup configuration posture audit (use the athena-workgroup-auditor skill), Glue crawler design or ETL pipeline debugging (use the glue-crawler-job-auditor or glue-job-troubleshooter skills), or Spark on Athena (Athena for Apache Spark) notebook debugging (use the Athena Spark documentation). This skill diagnoses query-time failures; it does not optimize slow-but-successful queries or audit workgroup security posture.\n  activation_triggers: Athena query failed, Athena COLUMN_NOT_FOUND, Athena column returns NULL, Athena zero rows, Athena access denied S3, Athena SerDe error, OpenCSVSerDe Athena, LazySimpleSerDe Athena, column type mismatch Athena, STRING vs INT Athena, partition projection Athena, MSCK REPAIR Athena, stale partitions Athena, CTAS Athena permission denied, CREATE TABLE AS SELECT Athena, workgroup output location Athena, Athena query timeout, Athena 30 minute limit, Athena format inference, nested type ARRAY STRUCT Athena, date parsing Athena, Athena SYNTAX_ERROR, troubleshoot Athena query\n  invocation_schema: 'Input: either (a) a symptom description (error message from get-query-execution, observed behaviour \"column returns NULL\", \"query returns zero rows\", \"CTAS failed with access denied\"), optionally paired with the DDL (CREATE TABLE statement), the query text, and the workgroup name, OR (b) a QueryExecutionId plus region for live-account diagnosis. Output: a deterministic TARGET\u002FVERDICT\u002FREASON\u002FLAYER\u002FEVIDENCE\u002FREMEDIATION block where VERDICT ∈ {ROOT_CAUSE_IDENTIFIED, INSUFFICIENT_DATA} and LAYER ∈ {S3_PERMISSION, GLUE_PERMISSION, SERDE_MISMATCH, COLUMN_TYPE_MISMATCH, PARTITION_PROJECTION, TABLE_LOCATION, STALE_PARTITIONS, CTAS_OUTPUT_LOCATION, WORKGROUP_OUTPUT, QUERY_TIMEOUT, FORMAT_INFERENCE, SERDE_PROPERTY, NESTED_TYPE_ERROR, DATE_PARSE_ERROR, UNKNOWN}.'\n  invocation_example: \"# Minimal valid input (offline symptom classification):\\nSymptom: \\\"Athena query on table orders_csv returns NULL for every\\ncolumn except the first. The underlying S3 data is a CSV file with\\ntab separators.\\\"\\nDatabase: analytics\\nTable: orders_csv\\nQuery: SELECT * FROM analytics.orders_csv LIMIT 10\\nDDL:\\n  CREATE EXTERNAL TABLE orders_csv (\\n    order_id STRING, customer_id STRING, amount STRING\\n  )\\n  ROW FORMAT SERDE\\n    'org.apache.hadoop.hive.serde2.OpenCSVSerDe'\\n  WITH SERDEPROPERTIES (\\n    'separatorChar' = ','\\n  )\\n  STORED AS INPUTFORMAT\\n    'org.apache.hadoop.mapred.TextInputFormat'\\n  OUTPUTFORMAT\\n    'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'\\n  LOCATION 's3:\u002F\u002Fprod-analytics\u002Forders\u002F'\\nWorkgroup: primary\\nQueryExecutionId: (offline — no live query)\"\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: Athena, SerDe, OpenCSVSerDe, LazySimpleSerDe, ParquetHiveSerDe, quoteChar, separatorChar, escapeChar, column type mismatch, STRING vs INT, partition projection, MSCK REPAIR, stale partitions, table location, CTAS, CREATE TABLE AS SELECT, workgroup output location, query timeout, 30 minute timeout, format inference, nested type, ARRAY, STRUCT, date parsing, S3 access denied, Glue Data Catalog, troubleshooting\n  tags: athena, analytics, troubleshooting, serde, glue, s3, partition-projection, ctas\n---\n\n# Athena Query Failure Troubleshooter\n\n## Quick start\n\n- **The SerDe determines the parsing rules (memorise this).** Athena\n  reads the table's `ROW FORMAT SERDE` to know how to parse each row.\n  An `OpenCSVSerDe` with `separatorChar=','` expects comma-delimited\n  fields; a `LazySimpleSerDe` with `'field.delim'='\\t'` expects\n  tab-delimited. A mismatch between the SerDe properties and the\n  actual file format produces NULL columns, truncated rows, or\n  SYNTAX_ERROR — not a runtime crash. The #1 Athena failure a senior\n  data engineer sees is a SerDe that does not match the data.\n- **Symptom → layer map (first plausible match drives the first\n  probe):** columns return NULL or wrong values → SERDE_MISMATCH \u002F\n  SERDE_PROPERTY; query returns zero rows on data that exists →\n  STALE_PARTITIONS \u002F PARTITION_PROJECTION; \"Access Denied s3:\u002F\u002F...\" →\n  S3_PERMISSION; CTAS fails with permission error →\n  CTAS_OUTPUT_LOCATION; query killed at 30 minutes → QUERY_TIMEOUT;\n  nested ARRAY\u002FSTRUCT error → NESTED_TYPE_ERROR; date column returns\n  NULL or wrong date → DATE_PARSE_ERROR; \"COLUMN_NOT_FOUND\" →\n  COLUMN_TYPE_MISMATCH or stale table definition.\n- **Partition projection replaces MSCK REPAIR.** `MSCK REPAIR TABLE`\n  loads partition metadata by listing S3 prefixes — slow, expensive,\n  and needs re-running after every new partition. Partition projection\n  auto-loads partitions based on a naming pattern configured on the\n  table. Operators who run `MSCK REPAIR` on every new day's data are\n  paying for a workaround that partition projection solves permanently.\n- **CTAS output goes to the workgroup result location, NOT the source\n  table location.** A `CREATE TABLE AS SELECT` writes the result to\n  `s3:\u002F\u002F\u003Cworkgroup-result-bucket>\u002Ftables\u002F\u003Cquery-id>\u002F`. The new table's\n  `LOCATION` points there. Operators who think CTAS writes to the\n  source table's S3 bucket debug the wrong permission.\n- **A 30-minute timeout is a hard service limit.** Athena kills any\n  query exceeding 30 minutes (DML) or 600 DDL hour limit. There is no\n  per-query timeout override for DML beyond 30 minutes. A query that\n  scans a large partition range with a complex JOIN will hit this\n  limit; the fix is data reduction (partition pruning, columnar\n  format, materialized views), not a timeout increase.\n\n## Mindset\n\nAn Athena query failure is almost always a metadata or permission\nincident wearing a SQL costume. The SQL is usually fine; the broken\nthing is the SerDe choice, the Glue table definition, the partition\nmetadata, the S3 bucket policy, the workgroup output location, or the\ndata format inference. Treat the query text as innocent until the\nSerDe, the table definition, the partition metadata, the IAM\npermissions on both Glue and S3, and the workgroup config are each\nproven correct. Senior data engineers start with\n`get-query-execution` (for the exact error), then `glue get-table`\n(for the DDL and SerDe), then `s3 ls` (for the data format) — and only\nre-examine the SQL after all three are confirmed.\n\n## Philosophy\n\nSenior-engineer philosophy moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand for the reasoning behind SerDe choice, partition projection, CTAS output, and the two permission layers.\n\n## Quick reference — symptom triage table\n\n| Symptom \u002F error message | Most likely layer | First probe |\n|---|---|---|\n| Columns return NULL or truncated; data exists on S3 | SERDE_MISMATCH \u002F SERDE_PROPERTY | `glue get-table` → check SerDe + SerDeProperties vs actual file format |\n| Query returns zero rows on data that exists; partition keys non-null | STALE_PARTITIONS \u002F PARTITION_PROJECTION | `glue get-partitions`; check if partition metadata exists; MSCK REPAIR or projection config |\n| `Access Denied s3:\u002F\u002Fbucket\u002Fpath` | S3_PERMISSION | IAM role's S3 permissions on data bucket |\n| `glue:GetTable ... is not authorized` | GLUE_PERMISSION | IAM role's Glue permissions on catalog\u002Fdatabase |\n| CTAS fails with Access Denied | CTAS_OUTPUT_LOCATION | Workgroup result location bucket; IAM `s3:PutObject` on result bucket |\n| Query killed at ~30 minutes | QUERY_TIMEOUT | `EngineExecutionTimeInMillis` ≈ 1800000; data scan volume |\n| `mismatched input`, `extraneous input`, `cannot resolve` | SYNTAX_ERROR (SQL) | Re-examine query text; check function support in Athena engine |\n| `COLUMN_NOT_FOUND` or `cannot resolve column` | TABLE_LOCATION \u002F stale table | `glue get-table` → check columns vs actual query |\n| `HIVE_BAD_DATA`, `HIVE_CURSOR_ERROR`, parsing exception | SERDE_MISMATCH \u002F FORMAT_INFERENCE | `s3 head-object`; check actual file format vs table's `STORED AS` |\n| ARRAY\u002FSTRUCT field error; `SYNTAX_ERROR: Column type is array` | NESTED_TYPE_ERROR | DDL column definition; nested SerDe (json) for array\u002Fstruct |\n| Date column returns NULL; `INVALID_FORMAT` | DATE_PARSE_ERROR | DDL column type (DATE vs STRING); `date_format` \u002F `from_iso8601_date` usage |\n| Column declared INT but data has \"N\u002FA\" or empty string | COLUMN_TYPE_MISMATCH | DDL column type vs actual data values |\n| None of the above; insufficient DDL or error detail | INSUFFICIENT_DATA | Ask for QueryExecutionId, DDL, sample row |\n\n## Pre-flight: query state and gather-info gate\n\nBefore running symptom-specific probes, gather the query execution\ndetails and short-circuit on query states that mimic failures.\n\n### Account-wide pre-flight commands\n\nAccount-wide pre-flight command listing moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand for live-account diagnosis before running symptom-specific probes.\n\n### Query-state short-circuit\n\n| `Status` from get-query-execution | Effect on diagnosis |\n|---|---|\n| `SUCCEEDED` | Query completed. If the symptom is wrong data (NULL columns, zero rows), the query ran but the SerDe or table definition is wrong. Route to SERDE_MISMATCH or STALE_PARTITIONS. |\n| `FAILED` | Query failed. Read `StateChangeReason` for the error category. Route to the matching branch below. |\n| `CANCELLED` | Query was cancelled (user or service). If cancelled by the service near 30 minutes, route to QUERY_TIMEOUT. |\n| `QUEUED` \u002F `RUNNING` | Query is still in flight; wait for completion before diagnosing. |\n| `FAILED` with `HIVE_BAD_DATA` | Data format on S3 does not match the table's SerDe or `STORED AS` format. Route to SERDE_MISMATCH \u002F FORMAT_INFERENCE. |\n| `FAILED` with `Access Denied` or `is not authorized` | Permission issue. Route to S3_PERMISSION or GLUE_PERMISSION based on the denied resource. |\n| `FAILED` with `Query exhausted resources at \u003CX> milliseconds` | QUERY_TIMEOUT (30-min service limit hit). |\n\n### Workgroup-state short-circuit\n\n| Workgroup config | Effect |\n|---|---|\n| `EnforceWorkGroupConfiguration: true` + result location set | All query output goes to the workgroup result location, overriding any client-side output location. CTAS output goes here. |\n| `EnforceWorkGroupConfiguration: false` | Client-side output location can override the workgroup default. CTAS may write to a client-specified location. |\n| `BytesScannedCutoffPerQuery` set | Query fails if it scans more than N bytes. A \"resource exhausted\" error may be this limit, not the 30-minute timeout. |\n| `RequesterPaysEnabled: true` | Queries on buckets in other accounts with RequesterPays require the IAM role to accept charges. |\n\nIf the input is malformed (missing QueryExecutionId or missing DDL +\nerror message for offline classification), emit INSUFFICIENT_DATA.\n\n## Process — Diagnostic decision tree (apply in symptom order)\n\nThe diagnostic tree is symptom-driven. Pick the entry point based on\nthe observed error or behaviour, then walk the layer-specific probes\nin order. Each layer ends with either a positive root-cause\nconfirmation (failing probe that matches the symptom) or a pass that\nmoves to the next layer. **Never emit ROOT_CAUSE_IDENTIFIED without a\nfailing probe that matches the symptom.**\n\n### Step 0: Non-obvious behaviours that change diagnosis\n\nStep 0 non-obvious behaviours moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when the obvious layer does not match the symptom.\n\n### Step 1: Symptom entry — pick the diagnostic branch\n\n| Symptom \u002F error | Branch |\n|---|---|\n| Columns return NULL or wrong values; query succeeds | Step 2 — SerDe mismatch \u002F property |\n| Query returns zero rows; data exists on S3 | Step 3 — Stale partitions \u002F partition projection |\n| `Access Denied s3:\u002F\u002F...` or `glue:GetTable is not authorized` | Step 4 — S3 or Glue permission |\n| CTAS fails with permission error | Step 5 — CTAS output location |\n| Query killed near 30 minutes or `exhausted resources` | Step 6 — Query timeout |\n| `HIVE_BAD_DATA` or format inference error | Step 7 — Format inference |\n| ARRAY\u002FSTRUCT field error or nested type issue | Step 8 — Nested type |\n| Date column returns NULL or wrong date | Step 9 — Date parse error |\n| Column declared numeric but data has strings (\"N\u002FA\", \"\") | Step 10 — Column type mismatch |\n| Table location wrong; `COLUMN_NOT_FOUND` | Step 11 — Table location |\n| None of the above | Step 12 — INSUFFICIENT_DATA |\n\n### Step 2: SerDe mismatch and SerDe property error\n\nProbes, SerDe capability table, SerDe-property error table, and the DROP\u002FCREATE fix moved verbatim to [references\u002Fserde-and-partition-reference.md](references\u002Fserde-and-partition-reference.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: SERDE_MISMATCH (wrong SerDe for the file format) or SERDE_PROPERTY (wrong SerDeProperties).\n\n### Step 3: Stale partitions and partition projection\n\nget-partitions probe, MSCK REPAIR, and partition-projection TBLPROPERTIES moved verbatim to [references\u002Fserde-and-partition-reference.md](references\u002Fserde-and-partition-reference.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: STALE_PARTITIONS (MSCK REPAIR fixes it) or PARTITION_PROJECTION (not configured, should be).\n\n### Step 4: S3 and Glue permission\n\nsimulate-principal-policy probes (S3, Glue, Lake Formation) moved verbatim to [references\u002Fpermission-and-ctas-reference.md](references\u002Fpermission-and-ctas-reference.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: S3_PERMISSION or GLUE_PERMISSION — both layers must pass.\n\n### Step 5: CTAS output location\n\nWorkgroup output-location probes and CTAS failure-pattern table moved verbatim to [references\u002Fpermission-and-ctas-reference.md](references\u002Fpermission-and-ctas-reference.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: CTAS_OUTPUT_LOCATION — check the RESULT bucket, not the source bucket.\n\n### Step 6: Query timeout\n\nEngineExecutionTime probe and data-reduction fix table moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: QUERY_TIMEOUT — 30 minutes is a hard limit; the fix is data reduction.\n\n### Step 7: Format inference error\n\nhead-object probe and format-mismatch table moved verbatim to [references\u002Fserde-and-partition-reference.md](references\u002Fserde-and-partition-reference.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: FORMAT_INFERENCE or SERDE_MISMATCH.\n\n### Step 8: Nested type error (ARRAY \u002F STRUCT)\n\nNested-column probe and ARRAY\u002FSTRUCT\u002FMAP issue table moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: NESTED_TYPE_ERROR.\n\n### Step 9: Date parse error\n\nDate-column probe and DATE\u002FTIMESTAMP issue table moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: DATE_PARSE_ERROR.\n\n### Step 10: Column type mismatch\n\nSample-data probe and type-mismatch pattern table moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: COLUMN_TYPE_MISMATCH.\n\n### Step 11: Table location wrong\n\nLOCATION probe and table-location issue table moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: TABLE_LOCATION.\n\n### Step 12: INSUFFICIENT_DATA\n\nIf none of the above produced a positive root-cause match, OR the input\nlacks the QueryExecutionId (for live diagnosis), the DDL, or the error\nmessage, emit INSUFFICIENT_DATA with the specific gaps. A\nROOT_CAUSE_IDENTIFIED verdict requires a failing probe that matches\nthe symptom; without the data to run the probe, the skill cannot\nconclude.\n\n## Output format\n\n```text\nTARGET: \u003Cdatabase.table \u002F query-execution-id>\nVERDICT: ROOT_CAUSE_IDENTIFIED | INSUFFICIENT_DATA\nREASON: \u003C1-2 sentences naming the failed layer and the failing probe>\nLAYER: \u003CS3_PERMISSION | GLUE_PERMISSION | SERDE_MISMATCH |\n        COLUMN_TYPE_MISMATCH | PARTITION_PROJECTION | TABLE_LOCATION |\n        STALE_PARTITIONS | CTAS_OUTPUT_LOCATION | WORKGROUP_OUTPUT |\n        QUERY_TIMEOUT | FORMAT_INFERENCE | SERDE_PROPERTY |\n        NESTED_TYPE_ERROR | DATE_PARSE_ERROR | UNKNOWN>\nEVIDENCE:\n  - \u003Cobserved symptom — error message or wrong-data behaviour>\n  - \u003Cfailing probe — command and its output that confirms the cause>\n  - \u003Cpassing probes — layers ruled out>\nREMEDIATION:\n  1. \u003Cspecific action with SQL or CLI command>\n  2. \u003Cverification query after the fix>\nCONFIRM: Before executing any state-changing SQL or CLI, emit and\n  await operator approval.\n```\n\n### Worked example — SerDe mismatch, CSV with tab delimiter\n\n```text\nTARGET: analytics.orders_csv \u002F QueryExecutionId: (offline)\nVERDICT: ROOT_CAUSE_IDENTIFIED\nREASON: Table orders_csv uses OpenCSVSerDe with separatorChar=','\n  but the S3 data is tab-delimited CSV. OpenCSVSerDe splits on commas;\n  a row like \"ORD001\\tCUST123\\t150.00\" is treated as a single field,\n  producing NULL for columns 2 and 3. The SerDe separatorChar does\n  not match the actual delimiter (Step 2).\nLAYER: SERDE_PROPERTY\nEVIDENCE:\n  - Symptom: SELECT * FROM analytics.orders_csv LIMIT 10 returns\n    order_id = \"ORD001\\tCUST123\\t150.00\" (entire row in column 1),\n    customer_id = NULL, amount = NULL for every row.\n  - Probe: aws glue get-table returns SerDeInfo.SerializationLibrary\n    = org.apache.hadoop.hive.serde2.OpenCSVSerDe;\n    SerdeInfo.Parameters.separatorChar = \",\".\n  - Probe: aws s3 cp s3:\u002F\u002Fprod-analytics\u002Forders\u002Fdata.csv \u002Ftmp\u002F &&\n    head -1 \u002Ftmp\u002Fdata.csv returns \"ORD001\\tCUST123\\t150.00\" (tab-\n    delimited, not comma).\n  - Passing: Glue permissions verified (glue:GetTable allowed);\n    S3 permissions verified (s3:GetObject allowed); partitions loaded\n    (get-partitions returns count > 0); table LOCATION correct.\nREMEDIATION:\n  1. Recreate the table with the correct separatorChar:\n     DROP TABLE analytics.orders_csv;\n     CREATE EXTERNAL TABLE analytics.orders_csv (\n       order_id STRING, customer_id STRING, amount STRING\n     )\n     ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerDe'\n     WITH SERDEPROPERTIES ('separatorChar' = '\\t')\n     STORED AS TEXTFILE\n     LOCATION 's3:\u002F\u002Fprod-analytics\u002Forders\u002F';\n  2. Verify: SELECT * FROM analytics.orders_csv LIMIT 10 should\n     return order_id, customer_id, amount in separate columns with\n     correct values.\nCONFIRM: Before dropping and recreating the table, emit and await:\n  \"CONFIRM: About to DROP and RECREATE analytics.orders_csv with\n   separatorChar='\\t'. This does not affect S3 data. Proceed? (yes\u002Fno)\"\n```\n\n### Worked example — Stale partitions, partition projection fix\n\nSecondary worked example moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nLoad on demand when emitting a STALE_PARTITIONS verdict.\n\n### Worked example — CTAS output location permission\n\nSecondary worked example moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nLoad on demand when emitting a CTAS_OUTPUT_LOCATION verdict.\n\n## Anti-Patterns — NEVER\n\n- NEVER declare ROOT_CAUSE_IDENTIFIED without a failing probe that\n  matches the symptom. A \"process of elimination\" diagnosis erodes\n  operator trust when the real cause is on a different layer.\n\n- NEVER use LazySimpleSerDe for CSV data with quoted fields. Only\n  OpenCSVSerDe handles embedded delimiters inside quoted fields.\n  LazySimpleSerDe splits naively on `field.delim`, corrupting quoted\n  values.\n\n- NEVER assume OpenCSVSerDe column types are respected. OpenCSVSerDe\n  reads ALL columns as STRING and casts at query time. A column\n  declared INT with \"N\u002FA\" values will return NULL or throw\n  HIVE_CURSOR_ERROR. Use STRING + TRY(CAST(...)) for safe casts.\n\n- NEVER rely on MSCK REPAIR TABLE for tables with more than a few\n  hundred partitions. It is O(n) in partition count and slow.\n  Configure partition projection instead.\n\n- NEVER assume the CTAS output goes to the source table location.\n  CTAS writes to the workgroup result location (when enforced) or the\n  `external_location`. The new table's LOCATION is set to the actual\n  output path AFTER the write. Permission failures on CTAS are on the\n  result bucket, not the source bucket.\n\n- NEVER assume a SUCCEEDED query means the data is correct. A SerDe\n  mismatch produces a SUCCEEDED status with NULL columns. Always read\n  actual row values, not just the query status.\n\n- NEVER set SerDeProperties on a Parquet or ORC table and expect them\n  to take effect. Columnar formats are self-describing; SerDeProperties\n  (separatorChar, escapeChar, etc.) are ignored. Setting them is a\n  no-op, not a configuration.\n\n- NEVER use Athena engine v2 functions on a v3 workgroup without\n  checking. v3 (Trino-based) uses Trino function names\n  (`format_datetime`, `from_iso8601_timestamp`); v2 uses Presto names.\n  A \"worked yesterday, broke today\" failure after a workgroup engine\n  upgrade is often a function name change.\n\n- NEVER diagnose a permission failure without checking BOTH Glue and\n  S3. The IAM role needs glue:GetTable AND s3:GetObject. Adding only\n  one produces a different AccessDenied on the other layer.\n\n- NEVER ignore Lake Formation on a Glue Data Catalog. If Lake\n  Formation is enabled, LF-Tag grants override IAM. An IAM allow does\n  not help if Lake Formation does not grant access. Check\n  `aws lakeformation list-permissions` alongside IAM.\n\n- NEVER treat a 30-minute timeout as a configurable limit. Athena's\n  DML query timeout is 30 minutes; there is no per-query override.\n  The fix is data reduction (partitioning, columnar format), not a\n  timeout increase.\n\n- NEVER use `SELECT *` on a table with a suspected SerDe issue as\n  your only diagnostic query. `SELECT *` may return NULL columns\n  without error. Always also run `SELECT specific_column FROM table\n  LIMIT 10` to see if individual column access reveals the parsing\n  issue.\n\n- NEVER assume Athena arrays are 0-indexed. Athena engine v3 (Trino)\n  uses 1-indexed arrays: `col[1]` is the first element. Using `col[0]`\n  returns NULL. Operators coming from Python\u002FJava routinely make this\n  error.\n\n- NEVER set a workgroup's result location to a bucket the IAM role\n  cannot write to. The result location must have `s3:PutObject`\n  permission for every principal that runs queries in the workgroup.\n\n## Pre-flight safety checks (run before any state-changing SQL)\n\nPre-flight safety checks (CONFIRMATION GATE, read-only-first rule, per-operation risk notes) moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nKeep here: every diagnostic probe is read-only; load the reference before any state-changing SQL.\n\n## Remediation guidance\n\nPer-layer remediation guidance (SQL, IAM policies, LF grants) moved verbatim to [references\u002Ferror-handling.md](references\u002Ferror-handling.md).\nLoad on demand when writing the REMEDIATION block of the output.\n\n## Deep reference: Athena failure layer model\n\n### SerDe matrix\n\nSerDe matrix moved verbatim to [references\u002Fserde-and-partition-reference.md](references\u002Fserde-and-partition-reference.md).\nLoad on demand when matching a SerDe class to a file format.\n\n### Workgroup configuration matrix\n\nWorkgroup configuration matrix moved verbatim to [references\u002Fpermission-and-ctas-reference.md](references\u002Fpermission-and-ctas-reference.md).\nLoad on demand when the workgroup config changes the diagnosis.\n\n### Athena error category matrix\n\nAthena error category matrix moved verbatim to [references\u002Ferror-handling.md](references\u002Ferror-handling.md).\nLoad on demand when mapping an error string to a LAYER.\n\n### Partition projection properties reference\n\nPartition projection properties reference moved verbatim to [references\u002Fserde-and-partition-reference.md](references\u002Fserde-and-partition-reference.md).\nLoad on demand when configuring projection TBLPROPERTIES.\n\n### Athena engine v2 vs v3 differences\n\nAthena engine v2 vs v3 differences moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand on 'worked yesterday, broke today' engine-version failures.\n\n## Recent AWS features (2024-2026)\n\nRecent AWS features (2024-2026) moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when result reuse, parameterized queries, or federated catalogs are in play.\n\n## References (load on demand)\n\n- [references\u002Fserde-and-partition-reference.md](references\u002Fserde-and-partition-reference.md) — SerDe deep dive and partition projection reference; now also holds Steps 2, 3, 7 (probes and verdict tables), the SerDe matrix, and the projection properties table moved from SKILL.md.\n- [references\u002Fpermission-and-ctas-reference.md](references\u002Fpermission-and-ctas-reference.md) — Glue\u002FS3 permission and CTAS output location reference; now also holds Steps 4, 5 and the workgroup configuration matrix moved from SKILL.md.\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — worked diagnostic examples moved from SKILL.md: Steps 6, 8, 9, 10, 11 layer deep dives plus the full stale-partitions and CTAS output examples.\n- [references\u002Ferror-handling.md](references\u002Ferror-handling.md) — Athena error category matrix and per-layer remediation guidance moved from SKILL.md.\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — account-wide pre-flight command listing and pre-flight safety checks moved from SKILL.md.\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — senior-engineer philosophy, Step 0 non-obvious behaviours, engine v2 vs v3 differences, and recent AWS features moved from SKILL.md.\n\n## Domain\n\nAWS CloudOps \u002F Amazon Athena (Interactive Query Service), Glue Data\nCatalog Integration, S3 Data Lake, SerDe Parsing, Partition Strategy,\nWorkgroup Configuration.\n\n## AWS documentation\n\n- **Amazon Athena User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fwhat-is.html\n- **Athena SerDe reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fserde-reference.html\n- **OpenCSVSerDe** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fcsv-serde.html\n- **LazySimpleSerDe** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Flazy-simple-serde.html\n- **Athena partition projection** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fpartition-projection.html\n- **Athena CTAS** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fctas.html\n- **Athena workgroups** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fworkgroups-create-update-query.html\n- **Athena engine version 3** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fengine-versions-reference-0003.html\n- **Athena error messages** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Ferror-messages.html\n- **Lake Formation with Athena** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fsecurity-athena-lake-formation.html\n- **Athena service quotas** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fservice-limits.html\n","# Athena Query Failure Troubleshooter\n\n## Quick start\n\n- **The SerDe determines the parsing rules (memorise this).** Athena\n  reads the table's `ROW FORMAT SERDE` to know how to parse each row.\n  An `OpenCSVSerDe` with `separatorChar=','` expects comma-delimited\n  fields; a `LazySimpleSerDe` with `'field.delim'='\\t'` expects\n  tab-delimited. A mismatch between the SerDe properties and the\n  actual file format produces NULL columns, truncated rows, or\n  SYNTAX_ERROR — not a runtime crash. The #1 Athena failure a senior\n  data engineer sees is a SerDe that does not match the data.\n- **Symptom → layer map (first plausible match drives the first\n  probe):** columns return NULL or wrong values → SERDE_MISMATCH \u002F\n  SERDE_PROPERTY; query returns zero rows on data that exists →\n  STALE_PARTITIONS \u002F PARTITION_PROJECTION; \"Access Denied s3:\u002F\u002F...\" →\n  S3_PERMISSION; CTAS fails with permission error →\n  CTAS_OUTPUT_LOCATION; query killed at 30 minutes → QUERY_TIMEOUT;\n  nested ARRAY\u002FSTRUCT error → NESTED_TYPE_ERROR; date column returns\n  NULL or wrong date → DATE_PARSE_ERROR; \"COLUMN_NOT_FOUND\" →\n  COLUMN_TYPE_MISMATCH or stale table definition.\n- **Partition projection replaces MSCK REPAIR.** `MSCK REPAIR TABLE`\n  loads partition metadata by listing S3 prefixes — slow, expensive,\n  and needs re-running after every new partition. Partition projection\n  auto-loads partitions based on a naming pattern configured on the\n  table. Operators who run `MSCK REPAIR` on every new day's data are\n  paying for a workaround that partition projection solves permanently.\n- **CTAS output goes to the workgroup result location, NOT the source\n  table location.** A `CREATE TABLE AS SELECT` writes the result to\n  `s3:\u002F\u002F\u003Cworkgroup-result-bucket>\u002Ftables\u002F\u003Cquery-id>\u002F`. The new table's\n  `LOCATION` points there. Operators who think CTAS writes to the\n  source table's S3 bucket debug the wrong permission.\n- **A 30-minute timeout is a hard service limit.** Athena kills any\n  query exceeding 30 minutes (DML) or 600 DDL hour limit. There is no\n  per-query timeout override for DML beyond 30 minutes. A query that\n  scans a large partition range with a complex JOIN will hit this\n  limit; the fix is data reduction (partition pruning, columnar\n  format, materialized views), not a timeout increase.\n\n## Mindset\n\nAn Athena query failure is almost always a metadata or permission\nincident wearing a SQL costume. The SQL is usually fine; the broken\nthing is the SerDe choice, the Glue table definition, the partition\nmetadata, the S3 bucket policy, the workgroup output location, or the\ndata format inference. Treat the query text as innocent until the\nSerDe, the table definition, the partition metadata, the IAM\npermissions on both Glue and S3, and the workgroup config are each\nproven correct. Senior data engineers start with\n`get-query-execution` (for the exact error), then `glue get-table`\n(for the DDL and SerDe), then `s3 ls` (for the data format) — and only\nre-examine the SQL after all three are confirmed.\n\n## Philosophy\n\nSenior-engineer philosophy moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand for the reasoning behind SerDe choice, partition projection, CTAS output, and the two permission layers.\n\n## Quick reference — symptom triage table\n\n| Symptom \u002F error message | Most likely layer | First probe |\n|---|---|---|\n| Columns return NULL or truncated; data exists on S3 | SERDE_MISMATCH \u002F SERDE_PROPERTY | `glue get-table` → check SerDe + SerDeProperties vs actual file format |\n| Query returns zero rows on data that exists; partition keys non-null | STALE_PARTITIONS \u002F PARTITION_PROJECTION | `glue get-partitions`; check if partition metadata exists; MSCK REPAIR or projection config |\n| `Access Denied s3:\u002F\u002Fbucket\u002Fpath` | S3_PERMISSION | IAM role's S3 permissions on data bucket |\n| `glue:GetTable ... is not authorized` | GLUE_PERMISSION | IAM role's Glue permissions on catalog\u002Fdatabase |\n| CTAS fails with Access Denied | CTAS_OUTPUT_LOCATION | Workgroup result location bucket; IAM `s3:PutObject` on result bucket |\n| Query killed at ~30 minutes | QUERY_TIMEOUT | `EngineExecutionTimeInMillis` ≈ 1800000; data scan volume |\n| `mismatched input`, `extraneous input`, `cannot resolve` | SYNTAX_ERROR (SQL) | Re-examine query text; check function support in Athena engine |\n| `COLUMN_NOT_FOUND` or `cannot resolve column` | TABLE_LOCATION \u002F stale table | `glue get-table` → check columns vs actual query |\n| `HIVE_BAD_DATA`, `HIVE_CURSOR_ERROR`, parsing exception | SERDE_MISMATCH \u002F FORMAT_INFERENCE | `s3 head-object`; check actual file format vs table's `STORED AS` |\n| ARRAY\u002FSTRUCT field error; `SYNTAX_ERROR: Column type is array` | NESTED_TYPE_ERROR | DDL column definition; nested SerDe (json) for array\u002Fstruct |\n| Date column returns NULL; `INVALID_FORMAT` | DATE_PARSE_ERROR | DDL column type (DATE vs STRING); `date_format` \u002F `from_iso8601_date` usage |\n| Column declared INT but data has \"N\u002FA\" or empty string | COLUMN_TYPE_MISMATCH | DDL column type vs actual data values |\n| None of the above; insufficient DDL or error detail | INSUFFICIENT_DATA | Ask for QueryExecutionId, DDL, sample row |\n\n## Pre-flight: query state and gather-info gate\n\nBefore running symptom-specific probes, gather the query execution\ndetails and short-circuit on query states that mimic failures.\n\n### Account-wide pre-flight commands\n\nAccount-wide pre-flight command listing moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand for live-account diagnosis before running symptom-specific probes.\n\n### Query-state short-circuit\n\n| `Status` from get-query-execution | Effect on diagnosis |\n|---|---|\n| `SUCCEEDED` | Query completed. If the symptom is wrong data (NULL columns, zero rows), the query ran but the SerDe or table definition is wrong. Route to SERDE_MISMATCH or STALE_PARTITIONS. |\n| `FAILED` | Query failed. Read `StateChangeReason` for the error category. Route to the matching branch below. |\n| `CANCELLED` | Query was cancelled (user or service). If cancelled by the service near 30 minutes, route to QUERY_TIMEOUT. |\n| `QUEUED` \u002F `RUNNING` | Query is still in flight; wait for completion before diagnosing. |\n| `FAILED` with `HIVE_BAD_DATA` | Data format on S3 does not match the table's SerDe or `STORED AS` format. Route to SERDE_MISMATCH \u002F FORMAT_INFERENCE. |\n| `FAILED` with `Access Denied` or `is not authorized` | Permission issue. Route to S3_PERMISSION or GLUE_PERMISSION based on the denied resource. |\n| `FAILED` with `Query exhausted resources at \u003CX> milliseconds` | QUERY_TIMEOUT (30-min service limit hit). |\n\n### Workgroup-state short-circuit\n\n| Workgroup config | Effect |\n|---|---|\n| `EnforceWorkGroupConfiguration: true` + result location set | All query output goes to the workgroup result location, overriding any client-side output location. CTAS output goes here. |\n| `EnforceWorkGroupConfiguration: false` | Client-side output location can override the workgroup default. CTAS may write to a client-specified location. |\n| `BytesScannedCutoffPerQuery` set | Query fails if it scans more than N bytes. A \"resource exhausted\" error may be this limit, not the 30-minute timeout. |\n| `RequesterPaysEnabled: true` | Queries on buckets in other accounts with RequesterPays require the IAM role to accept charges. |\n\nIf the input is malformed (missing QueryExecutionId or missing DDL +\nerror message for offline classification), emit INSUFFICIENT_DATA.\n\n## Process — Diagnostic decision tree (apply in symptom order)\n\nThe diagnostic tree is symptom-driven. Pick the entry point based on\nthe observed error or behaviour, then walk the layer-specific probes\nin order. Each layer ends with either a positive root-cause\nconfirmation (failing probe that matches the symptom) or a pass that\nmoves to the next layer. **Never emit ROOT_CAUSE_IDENTIFIED without a\nfailing probe that matches the symptom.**\n\n### Step 0: Non-obvious behaviours that change diagnosis\n\nStep 0 non-obvious behaviours moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when the obvious layer does not match the symptom.\n\n### Step 1: Symptom entry — pick the diagnostic branch\n\n| Symptom \u002F error | Branch |\n|---|---|\n| Columns return NULL or wrong values; query succeeds | Step 2 — SerDe mismatch \u002F property |\n| Query returns zero rows; data exists on S3 | Step 3 — Stale partitions \u002F partition projection |\n| `Access Denied s3:\u002F\u002F...` or `glue:GetTable is not authorized` | Step 4 — S3 or Glue permission |\n| CTAS fails with permission error | Step 5 — CTAS output location |\n| Query killed near 30 minutes or `exhausted resources` | Step 6 — Query timeout |\n| `HIVE_BAD_DATA` or format inference error | Step 7 — Format inference |\n| ARRAY\u002FSTRUCT field error or nested type issue | Step 8 — Nested type |\n| Date column returns NULL or wrong date | Step 9 — Date parse error |\n| Column declared numeric but data has strings (\"N\u002FA\", \"\") | Step 10 — Column type mismatch |\n| Table location wrong; `COLUMN_NOT_FOUND` | Step 11 — Table location |\n| None of the above | Step 12 — INSUFFICIENT_DATA |\n\n### Step 2: SerDe mismatch and SerDe property error\n\nProbes, SerDe capability table, SerDe-property error table, and the DROP\u002FCREATE fix moved verbatim to [references\u002Fserde-and-partition-reference.md](references\u002Fserde-and-partition-reference.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: SERDE_MISMATCH (wrong SerDe for the file format) or SERDE_PROPERTY (wrong SerDeProperties).\n\n### Step 3: Stale partitions and partition projection\n\nget-partitions probe, MSCK REPAIR, and partition-projection TBLPROPERTIES moved verbatim to [references\u002Fserde-and-partition-reference.md](references\u002Fserde-and-partition-reference.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: STALE_PARTITIONS (MSCK REPAIR fixes it) or PARTITION_PROJECTION (not configured, should be).\n\n### Step 4: S3 and Glue permission\n\nsimulate-principal-policy probes (S3, Glue, Lake Formation) moved verbatim to [references\u002Fpermission-and-ctas-reference.md](references\u002Fpermission-and-ctas-reference.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: S3_PERMISSION or GLUE_PERMISSION — both layers must pass.\n\n### Step 5: CTAS output location\n\nWorkgroup output-location probes and CTAS failure-pattern table moved verbatim to [references\u002Fpermission-and-ctas-reference.md](references\u002Fpermission-and-ctas-reference.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: CTAS_OUTPUT_LOCATION — check the RESULT bucket, not the source bucket.\n\n### Step 6: Query timeout\n\nEngineExecutionTime probe and data-reduction fix table moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: QUERY_TIMEOUT — 30 minutes is a hard limit; the fix is data reduction.\n\n### Step 7: Format inference error\n\nhead-object probe and format-mismatch table moved verbatim to [references\u002Fserde-and-partition-reference.md](references\u002Fserde-and-partition-reference.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: FORMAT_INFERENCE or SERDE_MISMATCH.\n\n### Step 8: Nested type error (ARRAY \u002F STRUCT)\n\nNested-column probe and ARRAY\u002FSTRUCT\u002FMAP issue table moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: NESTED_TYPE_ERROR.\n\n### Step 9: Date parse error\n\nDate-column probe and DATE\u002FTIMESTAMP issue table moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: DATE_PARSE_ERROR.\n\n### Step 10: Column type mismatch\n\nSample-data probe and type-mismatch pattern table moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: COLUMN_TYPE_MISMATCH.\n\n### Step 11: Table location wrong\n\nLOCATION probe and table-location issue table moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nVerdict: ROOT_CAUSE_IDENTIFIED with LAYER: TABLE_LOCATION.\n\n### Step 12: INSUFFICIENT_DATA\n\nIf none of the above produced a positive root-cause match, OR the input\nlacks the QueryExecutionId (for live diagnosis), the DDL, or the error\nmessage, emit INSUFFICIENT_DATA with the specific gaps. A\nROOT_CAUSE_IDENTIFIED verdict requires a failing probe that matches\nthe symptom; without the data to run the probe, the skill cannot\nconclude.\n\n## Output format\n\n```text\nTARGET: \u003Cdatabase.table \u002F query-execution-id>\nVERDICT: ROOT_CAUSE_IDENTIFIED | INSUFFICIENT_DATA\nREASON: \u003C1-2 sentences naming the failed layer and the failing probe>\nLAYER: \u003CS3_PERMISSION | GLUE_PERMISSION | SERDE_MISMATCH |\n        COLUMN_TYPE_MISMATCH | PARTITION_PROJECTION | TABLE_LOCATION |\n        STALE_PARTITIONS | CTAS_OUTPUT_LOCATION | WORKGROUP_OUTPUT |\n        QUERY_TIMEOUT | FORMAT_INFERENCE | SERDE_PROPERTY |\n        NESTED_TYPE_ERROR | DATE_PARSE_ERROR | UNKNOWN>\nEVIDENCE:\n  - \u003Cobserved symptom — error message or wrong-data behaviour>\n  - \u003Cfailing probe — command and its output that confirms the cause>\n  - \u003Cpassing probes — layers ruled out>\nREMEDIATION:\n  1. \u003Cspecific action with SQL or CLI command>\n  2. \u003Cverification query after the fix>\nCONFIRM: Before executing any state-changing SQL or CLI, emit and\n  await operator approval.\n```\n\n### Worked example — SerDe mismatch, CSV with tab delimiter\n\n```text\nTARGET: analytics.orders_csv \u002F QueryExecutionId: (offline)\nVERDICT: ROOT_CAUSE_IDENTIFIED\nREASON: Table orders_csv uses OpenCSVSerDe with separatorChar=','\n  but the S3 data is tab-delimited CSV. OpenCSVSerDe splits on commas;\n  a row like \"ORD001\\tCUST123\\t150.00\" is treated as a single field,\n  producing NULL for columns 2 and 3. The SerDe separatorChar does\n  not match the actual delimiter (Step 2).\nLAYER: SERDE_PROPERTY\nEVIDENCE:\n  - Symptom: SELECT * FROM analytics.orders_csv LIMIT 10 returns\n    order_id = \"ORD001\\tCUST123\\t150.00\" (entire row in column 1),\n    customer_id = NULL, amount = NULL for every row.\n  - Probe: aws glue get-table returns SerDeInfo.SerializationLibrary\n    = org.apache.hadoop.hive.serde2.OpenCSVSerDe;\n    SerdeInfo.Parameters.separatorChar = \",\".\n  - Probe: aws s3 cp s3:\u002F\u002Fprod-analytics\u002Forders\u002Fdata.csv \u002Ftmp\u002F &&\n    head -1 \u002Ftmp\u002Fdata.csv returns \"ORD001\\tCUST123\\t150.00\" (tab-\n    delimited, not comma).\n  - Passing: Glue permissions verified (glue:GetTable allowed);\n    S3 permissions verified (s3:GetObject allowed); partitions loaded\n    (get-partitions returns count > 0); table LOCATION correct.\nREMEDIATION:\n  1. Recreate the table with the correct separatorChar:\n     DROP TABLE analytics.orders_csv;\n     CREATE EXTERNAL TABLE analytics.orders_csv (\n       order_id STRING, customer_id STRING, amount STRING\n     )\n     ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerDe'\n     WITH SERDEPROPERTIES ('separatorChar' = '\\t')\n     STORED AS TEXTFILE\n     LOCATION 's3:\u002F\u002Fprod-analytics\u002Forders\u002F';\n  2. Verify: SELECT * FROM analytics.orders_csv LIMIT 10 should\n     return order_id, customer_id, amount in separate columns with\n     correct values.\nCONFIRM: Before dropping and recreating the table, emit and await:\n  \"CONFIRM: About to DROP and RECREATE analytics.orders_csv with\n   separatorChar='\\t'. This does not affect S3 data. Proceed? (yes\u002Fno)\"\n```\n\n### Worked example — Stale partitions, partition projection fix\n\nSecondary worked example moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nLoad on demand when emitting a STALE_PARTITIONS verdict.\n\n### Worked example — CTAS output location permission\n\nSecondary worked example moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\nLoad on demand when emitting a CTAS_OUTPUT_LOCATION verdict.\n\n## Anti-Patterns — NEVER\n\n- NEVER declare ROOT_CAUSE_IDENTIFIED without a failing probe that\n  matches the symptom. A \"process of elimination\" diagnosis erodes\n  operator trust when the real cause is on a different layer.\n\n- NEVER use LazySimpleSerDe for CSV data with quoted fields. Only\n  OpenCSVSerDe handles embedded delimiters inside quoted fields.\n  LazySimpleSerDe splits naively on `field.delim`, corrupting quoted\n  values.\n\n- NEVER assume OpenCSVSerDe column types are respected. OpenCSVSerDe\n  reads ALL columns as STRING and casts at query time. A column\n  declared INT with \"N\u002FA\" values will return NULL or throw\n  HIVE_CURSOR_ERROR. Use STRING + TRY(CAST(...)) for safe casts.\n\n- NEVER rely on MSCK REPAIR TABLE for tables with more than a few\n  hundred partitions. It is O(n) in partition count and slow.\n  Configure partition projection instead.\n\n- NEVER assume the CTAS output goes to the source table location.\n  CTAS writes to the workgroup result location (when enforced) or the\n  `external_location`. The new table's LOCATION is set to the actual\n  output path AFTER the write. Permission failures on CTAS are on the\n  result bucket, not the source bucket.\n\n- NEVER assume a SUCCEEDED query means the data is correct. A SerDe\n  mismatch produces a SUCCEEDED status with NULL columns. Always read\n  actual row values, not just the query status.\n\n- NEVER set SerDeProperties on a Parquet or ORC table and expect them\n  to take effect. Columnar formats are self-describing; SerDeProperties\n  (separatorChar, escapeChar, etc.) are ignored. Setting them is a\n  no-op, not a configuration.\n\n- NEVER use Athena engine v2 functions on a v3 workgroup without\n  checking. v3 (Trino-based) uses Trino function names\n  (`format_datetime`, `from_iso8601_timestamp`); v2 uses Presto names.\n  A \"worked yesterday, broke today\" failure after a workgroup engine\n  upgrade is often a function name change.\n\n- NEVER diagnose a permission failure without checking BOTH Glue and\n  S3. The IAM role needs glue:GetTable AND s3:GetObject. Adding only\n  one produces a different AccessDenied on the other layer.\n\n- NEVER ignore Lake Formation on a Glue Data Catalog. If Lake\n  Formation is enabled, LF-Tag grants override IAM. An IAM allow does\n  not help if Lake Formation does not grant access. Check\n  `aws lakeformation list-permissions` alongside IAM.\n\n- NEVER treat a 30-minute timeout as a configurable limit. Athena's\n  DML query timeout is 30 minutes; there is no per-query override.\n  The fix is data reduction (partitioning, columnar format), not a\n  timeout increase.\n\n- NEVER use `SELECT *` on a table with a suspected SerDe issue as\n  your only diagnostic query. `SELECT *` may return NULL columns\n  without error. Always also run `SELECT specific_column FROM table\n  LIMIT 10` to see if individual column access reveals the parsing\n  issue.\n\n- NEVER assume Athena arrays are 0-indexed. Athena engine v3 (Trino)\n  uses 1-indexed arrays: `col[1]` is the first element. Using `col[0]`\n  returns NULL. Operators coming from Python\u002FJava routinely make this\n  error.\n\n- NEVER set a workgroup's result location to a bucket the IAM role\n  cannot write to. The result location must have `s3:PutObject`\n  permission for every principal that runs queries in the workgroup.\n\n## Pre-flight safety checks (run before any state-changing SQL)\n\nPre-flight safety checks (CONFIRMATION GATE, read-only-first rule, per-operation risk notes) moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nKeep here: every diagnostic probe is read-only; load the reference before any state-changing SQL.\n\n## Remediation guidance\n\nPer-layer remediation guidance (SQL, IAM policies, LF grants) moved verbatim to [references\u002Ferror-handling.md](references\u002Ferror-handling.md).\nLoad on demand when writing the REMEDIATION block of the output.\n\n## Deep reference: Athena failure layer model\n\n### SerDe matrix\n\nSerDe matrix moved verbatim to [references\u002Fserde-and-partition-reference.md](references\u002Fserde-and-partition-reference.md).\nLoad on demand when matching a SerDe class to a file format.\n\n### Workgroup configuration matrix\n\nWorkgroup configuration matrix moved verbatim to [references\u002Fpermission-and-ctas-reference.md](references\u002Fpermission-and-ctas-reference.md).\nLoad on demand when the workgroup config changes the diagnosis.\n\n### Athena error category matrix\n\nAthena error category matrix moved verbatim to [references\u002Ferror-handling.md](references\u002Ferror-handling.md).\nLoad on demand when mapping an error string to a LAYER.\n\n### Partition projection properties reference\n\nPartition projection properties reference moved verbatim to [references\u002Fserde-and-partition-reference.md](references\u002Fserde-and-partition-reference.md).\nLoad on demand when configuring projection TBLPROPERTIES.\n\n### Athena engine v2 vs v3 differences\n\nAthena engine v2 vs v3 differences moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand on 'worked yesterday, broke today' engine-version failures.\n\n## Recent AWS features (2024-2026)\n\nRecent AWS features (2024-2026) moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when result reuse, parameterized queries, or federated catalogs are in play.\n\n## References (load on demand)\n\n- [references\u002Fserde-and-partition-reference.md](references\u002Fserde-and-partition-reference.md) — SerDe deep dive and partition projection reference; now also holds Steps 2, 3, 7 (probes and verdict tables), the SerDe matrix, and the projection properties table moved from SKILL.md.\n- [references\u002Fpermission-and-ctas-reference.md](references\u002Fpermission-and-ctas-reference.md) — Glue\u002FS3 permission and CTAS output location reference; now also holds Steps 4, 5 and the workgroup configuration matrix moved from SKILL.md.\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — worked diagnostic examples moved from SKILL.md: Steps 6, 8, 9, 10, 11 layer deep dives plus the full stale-partitions and CTAS output examples.\n- [references\u002Ferror-handling.md](references\u002Ferror-handling.md) — Athena error category matrix and per-layer remediation guidance moved from SKILL.md.\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — account-wide pre-flight command listing and pre-flight safety checks moved from SKILL.md.\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — senior-engineer philosophy, Step 0 non-obvious behaviours, engine v2 vs v3 differences, and recent AWS features moved from SKILL.md.\n\n## Domain\n\nAWS CloudOps \u002F Amazon Athena (Interactive Query Service), Glue Data\nCatalog Integration, S3 Data Lake, SerDe Parsing, Partition Strategy,\nWorkgroup Configuration.\n\n## AWS documentation\n\n- **Amazon Athena User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fwhat-is.html\n- **Athena SerDe reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fserde-reference.html\n- **OpenCSVSerDe** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fcsv-serde.html\n- **LazySimpleSerDe** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Flazy-simple-serde.html\n- **Athena partition projection** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fpartition-projection.html\n- **Athena CTAS** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fctas.html\n- **Athena workgroups** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fworkgroups-create-update-query.html\n- **Athena engine version 3** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fengine-versions-reference-0003.html\n- **Athena error messages** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Ferror-messages.html\n- **Lake Formation with Athena** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fsecurity-athena-lake-formation.html\n- **Athena service quotas** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fservice-limits.html\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":44},{"tags":25,"phase":26,"author":27,"domain":28,"family":29,"version":30,"keywords":31,"task_type":32,"complexity":33,"entry_point":34,"skill_class":35,"when_to_use":36,"requires_llm":37,"verdict_shape":38,"when_not_to_use":39,"lifecycle_status":40,"invocation_schema":41,"supports_pipeline":37,"invocation_example":42,"activation_triggers":43},"athena, analytics, troubleshooting, serde, glue, s3, partition-projection, ctas","2","Jacky Chan — AWS Community Builder","aws-cloudops","Analytics","0.1.0","Athena, SerDe, OpenCSVSerDe, LazySimpleSerDe, ParquetHiveSerDe, quoteChar, separatorChar, escapeChar, column type mismatch, STRING vs INT, partition projection, MSCK REPAIR, stale partitions, table location, CTAS, CREATE TABLE AS SELECT, workgroup output location, query timeout, 30 minute timeout, format inference, nested type, ARRAY, STRUCT, date parsing, S3 access denied, Glue Data Catalog, troubleshooting","troubleshoot","high","false","capability","Diagnosing an Athena query failure (column returns NULL or wrong values, query returns zero rows unexpectedly, S3 access denied, serde parsing error, column type mismatch, partition projection stale partitions, CTAS destination permission denied, workgroup output location misconfigured, query exceeds 30-minute service timeout, format inference fails, nested ARRAY\u002FSTRUCT type error, or date parsing error), walking a symptom to the failed config layer with verify commands, validating why a \"SELECT * FROM table LIMIT 10\" returns garbled data or empty results, or triaging a \"the Athena query broke\" page where the root cause may be the SerDe, the Glue table definition, the partition metadata, the S3 permission, or the workgroup config — not necessarily the query SQL itself.","true","ROOT_CAUSE_IDENTIFIED | INSUFFICIENT_DATA","Athena query performance optimization (use the athena-query-optimizer skill), Athena workgroup configuration posture audit (use the athena-workgroup-auditor skill), Glue crawler design or ETL pipeline debugging (use the glue-crawler-job-auditor or glue-job-troubleshooter skills), or Spark on Athena (Athena for Apache Spark) notebook debugging (use the Athena Spark documentation). This skill diagnoses query-time failures; it does not optimize slow-but-successful queries or audit workgroup security posture.","active","Input: either (a) a symptom description (error message from get-query-execution, observed behaviour \"column returns NULL\", \"query returns zero rows\", \"CTAS failed with access denied\"), optionally paired with the DDL (CREATE TABLE statement), the query text, and the workgroup name, OR (b) a QueryExecutionId plus region for live-account diagnosis. Output: a deterministic TARGET\u002FVERDICT\u002FREASON\u002FLAYER\u002FEVIDENCE\u002FREMEDIATION block where VERDICT ∈ {ROOT_CAUSE_IDENTIFIED, INSUFFICIENT_DATA} and LAYER ∈ {S3_PERMISSION, GLUE_PERMISSION, SERDE_MISMATCH, COLUMN_TYPE_MISMATCH, PARTITION_PROJECTION, TABLE_LOCATION, STALE_PARTITIONS, CTAS_OUTPUT_LOCATION, WORKGROUP_OUTPUT, QUERY_TIMEOUT, FORMAT_INFERENCE, SERDE_PROPERTY, NESTED_TYPE_ERROR, DATE_PARSE_ERROR, UNKNOWN}.","# Minimal valid input (offline symptom classification):\nSymptom: \"Athena query on table orders_csv returns NULL for every\ncolumn except the first. The underlying S3 data is a CSV file with\ntab separators.\"\nDatabase: analytics\nTable: orders_csv\nQuery: SELECT * FROM analytics.orders_csv LIMIT 10\nDDL:\n  CREATE EXTERNAL TABLE orders_csv (\n    order_id STRING, customer_id STRING, amount STRING\n  )\n  ROW FORMAT SERDE\n    'org.apache.hadoop.hive.serde2.OpenCSVSerDe'\n  WITH SERDEPROPERTIES (\n    'separatorChar' = ','\n  )\n  STORED AS INPUTFORMAT\n    'org.apache.hadoop.mapred.TextInputFormat'\n  OUTPUTFORMAT\n    'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'\n  LOCATION 's3:\u002F\u002Fprod-analytics\u002Forders\u002F'\nWorkgroup: primary\nQueryExecutionId: (offline — no live query)","Athena query failed, Athena COLUMN_NOT_FOUND, Athena column returns NULL, Athena zero rows, Athena access denied S3, Athena SerDe error, OpenCSVSerDe Athena, LazySimpleSerDe Athena, column type mismatch Athena, STRING vs INT Athena, partition projection Athena, MSCK REPAIR Athena, stale partitions Athena, CTAS Athena permission denied, CREATE TABLE AS SELECT Athena, workgroup output location Athena, Athena query timeout, Athena 30 minute limit, Athena format inference, nested type ARRAY STRUCT Athena, date parsing Athena, Athena SYNTAX_ERROR, troubleshoot Athena query","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline symptom classification works from pasted error messages, DDL, and query text. Live-account diagnosis uses aws athena get-query-execution, aws athena get-work-group, aws glue get-table, aws glue get-partitions, aws glue get-database, aws s3 ls \u002F api head-bucket, aws cloudwatch get-metric-statistics on AWS\u002FAthena, and aws logs get-query-results (AWS CLI v2, SSO or key-based credentials).","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fathena-query-failure-troubleshooter",0,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills","https:\u002F\u002Fgithub.com\u002Fjhkchan","CTO & Co-Founder @Beever-AI  & @votee. CAISP. AWS Community Builder. Organizer@GDGCloudHK. MongoDB Champion. Technopreneur + Infornographer.","2026-09-24 08:54:10",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill athena-query-failure-troubleshooter",{"tool":59,"command":60},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill athena-query-failure-troubleshooter",{"tool":62,"command":63},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill athena-query-failure-troubleshooter","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002FSKILL.md",true,[67,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",11104,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Feval\u002Ftest-cases.yaml",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"evals\u002Fbaselines\u002Fcolumn-type-int-na-strings.md",620,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fevals\u002Fbaselines\u002Fcolumn-type-int-na-strings.md",{"path":78,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":79,"sourceHtmlUrl":80},"evals\u002Fbaselines\u002Fctas-workgroup-output-denied.md",758,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fevals\u002Fbaselines\u002Fctas-workgroup-output-denied.md",{"path":82,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":83,"sourceHtmlUrl":84},"evals\u002Fbaselines\u002Fs3-bucket-access-denied-glue-ok.md",661,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fevals\u002Fbaselines\u002Fs3-bucket-access-denied-glue-ok.md",{"path":86,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":87,"sourceHtmlUrl":88},"evals\u002Fbaselines\u002Fserde-csv-separator-mismatch.md",848,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fevals\u002Fbaselines\u002Fserde-csv-separator-mismatch.md",{"path":90,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":91,"sourceHtmlUrl":92},"evals\u002Fbaselines\u002Fstale-partitions-no-projection.md",633,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fevals\u002Fbaselines\u002Fstale-partitions-no-projection.md",{"path":94,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":95,"sourceHtmlUrl":96},"evals\u002Feval_config.yaml",2044,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fevals\u002Feval_config.yaml",{"path":98,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":99,"sourceHtmlUrl":100},"evals\u002Fevals.json",5220,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fevals\u002Fevals.json",{"path":102,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":103,"sourceHtmlUrl":104},"evals\u002Fprompts\u002Fcolumn-type-int-na-strings.md",1486,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fevals\u002Fprompts\u002Fcolumn-type-int-na-strings.md",{"path":106,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":107,"sourceHtmlUrl":108},"evals\u002Fprompts\u002Fctas-workgroup-output-denied.md",1594,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fevals\u002Fprompts\u002Fctas-workgroup-output-denied.md",{"path":110,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":111,"sourceHtmlUrl":112},"evals\u002Fprompts\u002Fs3-bucket-access-denied-glue-ok.md",1354,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fevals\u002Fprompts\u002Fs3-bucket-access-denied-glue-ok.md",{"path":114,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":115,"sourceHtmlUrl":116},"evals\u002Fprompts\u002Fserde-csv-separator-mismatch.md",1624,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fevals\u002Fprompts\u002Fserde-csv-separator-mismatch.md",{"path":118,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":119,"sourceHtmlUrl":120},"evals\u002Fprompts\u002Fstale-partitions-no-projection.md",1236,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fevals\u002Fprompts\u002Fstale-partitions-no-projection.md",{"path":122,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":123,"sourceHtmlUrl":124},"examples\u002FREADME.md",6237,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fexamples\u002FREADME.md",{"path":126,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":127,"sourceHtmlUrl":128},"references\u002Fadvanced-patterns.md",8768,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Freferences\u002Fadvanced-patterns.md",{"path":130,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":131,"sourceHtmlUrl":132},"references\u002Fdiagnostic-commands.md",3445,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Freferences\u002Fdiagnostic-commands.md",{"path":134,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":135,"sourceHtmlUrl":136},"references\u002Ferror-handling.md",5294,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Freferences\u002Ferror-handling.md",{"path":138,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":139,"sourceHtmlUrl":140},"references\u002Fpermission-and-ctas-reference.md",12655,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Freferences\u002Fpermission-and-ctas-reference.md",{"path":142,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":143,"sourceHtmlUrl":144},"references\u002Fserde-and-partition-reference.md",17185,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Freferences\u002Fserde-and-partition-reference.md",{"path":146,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":147,"sourceHtmlUrl":148},"references\u002Fworked-examples.md",9272,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Freferences\u002Fworked-examples.md",{"path":150,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":151,"sourceHtmlUrl":152},"skill.usf.yaml",4663,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fathena-query-failure-troubleshooter\u002Fskill.usf.yaml",[154,161,168,175,182,189],{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":19},"01M7ADVD60X4PCAPKSE58P9NDC","xray-tracing-deployer","Deploys AWS X-Ray distributed tracing with production-grade configuration: X-Ray daemon deployment (EC2 systemd, ECS sidecar, EKS DaemonSet, Lambda built-in), SDK instrumentation (Java, Python, Node.js, Go, .NET) with annotations and metadata, sampling rules (default reservoir + rate vs custom rules with URL \u002F method \u002F service-name predicates), service map generation, trace query and retrieval, groups and insights, CloudWatch ServiceLens integration, IAM permissions (PutTraceSegments, GetSamplingRules), and latest features (Lambda Powertools tracing, OpenTelemetry \u002F ADOT Collector support, W3C trace context). Emits a READY_TO_DEPLOY checklist with every configuration item verified. Use when enabling X-Ray on a new application, adding tracing to ECS \u002F EKS \u002F Lambda, validating a sampling configuration, or generating daemon deployment CLI and IaC templates. Triggers: X-Ray, distributed tracing, X-Ray daemon, sampling rules, service map, X-Ray SDK, OpenTelemetry, ADOT, Lambda Powertools, CloudWatch ServiceLens.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxray-tracing-deployer\u002FSKILL.md",[],[],{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":19},"01M7ADTVJ7DCBM9CB1FY51GH7J","wellarchitected-workload-auditor","Audits AWS Well-Architected Tool workloads for review staleness, per-pillar high-risk issue counts, milestone tracking gaps, and remediation plan completeness. Emits a deterministic verdict (STALE_REVIEW | HIGH_RISK | CONFIG_GAP | OK) per workload with per-pillar risk breakdown, milestone trend analysis, and specific remediation. Use when reviewing Well-Architected workloads, checking WA review freshness, auditing high-risk issues per pillar, validating milestone coverage, or tracking remediation plans.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-workload-auditor\u002FSKILL.md",[],[],{"skillNo":169,"name":170,"nameZh":6,"description":171,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":172,"categories":173,"keywords":174,"publishedAt":19},"01M7ADT59G6FTTNZYHT2QRPNNP","wellarchitected-review-operator","Operates AWS Well-Architected Tool reviews end-to-end — creates workloads, runs pillar reviews (operational excellence, security, reliability, performance, cost optimization, sustainability, Prosperity), answers questions with risk-tier rationale, generates reports and improvement plans, creates milestones, and integrates with Trusted Advisor and Well-Architected Labs. Runs deterministic pre-checks (workload existence, lens availability, pillar coverage), emits the exact update-answer \u002F get-consolidated-report CLI behind a CONFIRM gate, and verifies risk-tier transitions. Emits READY | BLOCKED | COMPLETED. Use when creating a workload, answering pillar questions, generating an improvement plan, creating a milestone, or integrating with Trusted Advisor. Triggers: well-architected tool, well architected review, workload review, pillar, operational excellence, security, reliability, performance, cost optimization, sustainability, prosperity, improvement plan, milestone, trusted advisor.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-review-operator\u002FSKILL.md",[],[],{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":181,"publishedAt":19},"01M7ADSH5JA9QHNPPHQCD7EVA7","wafv2-web-acl-deployer","Provisions AWS WAFv2 Web ACLs with correct production defaults: scope selection (CLOUDFRONT vs REGIONAL), managed rule groups (AWSManagedRulesCommonRuleSet, SQLiRuleSet, LinuxRuleSet, WindowsRuleSet, IPReputationList, BotControlRuleSet, AmazonIpReputationList, ATP), custom rules (byte match, IP set, regex pattern, geo match, size constraint, rate-based), rule priority ordering, logging destinations (Kinesis Firehose, CloudWatch Logs, S3), resource association (ALB, API Gateway, CloudFront), rate-based rules with aggregate keys (IP, forwarded IP), Challenge and CAPTCHA actions, and account takeover prevention. Emits a READY_TO_DEPLOY checklist. Use when creating a Web ACL, attaching managed rules, configuring rate limiting, enabling WAF logging, associating a Web ACL with an ALB\u002FAPI Gateway\u002FCloudFront, or configuring CAPTCHA\u002FChallenge actions. Triggers: create WAF Web ACL, WAFv2, managed rule groups, WAF rate limiting, WAF logging, WAF CAPTCHA, WAF Challenge action, bot control, ATP managed rules.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-deployer\u002FSKILL.md",[],[],{"skillNo":183,"name":184,"nameZh":6,"description":185,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":186,"categories":187,"keywords":188,"publishedAt":19},"01M7ADRYFAT8R73FBNCHRC573X","wafv2-web-acl-auditor","Audits AWS WAFv2 Web ACL configurations to determine whether the ACL provides effective protection: default-action posture (Allow vs Block), managed-rule-group coverage gaps, rule effectiveness (BLOCK vs COUNT, shadow\u002Fbypass rules, stale exclusions), rate-based rule correctness, logging and visibility configuration, and text-transformation bypass vectors. Emits a deterministic verdict per Web ACL. Use when reviewing a WAFv2 Web ACL for security posture, checking managed-rule coverage, validating rate-limit configuration, auditing WAF logging, or hardening a WAF before production deployment. Triggers: WAF, WAFv2, Web ACL, managed rule group, AWSManagedRules, rate-based rule, CAPTCHA, Challenge, OverrideAction, Count mode, forwarded IP, Bot Control, ATP, text transformation, WAF logging, WAF visibility, OWASP, SQLi, XSS, RFI.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-auditor\u002FSKILL.md",[],[],{"skillNo":190,"name":191,"nameZh":6,"description":192,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":193,"categories":194,"keywords":195,"publishedAt":19},"01M7ADR8W7G72JX4KFGN03QK8Q","waf-rule-deployer","Provisions AWS WAFv2 rule sets with production defaults: Web ACL creation (CloudFront scope in us-east-1 vs Regional scope), rule groups (managed vs custom) with capacity planning in WCU (Web ACL Capacity Units, 1500 default per ACL), managed rule groups (AWSManagedRulesCommonRuleSet, AWSManagedRulesSQLiRuleSet, AWSManagedRulesAmazonIpReputationList, AWSManagedRulesLinuxRuleSet, AWSManagedRulesWindowsRuleSet, AWSManagedRulesUnixRuleSet), custom rules (byte-match, regex pattern set, geo-match, rate-based), IP set and regex pattern set resources, rule priority ordering (lowest number evaluated first), action types (allow, block, count, CAPTCHA, Challenge), bot control managed rule group, account takeover. Triggers: create WAF rule, WAF managed rule group, WAF custom rule, WAF byte match, WAF geo match, WAF rate based rule, WAF IP set, WAF regex pattern set, WAF WCU budget, WAF CloudFront ACL, WAF logging Kinesis Firehose, WAF bot control, WAF ATP, WAF label matching, WAF Challenge action, WAF CAPTCHA.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwaf-rule-deployer\u002FSKILL.md",[],[]]