Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Refactor hll_sketch and fix stack use after return bug #50600

Merged
merged 3 commits into from
Sep 3, 2024

fix bugs

1ee1fd7
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

[Enhancement] Refactor hll_sketch and fix stack use after return bug #50600

fix bugs
1ee1fd7
Select commit
Loading
Failed to load commit list.
GitHub Actions / SQL-Tester Report failed Sep 3, 2024 in 0s

733 tests run, 732 passed, 0 skipped, 1 failed.

Annotations

Check failure on line 1 in TestSQLCases

See this annotation in the file changed.

@github-actions github-actions / SQL-Tester Report

TestSQLCases.test_mv_swap

Element counts were not equal:
First has 1, Second has 0:  'false\tbase-table swapped: jj'
First has 0, Second has 1:  'true\t' : sql result not match:
- [SQL]: SELECT IS_ACTIVE, INACTIVE_REASON FROM information_schema.materialized_views WHERE table_name = 'mv_on_table_1';
- [exp]: ['false\tbase-table swapped: jj']
- [act]: ['true\t']
---
Raw output
[Stacktrace]: 
Traceback (most recent call last):
  File "/root/.pyenv/versions/3.8.19/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/root/.pyenv/versions/3.8.19/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/root/.pyenv/versions/3.8.19/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/root/.pyenv/versions/3.8.19/lib/python3.8/site-packages/nose/case.py", line 170, in runTest
    self.test(*self.arg)
  File "/root/.pyenv/versions/3.8.19/lib/python3.8/site-packages/parameterized/parameterized.py", line 620, in standalone_func
    return func(*(a + p.args), **p.kwargs, **kw)
  File "/home/runner/_work/starrocks/starrocks/test/lib/sql_annotation.py", line 48, in wrapper
    raise e
  File "/home/runner/_work/starrocks/starrocks/test/lib/sql_annotation.py", line 43, in wrapper
    res = func(*args, **kwargs)
  File "/home/runner/_work/starrocks/starrocks/test/test_sql_cases.py", line 390, in test_sql_basic
    self.check(sql_id, sql, expect_res, actual_res, order, ori_sql)
  File "/home/runner/_work/starrocks/starrocks/test/lib/sr_sql_lib.py", line 1360, in check
    tools.assert_count_equal(
  File "/root/.pyenv/versions/3.8.19/lib/python3.8/unittest/case.py", line 1272, in assertCountEqual
    self.fail(msg)
  File "/root/.pyenv/versions/3.8.19/lib/python3.8/unittest/case.py", line 753, in fail
    raise self.failureException(msg)
AssertionError: Element counts were not equal:
First has 1, Second has 0:  'false\tbase-table swapped: jj'
First has 0, Second has 1:  'true\t' : sql result not match:
- [SQL]: SELECT IS_ACTIVE, INACTIVE_REASON FROM information_schema.materialized_views WHERE table_name = 'mv_on_table_1';
- [exp]: ['false\tbase-table swapped: jj']
- [act]: ['true\t']
---

[Standard Output]: 
?[1;32m------------------------------------------------------------ ?[0m
?[1;32m[case name]: test_mv_swap ?[0m
?[1;32m[case file]: sql/test_materialized_view/R/test_mv_swap ?[0m
?[1;32m------------------------------------------------------------ ?[0m
	 → case db: ['db_8002892d6bf847ee95f509348293ee56']
	 → case resource: []
create database db_8002892d6bf847ee95f509348293ee56;
use db_8002892d6bf847ee95f509348293ee56;
CREATE TABLE ss( event_day DATE, pv BIGINT) DUPLICATE KEY(event_day) DISTRIBUTED BY HASH(event_day) BUCKETS 8 PROPERTIES("replication_num" = "1");
CREATE TABLE jj( event_day DATE, pv BIGINT) DUPLICATE KEY(event_day) DISTRIBUTED BY HASH(event_day) BUCKETS 8 PROPERTIES("replication_num" = "1");
insert into ss values('2020-01-14', 2);
insert into ss values('2020-01-14', 3);
insert into ss values('2020-01-15', 2);
insert into jj values('2020-01-14', 2);
insert into jj values('2020-01-14', 3);
insert into jj values('2020-01-15', 2);
CREATE MATERIALIZED VIEW mv1 DISTRIBUTED BY hash(event_day) AS SELECT event_day, sum(pv) as sum_pv FROM ss GROUP BY event_day;
REFRESH MATERIALIZED VIEW mv1 with sync mode ;
CREATE MATERIALIZED VIEW mv2 DISTRIBUTED BY hash(event_day) AS SELECT event_day, count(pv) as count_pv FROM ss GROUP BY event_day;
REFRESH MATERIALIZED VIEW mv2 with sync mode ;
SELECT * FROM mv1 ORDER BY event_day;
SELECT * FROM mv2 ORDER BY event_day;
ALTER MATERIALIZED VIEW mv1 SWAP WITH mv2;
SELECT * FROM mv1 ORDER BY event_day;
SELECT * FROM mv2 ORDER BY event_day;
DESC mv1;
DESC mv2;
INSERT INTO ss values('2020-01-15', 2);
REFRESH MATERIALIZED VIEW mv1 with sync mode;
REFRESH MATERIALIZED VIEW mv2 with sync mode;
SELECT * FROM mv1 ORDER BY event_day;
SELECT * FROM mv2 ORDER BY event_day;
ALTER MATERIALIZED VIEW mv1 SWAP WITH ss;
ALTER TABLE ss SWAP WITH mv1;
ALTER MATERIALIZED VIEW mv1 SWAP WITH mv1;
ALTER MATERIALIZED VIEW mv1 SWAP WITH mv2;
CREATE MATERIALIZED VIEW mv_on_mv_1 REFRESH ASYNC 
AS SELECT sum(sum_pv) as sum_sum_pv FROM mv1;
CREATE MATERIALIZED VIEW mv_on_mv_2 REFRESH ASYNC 
AS SELECT sum_sum_pv + 1 FROM mv_on_mv_1;
REFRESH MATERIALIZED VIEW mv_on_mv_1 with sync mode;
REFRESH MATERIALIZED VIEW mv_on_mv_2 with sync mode;
ALTER MATERIALIZED VIEW mv1 SWAP WITH mv2;
SELECT IS_ACTIVE, INACTIVE_REASON FROM information_schema.materialized_views WHERE table_name = 'mv_on_mv_1';
SELECT IS_ACTIVE, INACTIVE_REASON FROM information_schema.materialized_views WHERE table_name = 'mv_on_mv_2';
ALTER MATERIALIZED VIEW mv_on_mv_1 ACTIVE;
ALTER MATERIALIZED VIEW mv_on_mv_2 ACTIVE;
SELECT IS_ACTIVE, INACTIVE_REASON FROM information_schema.materialized_views WHERE table_name = 'mv_on_mv_1';
SELECT IS_ACTIVE, INACTIVE_REASON FROM information_schema.materialized_views WHERE table_name = 'mv_on_mv_2';
ALTER MATERIALIZED VIEW mv1 SWAP WITH mv2;
ALTER MATERIALIZED VIEW mv_on_mv_1 ACTIVE;
ALTER MATERIALIZED VIEW mv_on_mv_2 ACTIVE;
SELECT IS_ACTIVE, INACTIVE_REASON FROM information_schema.materialized_views WHERE table_name = 'mv_on_mv_1';
SELECT IS_ACTIVE, INACTIVE_REASON FROM information_schema.materialized_views WHERE table_name = 'mv_on_mv_2';
CREATE MATERIALIZED VIEW mv_on_table_1 REFRESH ASYNC 
AS SELECT ss.event_day, sum(ss.pv) as ss_sum_pv, sum(jj.pv) as jj_sum_pv
    FROM ss JOIN jj on (ss.event_day = jj.event_day) 
    GROUP BY ss.event_day;
REFRESH MATERIALIZED VIEW mv_on_table_1 with sync mode ;
ALTER TABLE ss SWAP WITH jj;
SELECT IS_ACTIVE, INACTIVE_REASON FROM information_schema.materialized_views WHERE table_name = 'mv_on_table_1';
?[1;32m******************** [FINISH] test_mv_swap ******************** ?[0m