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

Query: Insert Select 1 ordering for rownumber paging when there is no… #19317

Merged
merged 1 commit into from
Dec 16, 2019

Conversation

smitpatel
Copy link
Member

… other ordering

Case when there is no explicit order by and no implicit key ordering for keyless entities

Resolves #18925

… other ordering

Case when there is no explicit order by and no implicit key ordering for keyless entities

Resolves #18925
Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

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

The ORDER BY clause is optional in both PostgreSQL and Sqlite:

DROP TABLE empsalary;
CREATE TABLE empsalary (depname TEXT, salary DOUBLE PRECISION);
INSERT INTO empsalary (depname, salary) VALUES ('Sales', '10'), ('Sales', '20'), ('Engineering', '10');
SELECT depname, ROW_NUMBER() OVER(PARTITION BY depname) FROM empsalary;

In general, I'm still not sure what the story is for provider-specific stuff in SelectExpression... Assuming it's OK for providers to extend SelectExpression, maybe just expose a flag for injecting SELECT 1 (both here and in Skip/Take)?

@smitpatel
Copy link
Member Author

It is likely that SelectExpression may not remain extensible.

@smitpatel
Copy link
Member Author

@roji Filed #19331 to refactor it so that providers can influence.

@smitpatel smitpatel merged commit 0dee026 into master Dec 16, 2019
@smitpatel smitpatel deleted the smit/issue18925 branch December 16, 2019 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The collection argument 'orderings' must contain at least one element
2 participants