简体   繁体   中英

BigQuery Web Editor star expansion columns in SELECT

Given the below code, I'd like to expand the * to the list of columns in the FROM clause. Some places refer to this as "star expansion". SQL Server/Dbeaver are able to do this by pressing CTRL+Space or other shortcuts. Is there a way to do this in the BigQuery Web UI Editor?

SELECT
    *
FROM
  `analytics-dev.my_dataset.my_table`

If my_table has 4 columns, pressing the shortcut keyword would expand to:

SELECT
    col1, col2, col3, col4
FROM
  `analytics-dev.my_dataset.my_table`

You can use 3rd party IDE for BigQuery supporting this and many more perks
This is Goliath - part of Potens.io Suite available at Marketplace .

在此处输入图像描述

when user pick [highlighted] option - the query editor is populated as in below screenshot (not exactly expansion as it is asked in your question)

在此处输入图像描述

Yet expansion is also supported but with few more steps

  • navigate to table by CTRL + Click on table reference + SPACE
  • then choosing "Insert all fields" - obviously making sure cursor is in proper place in Editor...

Note : Another tool in this suite is Magnus - Workflow Automator. Supports all BigQuery, Cloud Storage and most of Google APIs as well as multiple simple utility type Tasks like BigQuery Task, Export to Storage Task, Loop Task and many many more along with advanced scheduling, triggering, etc. Supports GitHub as a source control as well

Disclosure : I am GDE for Google Cloud and creator of those tools and leader on Potens team

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM