Search code examples
aws-glueaws-glue-data-catalog

AWS Glue - How to query Glue catalog for LOCATION?


Anybody know how (Athena w Glue) to return the full s3:// address of a table whose table name I know. Something like:

SELECT location FOR TABLE xyz;

Seems simple enough but I can't find it


Solution

  • Also possible to get the location via aws cli command:

    aws glue get-table --database-name bigdata --name test --query "Table.StorageDescriptor.Location"

    output: "s3://bucket_name/big_data/test/"

    Following gives all the details of a table.

    aws glue get-table --database-name bigdata --name test

    To get the location, access it via Table.StorageDescriptor.Location