質問編集履歴
3
【追記2】を入力しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -41,4 +41,12 @@
|
|
41
41
|
```
|
42
42
|
|
43
43
|
▼結果
|
44
|
-
> Error: Resources exceeded during query execution: The query could not be executed in the allotted memory. Sort operator used for PARTITION BY used too much memory..
|
44
|
+
> Error: Resources exceeded during query execution: The query could not be executed in the allotted memory. Sort operator used for PARTITION BY used too much memory..
|
45
|
+
|
46
|
+
|
47
|
+
【追記2】
|
48
|
+
現在、下記サイトを参考にしております。
|
49
|
+
引き続き、よろしくお願いします。
|
50
|
+
|
51
|
+
「大きなデータを取得する」
|
52
|
+
https://tech.starttoday-tech.com/entry/bigquery_data_reduction#%E5%A4%A7%E3%81%8D%E3%81%AA%E3%83%87%E3%83%BC%E3%82%BF%E3%82%92%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B
|
2
【追記1】をさらに入力しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -38,5 +38,7 @@
|
|
38
38
|
SELECT
|
39
39
|
ROW_NUMBER() OVER (PARTITION BY カラム1 ORDER BY カラム2, カラム3) as CNT
|
40
40
|
FROM T1
|
41
|
+
```
|
41
42
|
|
42
|
-
|
43
|
+
▼結果
|
44
|
+
> Error: Resources exceeded during query execution: The query could not be executed in the allotted memory. Sort operator used for PARTITION BY used too much memory..
|
1
【追記1】を入力しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -13,4 +13,30 @@
|
|
13
13
|
●分散処理させる(例えば、テーブル内の大きな塊を最初にELSEやWHERE句などで外す)ことで、
|
14
14
|
本件は回避できるものか。
|
15
15
|
|
16
|
-
どうぞ、よろしくお願いします。
|
16
|
+
どうぞ、よろしくお願いします。
|
17
|
+
|
18
|
+
【追記1】
|
19
|
+
```BigQuery
|
20
|
+
WITH T1 as (
|
21
|
+
SELECT
|
22
|
+
カラム1,
|
23
|
+
カラム2,
|
24
|
+
カラム3
|
25
|
+
FROM
|
26
|
+
テーブル1(2,000万レコード)
|
27
|
+
|
28
|
+
UNION ALL
|
29
|
+
|
30
|
+
SELECT
|
31
|
+
カラム1,
|
32
|
+
カラム2,
|
33
|
+
カラム3
|
34
|
+
FROM
|
35
|
+
テーブル2(5,000万レコード)
|
36
|
+
)
|
37
|
+
|
38
|
+
SELECT
|
39
|
+
ROW_NUMBER() OVER (PARTITION BY カラム1 ORDER BY カラム2, カラム3) as CNT
|
40
|
+
FROM T1
|
41
|
+
|
42
|
+
```
|