gcloud metastore services query-metadata (SERVICE : --location=LOCATION) --query=QUERY [--format=FORMAT] [GCLOUD_WIDE_FLAG …]
my-metastore-service in location us-central1, and the
sql query "show tables;", run:
gcloud metastore services query-metadata my-metastore-service --location=us-central1 --query="show tables;"
To set the project attribute:
service on the command line with a fully
specified name;
--project on the command line;
core/project.
SERVICE
To set the service attribute:
service on the command line.
--location=LOCATIONlocation attribute:
service on the command line with a fully
specified name;
--location on the command line;
metastore/location.
--query=QUERY--format=FORMATcore/format
and --format are specified, --format takes precedence.
--format and core/format both take precedence over
core/default_format. The supported formats are limited to:
config, csv, default, diff,
disable, flattened, get,
json, list, multi, none,
object, table, text, value,
yaml. For more details run $ gcloud topic formats. Run $ gcloud config set --help to
see more information about core/format
--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
gcloud alpha metastore services query-metadatagcloud beta metastore services query-metadata
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.