2

I am trying to list all the objects present in a dataset in BigQuery.

I tried using bq ls projectID:dataset_name command in Google SDK shell. However this returned only the list of tables present in the dataset. I am interested in listing all the stored procedures present in the same dataset.

James Z
  • 12,209
  • 10
  • 24
  • 44
Rajalakshmi
  • 541
  • 5
  • 21

2 Answers2

2

It is possible to get the list of functions with a query:

bq query --nouse_legacy_sql \
'SELECT
   *
 FROM
   mydataset.INFORMATION_SCHEMA.ROUTINES'
Sergey Geron
  • 9,098
  • 2
  • 22
  • 29
1

It is possible to include all routines in the bq ls command by setting the flag --routines=true:

bq ls dataset_name --routines=true

The default value is false. Routines include persistent user-defined functions, table functions (Preview), and stored procedures. See GCP docs for more detail.

Sean Conkie
  • 127
  • 1
  • 8