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

fix(mssql): apply top after distinct #23751

Merged
merged 2 commits into from
Apr 21, 2023
Merged

Conversation

villebro
Copy link
Member

@villebro villebro commented Apr 20, 2023

SUMMARY

This places the DISTINCT keyword before TOP to comply with the dialect specifications. Check this random dialect spec in German for how DISTINCT and TOP work together: https://support.microsoft.com/de-de/office/pr%C3%A4dikate-all-distinct-distinctrow-top-24f2a47d-a803-4c7c-8e81-756fe298ce57

Ping @sfirke

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

@codecov
Copy link

codecov bot commented Apr 20, 2023

Codecov Report

Merging #23751 (68fcde2) into master (b2b8c3e) will decrease coverage by 0.25%.
The diff coverage is 43.47%.

❗ Current head 68fcde2 differs from pull request most recent head fcc5691. Consider uploading reports for the commit fcc5691 to get more accurate results

@@            Coverage Diff             @@
##           master   #23751      +/-   ##
==========================================
- Coverage   68.12%   67.87%   -0.25%     
==========================================
  Files        1922     1924       +2     
  Lines       74104    74381     +277     
  Branches     8101     8106       +5     
==========================================
+ Hits        50481    50486       +5     
- Misses      21545    21818     +273     
+ Partials     2078     2077       -1     
Flag Coverage Δ
hive 52.92% <45.53%> (-0.34%) ⬇️
javascript 54.09% <30.00%> (-0.07%) ⬇️
mysql 78.74% <45.53%> (-0.51%) ⬇️
postgres 78.82% <45.53%> (-0.51%) ⬇️
presto 52.84% <45.53%> (-0.34%) ⬇️
python 82.65% <46.00%> (-0.53%) ⬇️
sqlite 77.31% <45.53%> (-0.50%) ⬇️
unit 52.72% <46.00%> (-0.33%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/SqlLab/actions/sqlLab.js 64.50% <ø> (-0.18%) ⬇️
...frontend/src/SqlLab/components/SaveQuery/index.tsx 75.55% <ø> (ø)
...d/src/SqlLab/components/SqlEditorLeftBar/index.tsx 53.73% <ø> (-0.56%) ⬇️
superset-frontend/src/SqlLab/fixtures.ts 100.00% <ø> (ø)
superset-frontend/src/SqlLab/reducers/sqlLab.js 36.06% <ø> (+0.19%) ⬆️
superset-frontend/src/SqlLab/types.ts 57.14% <ø> (ø)
...onents/Chart/ChartContextMenu/ChartContextMenu.tsx 76.19% <ø> (ø)
...c/components/DeprecatedSelect/DeprecatedSelect.tsx 40.78% <0.00%> (-0.55%) ⬇️
...et-frontend/src/components/TableSelector/index.tsx 78.37% <ø> (-0.85%) ⬇️
...ols/DndColumnSelectControl/ColumnSelectPopover.tsx 3.29% <0.00%> (-0.04%) ⬇️
... and 34 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sfirke
Copy link
Member

sfirke commented Apr 20, 2023

This looks great! I haven't tried it but the code makes sense to me, looks minimal and low-risk of side effects. Thanks @villebro ! Maybe note that it would fix #21027.

@sfirke
Copy link
Member

sfirke commented Apr 21, 2023

Could this be tagged for 2.1.1?

it('should open Explore on dataset name click', () => {
xit('should open Explore on dataset name click', () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

This test has become super flaky lately, and even after restarting cypress 11 times it's still failing.

@villebro
Copy link
Member Author

Could this be tagged for 2.1.1?

Sure, adding the tag now

@villebro villebro added the 2.1.1 label Apr 21, 2023
@villebro villebro merged commit 764c3c9 into apache:master Apr 21, 2023
@villebro villebro deleted the mssql-distinct branch April 21, 2023 14:04
@cwegener
Copy link
Contributor

@villebro There is an English copy of that support article available as well ... I think those support articles all got messed up when Microsoft switched from having the 'KB' numbers as part of their support URLs to just having more SEO-friendly URL paths some years back ....
https://support.microsoft.com/en-au/office/all-distinct-distinctrow-top-predicates-24f2a47d-a803-4c7c-8e81-756fe298ce57

@villebro
Copy link
Member Author

Thanks @cwegener 👍

sebastianliebscher pushed a commit to sebastianliebscher/superset that referenced this pull request Apr 28, 2023
@eschutho eschutho added the v2.1 label May 12, 2023
eschutho pushed a commit to preset-io/superset that referenced this pull request May 23, 2023
eschutho pushed a commit that referenced this pull request May 23, 2023
eschutho pushed a commit that referenced this pull request May 25, 2023
eschutho pushed a commit that referenced this pull request May 31, 2023
@mistercrunch mistercrunch added 🍒 2.1.3 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.1.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS v2.1 🍒 2.1.1 🍒 2.1.2 🍒 2.1.3 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DISTINCT command error Incorrect syntax near the keyword on SQLLab when connect MSSQL database
7 participants