You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MERGE INTO transactions USING (
SELECTt.user_id, t.asset_type,
SUM(t.quantity) AS total_quantity
FROM transactions t
GROUP BYt.user_id, t.asset_typeUNION ALLSELECTt.user_id, 'NEW_TRANSACTION'AS asset_type, -- New transaction type for insert30AS quantity -- Example quantityFROM transactions t
WHEREt.user_id % 2=0-- Condition to select subset for new dataGROUP BYt.user_id
) AS combined_transactions ONtransactions.asset_type=combined_transactions.asset_type
WHEN MATCHED THEN
UPDATESETtransactions.quantity=combined_transactions.total_quantity
WHEN NOT MATCHED THEN
INSERT (user_id, transaction_type, asset_type, quantity, transaction_time)
VALUES (combined_transactions.user_id, 'trade', combined_transactions.asset_type, combined_transactions.total_quantity, '2023-01-01');
MERGE INTO transactions USING (
SELECTt.user_id,
t.asset_type,
SUM(t.quantity) AS total_quantity
FROM
transactions t
GROUP BYt.user_id,
t.asset_typeUNION
ALL
SELECTt.user_id,
'NEW_TRANSACTION'AS asset_type,
30AS quantity
FROM
transactions t
WHEREt.user_id % 2=0GROUP BYt.user_id
) AS combined_transactions ONtransactions.asset_type=combined_transactions.asset_type
WHEN MATCHED THEN
UPDATESETtransactions.quantity=combined_transactions.total_quantity
WHEN NOT MATCHED THEN
INSERT
(
user_id,
transaction_type,
asset_type,
quantity,
transaction_time
)
VALUES
(
combined_transactions.user_id,
'trade',
combined_transactions.asset_type,
combined_transactions.total_quantity,
'2023-01-01'
)
memory oversize.
How to Reproduce?
mergeinto> MERGE INTO transactions USING (
SELECTt.user_id, t.asset_type,
SUM(t.quantity) AS total_quantity
FROM transactions t
GROUP BYt.user_id, t.asset_typeUNION ALLSELECTt.user_id, 'NEW_TRANSACTION'AS asset_type, -- New transaction type for insert30AS quantity -- Example quantityFROM transactions t
WHEREt.user_id % 2=0-- Condition to select subset for new dataGROUP BYt.user_id
) AS combined_transactions ONtransactions.asset_type=combined_transactions.asset_type
WHEN MATCHED THEN
UPDATESETtransactions.quantity=combined_transactions.total_quantity
WHEN NOT MATCHED THEN
INSERT (user_id, transaction_type, asset_type, quantity, transaction_time)
VALUES (combined_transactions.user_id, 'trade', combined_transactions.asset_type, combined_transactions.total_quantity, '2023-01-01');
MERGE INTO transactions USING (
SELECTt.user_id,
t.asset_type,
SUM(t.quantity) AS total_quantity
FROM
transactions t
GROUP BYt.user_id,
t.asset_typeUNION
ALL
SELECTt.user_id,
'NEW_TRANSACTION'AS asset_type,
30AS quantity
FROM
transactions t
WHEREt.user_id % 2=0GROUP BYt.user_id
) AS combined_transactions ONtransactions.asset_type=combined_transactions.asset_type
WHEN MATCHED THEN
UPDATESETtransactions.quantity=combined_transactions.total_quantity
WHEN NOT MATCHED THEN
INSERT
(
user_id,
transaction_type,
asset_type,
quantity,
transaction_time
)
VALUES
(
combined_transactions.user_id,
'trade',
combined_transactions.asset_type,
combined_transactions.total_quantity,
'2023-01-01'
)
error happens after fetched 0 rows: APIError: PageError with 1104: memory usage 25.8 GB(25770320620) exceeds limit25.8 GB(25769803776)
0 row read in14.572 sec. Processed 2.35 million row, 51.33 MiB (160.98 thousand row/s, 3.52 MiB/s)
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Search before asking
Version
35f129c
What's Wrong?
in xsmall, when execute
memory oversize.
How to Reproduce?
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: