Open TennyZhuang opened 1 year ago
A workaround to make it possible to run this streaming query in our system, but it is hard to write that query. It seems something is wrong in our binder when binding a subquery (need an investigation).
CREATE TABLE address_balances (
address TEXT,
balance BIGINT,
col int default 1
);
INSERT INTO address_balances (address, balance)
VALUES
('a1', 100),
('a2', 10000),
('a3', 100000),
('a4', 1000000);
create materialized view v as SELECT
balance_range,
COUNT(*) AS num_addresses,
SUM(balance) AS total_balance,
(SUM(balance) / (SELECT SUM(balance) FROM (select * from address_balances where col = balance_ranges.col) T ) ) * 100 AS percentage_of_total_supply
FROM (
SELECT
address,
col,
balance,
CASE
WHEN balance >= 1000000 THEN 'whales'
WHEN balance >= 10000 AND balance < 1000000 THEN 'dolphins'
ELSE 'shrimps'
END AS balance_range
FROM
address_balances
) AS balance_ranges
GROUP BY
balance_range, col;
This issue has been open for 60 days with no activity.
If you think it is still relevant today, and needs to be done in the near future, you can comment to update the status, or just manually remove the no-issue-activity
label.
You can also confidently close this issue as not planned to keep our backlog clean. Don't worry if you think the issue is still valuable to continue in the future. It's searchable and can be reopened when it's time. 😄
Describe the bug
To Reproduce
Explain the SQL, then
Here is a NLJ while the two tables are really small (3 rows and 1 rows), is there some solution so that we can run it in streaming mode?
Expected behavior
No response
Additional context
No response