'The _temp file appears in the AWSAthena editor

I created a data catalog using Blueprint in AWSLakeFormation.
Afterwards, I checked the table in Athena and noticed that the _temp〇〇 file was showing up.

I would like to remove the _temp○○ file from the AWSAthena editor if possible. I can simply drop the table in AWSLakeFormation and it will disappear, but it will come back on the next crawl.

How can I configure it so that the _temp00 file is not added to the data catalog?

If you have any suggestions, we would appreciate it if you could let us know.

Athena > editor > tables

I don't want the _temp file to show up.
enter image description here

Blueprint Settings

イメージ説明イメージ説明



Solution 1:[1]

You can change the user IAM policy and attach the following inline policy to the user or usergroup. This will deny the get table access and the _temp tables will not appear on Athena for those users.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Deny",
            "Action": [
                "glue:GetTables",
                "glue:GetTable"
            ],
            "Resource": [
                "arn:aws:glue:<region-id>:<account-id>:table/*/_temp*",

            ]
        }
    ]
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rahul