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

feat(#3006)!: correct semantic for first_value #3861

Merged
merged 2 commits into from Apr 17, 2024

Conversation

aceforeverd
Copy link
Collaborator

@aceforeverd aceforeverd commented Apr 10, 2024

  • correct first_value semantic, same as first_value in standard SQL.
  • first_value will accept a optional parameter ignoreNull
  • add last_value

close #3006

@github-actions github-actions bot added the execute-engine hybridse sql engine label Apr 10, 2024
Copy link
Contributor

github-actions bot commented Apr 10, 2024

SDK Test Report

102 files  ±0  102 suites  ±0   2m 14s ⏱️ ±0s
357 tests ±0  343 ✅ ±0  14 💤 ±0  0 ❌ ±0 
483 runs  ±0  469 ✅ ±0  14 💤 ±0  0 ❌ ±0 

Results for commit 7b046f6. ± Comparison against base commit 90e1425.

This pull request removes 30 and adds 9 tests. Note that renamed tests count towards both.
  PARTITION BY db1.t1.col2 ORDER BY db1.t1.col1
  PARTITION BY t1.col2 ORDER BY t1.col1
  ROWS_RANGE BETWEEN 3 PRECEDING AND CURRENT ROW
 ) limit 10;](1)
 ) limit 10;](2)
 ) limit 10;](3)
 FROM db1.t1
 FROM t1
 WINDOW w1 AS (
 last join db2.t2 order by db2.t2.col1
…
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlLastJoinWithMultipleDB[,  SELECT sum(db1.t1.col1) over w1 as sum_t1_col1, db2.t2.str1 as t2_str1
 FROM db1.t1
 last join db2.t2 order by db2.t2.col1
 on db1.t1.col1 = db2.t2.col1 and db1.t1.col2 = db2.t2.col0
 WINDOW w1 AS (
  PARTITION BY db1.t1.col2 ORDER BY db1.t1.col1
  ROWS_RANGE BETWEEN 3 PRECEDING AND CURRENT ROW
 ) limit 10;](2)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlLastJoinWithMultipleDB[db1,  SELECT sum(t1.col1) over w1 as sum_t1_col1, db2.t2.str1 as t2_str1
 FROM t1
 last join db2.t2 order by db2.t2.col1
 on t1.col1 = db2.t2.col1 and t1.col2 = db2.t2.col0
 WINDOW w1 AS (
  PARTITION BY t1.col2 ORDER BY t1.col1
  ROWS_RANGE BETWEEN 3 PRECEDING AND CURRENT ROW
 ) limit 10;](1)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlLastJoinWithMultipleDB[null,  SELECT sum(db1.t1.col1) over w1 as sum_t1_col1, db2.t2.str1 as t2_str1
 FROM db1.t1
 last join db2.t2 order by db2.t2.col1
 on db1.t1.col1 = db2.t2.col1 and db1.t1.col2 = db2.t2.col0
 WINDOW w1 AS (
  PARTITION BY db1.t1.col2 ORDER BY db1.t1.col1
  ROWS_RANGE BETWEEN 3 PRECEDING AND CURRENT ROW
 ) limit 10;](3)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlMultipleDBErrorTest[, SELECT db2.t2.str1 as t2_str1
 FROM t1
 last join db2.t2 order by db2.t2.col1
 on t1.col1 = db2.t2.col1 and t1.col2 = db2.t2.col0;
, SQL parse error: Fail to transform data provider op: table t1 not exists in database []](4)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlMultipleDBErrorTest[db1, SELECT db1.t2.str1 as t2_str1
 FROM t1
 last join db2.t2 order by db2.t2.col1
 on t1.col1 = db2.t2.col1 and t1.col2 = db2.t2.col0;
, SQL parse error: Column Not found: db1.t2.str1](2)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlMultipleDBErrorTest[db1, SELECT db2.t2.str1 as t2_str1
 FROM t1
 last join db2.t2 order by db2.t2.col1
 on t1.col1 = t2.col1 and t1.col2 = db2.t2.col0;
, SQL parse error: Column Not found: .t2.col1](3)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlMultipleDBErrorTest[db1, SELECT t2.str1 as t2_str1
 FROM t1
 last join db2.t2 order by db2.t2.col1
 on t1.col1 = db2.t2.col1 and t1.col2 = db2.t2.col0;
, SQL parse error: Column Not found: .t2.str1](1)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlMultipleDBErrorTest[null, SELECT db2.t2.str1 as t2_str1
 FROM t1
 last join db2.t2 order by db2.t2.col1
 on t1.col1 = db2.t2.col1 and t1.col2 = db2.t2.col0;
, SQL parse error: Fail to transform data provider op: table t1 not exists in database []](5)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlWindowLastJoin[ SELECT sum(t1.col1) over w1 as sum_t1_col1, t2.str1 as t2_str1
 FROM t1
 last join t2 order by t2.col1
 on t1.col1 = t2.col1 and t1.col2 = t2.col0
 WINDOW w1 AS (
  PARTITION BY t1.col2 ORDER BY t1.col1
  ROWS_RANGE BETWEEN 3 PRECEDING AND CURRENT ROW
 ) limit 10;](1)

♻️ This comment has been updated with latest results.

@aceforeverd aceforeverd changed the title feat(#3006): correct semantic for first_value feat(#3006)!: correct semantic for first_value Apr 10, 2024
Copy link
Contributor

github-actions bot commented Apr 10, 2024

HybridSE Mac Test Report

20 154 tests  ±0   20 152 ✅ +1   10m 31s ⏱️ +9s
   256 suites ±0        2 💤 ±0 
    68 files   ±0        0 ❌  - 1 

Results for commit 7b046f6. ± Comparison against base commit 90e1425.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Apr 10, 2024

HybridSE Linux Test Report

20 154 tests  ±0   20 152 ✅ +1   6m 27s ⏱️ -4s
   256 suites ±0        2 💤 ±0 
    68 files   ±0        0 ❌  - 1 

Results for commit 7b046f6. ± Comparison against base commit 90e1425.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Apr 10, 2024

Linux Test Report

    57 files  +     5     247 suites  +190   1h 40m 50s ⏱️ + 1h 15m 14s
13 252 tests +12 698  13 245 ✅ +12 695  7 💤 +3  0 ❌ ±0 
18 809 runs  +18 254  18 802 ✅ +18 251  7 💤 +3  0 ❌ ±0 

Results for commit 7b046f6. ± Comparison against base commit 90e1425.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@tobegit3hub tobegit3hub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- correct `first_value` semantic, same as `first_value` in standard SQL.
- `first_value` will accept a optional parameter `ignoreNull`
- add `last_value`
@aceforeverd aceforeverd merged commit 66a0dda into 4paradigm:main Apr 17, 2024
26 of 28 checks passed
@aceforeverd aceforeverd deleted the feat-3006-first_value branch April 17, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

breaking change to first_value
3 participants