List true tables only in Athena
0
I'd like to have a single query which lists all tables in a athena database excluding views.
There is
SHOW TABLES
which returns tables as well as views. I don't want to call the latter followed by a SHOW VIEWS
and then separate those in my code but have that same behavior in one single call.
How can i achieve this?
Topics
Tags
asked 21 days ago26 views
1 Answers
0
Hello,
Instead of SHOW TABLES
, how about using the information_schema table?
SELECT * FROM information_schema.tables WHERE table_schema = 'database'
If you want to pull views separately, query the information_schema.views
table.
answered 21 days ago
Relevant questions
Athena views can't include Athena table partitions
asked 5 days agoAmazon Athena query outputting all columns in the csv as VARCHARs
Accepted Answerasked 2 years agoShouldn't the AWSReadOnlyAccess permission group allow access to query Athena tables
asked 6 days agoIn-place query of S3 data without provisioning DB or creating tables
asked 4 months agoCan I use the ID of my saved query to start query execution in Athena SDK?
asked a month agoUnable to read Hive Acid tables in Athena using Athena Hive data connector
asked 25 days agoINVALID_INPUT in Athena Query
asked 5 months agoUsing Athena to query AWS Lake Formation database
asked 2 months agoInvalid S3 request when creating Iceberg tables in Athena
asked 2 months agoList true tables only in Athena
asked 21 days ago
Hi, thanks for your response. That doesn't work.
The view in my database is listed in
information_schema.tables
whileinformation_schema.views
is empty. How is that possible at all?