这是我的代码
with table1 as (
select * from emp
),
table2 as (
select * from dept
),
table3 as (
select * from attendance
)
select table1.*,table2.*,table3.*;
当我运行此查询时,它不显示任何输出,但给出以下消息
Waiting on bqjob_r1556eb3ce0e18e00_0000016a1558a3b2_1 ... (10s) Current status: DONE
但是当我尝试运行此命令时:
select table1.name;
它提供以下输出:
+----------------+ | Name | +----------------+ | Ahmad Abdullah | +----------------+
当结果集包含5-6列时,它将给出输出,但是当结果集超过5-6列时,则不会显示任何输出
我想知道如何在大型查询云外壳中执行超过10列的大型查询
答案 0 :(得分:1)
我想知道如何在大型查询云外壳中执行超过10列的大型查询
这是一个如何在BigQuery云外壳中的多列上运行查询,检查作业状态并从目标表获取结果的示例 (在这种情况下,我使用的是公共数据集,因此您可以对此进行测试和玩耍)
bq query
bq query --nouse_legacy_sql 'select * from `bigquery-public-data.samples.shakespeare` limit 10'
正在等待bqjob_r35189e6fbf98cf71_0000016a16517f64_1 ...(0s)当前状态:完成
+-----------+------------+---------+-------------+
| word | word_count | corpus | corpus_date |
+-----------+------------+---------+-------------+
| LVII | 1 | sonnets | 0 |
| augurs | 1 | sonnets | 0 |
| dimm'd | 1 | sonnets | 0 |
| plagues | 1 | sonnets | 0 |
| treason | 1 | sonnets | 0 |
| surmise | 1 | sonnets | 0 |
| heed | 1 | sonnets | 0 |
| Unthrifty | 1 | sonnets | 0 |
| quality | 1 | sonnets | 0 |
| wherever | 1 | sonnets | 0 |
+-----------+------------+---------+-------------+
bq show
:bq --location=US show -j 'bqjob_r35189e6fbf98cf71_0000016a16517f64_1'
Job projectId:bqjob_r35189e6fbf98cf71_0000016a16517f64_1
Job Type State Start Time Duration User Email Bytes Processed Bytes Billed Billing Tier Labels
---------- --------- ----------------- ---------- ------------------------ ----------------- -------------- -------------- --------
query SUCCESS 13 Apr 13:50:01 0:00:00 tamir.klein1@gmail.com 6432064 10485760
--format=prettyjson
bq --location=US --format=prettyjson show -j 'bqjob_r35189e6fbf98cf71_0000016a16517f64_1'
"destinationTable": {
"datasetId": "_678da79776e587d77e4352f89f5345e7f20849ef",
"projectId": "mydata",
"tableId": "anon0dd6d6c2fda3d77bec552bbc189e4ba08a136b20"
},
bq query
,其中目标表信息取自上一点bq query --nouse_legacy_sql 'select * from `projectId._678da79776e587d77e4352f89f5345e7f20849ef.anon0dd6d6c2fda3d77bec552bbc189e4ba08a136b20` limit 10'
Waiting on bqjob_r44dc9a8fdbdf61f0_0000016a1662e2ac_1 ... (0s) Current status: DONE
+-----------+------------+---------+-------------+
| word | word_count | corpus | corpus_date |
+-----------+------------+---------+-------------+
| LVII | 1 | sonnets | 0 |
| augurs | 1 | sonnets | 0 |
| dimm'd | 1 | sonnets | 0 |
| plagues | 1 | sonnets | 0 |
| treason | 1 | sonnets | 0 |
| surmise | 1 | sonnets | 0 |
| heed | 1 | sonnets | 0 |
| Unthrifty | 1 | sonnets | 0 |
| quality | 1 | sonnets | 0 |
| wherever | 1 | sonnets | 0 |
+-----------+------------+---------+-------------+