DEV Community

Marcos Henrique
Marcos Henrique

Posted on

4 4

[SOLVED] glue view is stale; it must be re-created

when you facing this annoying error:

'<your-view-name' is stale; it must be re-created
This query ran against the "glue_<yours>_crawler"

power rangers begging for something to stop

In the most cases the solution is simple, despite you barely find solutions on the internet (stackoverflow and some fancy blogs) try just review your columns order on presto metadata, in my case I'm creating the view with aws cdk, so I created a json with my configuration like the following example and then parse this to base64:

{
  "catalog": "awsdatacatalog",
  "schema": "glue_my_crawler",
  "columns": [
    {
      "name": "name",
      "type": "varchar"
    },
    {
      "id": "id",
      "type": "varchar"
    },
  ],
  "originalSql": "SELECT id, name from \"schema-job-result\""
}
Enter fullscreen mode Exit fullscreen mode

The example above results on the:

'<your-view-name' is stale; it must be re-created
This query ran against the "glue_<yours>_crawler"

The correct way is like the example bellow

{
  "catalog": "awsdatacatalog",
  "schema": "glue_my_crawler",
  "columns": [
    {
      "name": "id",
      "type": "varchar"
    },
    {
      "id": "name",
      "type": "varchar"
    },
  ],
  "originalSql": "SELECT id, name from \"schema-job-result\""
}
Enter fullscreen mode Exit fullscreen mode

Barney thumbs up

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs