Support for PARTITION BY in window #163

Merged
merged 3 commits into from Jun 26, 2014

Conversation

Projects
None yet
7 participants

Plus a minor correction to window expression building.

👍 thanks @alexstaubo! 👏

👍

jgn commented May 9, 2014

So this never got merged in? :-(

Oh? It says it's merged. Edit: Never mind, that was the other one.

jgn commented May 9, 2014

I guess I'm misreading.

Yours:
atombender/arel@e064f28#diff-e2f363fcc02b32600ab3e4a3f689d421R774
Master:
https://github.com/rails/arel/blob/master/lib/arel/nodes/window.rb#L4

On Fri, May 9, 2014 at 3:41 PM, Alexander Staubo
notifications@github.comwrote:

Oh? It says it's merged.


Reply to this email directly or view it on GitHubhttps://github.com/rails/arel/pull/163#issuecomment-42711449
.

John G. Norman
Chief Software Architect
Iora Health
The American Twine Building
222 Third Street, Suite 3100
Cambridge MA 02142

No, you're right, I was looking at the wrong pull request.

jgn commented May 9, 2014

Well . . . it's great stuff!!

On Fri, May 9, 2014 at 3:51 PM, Alexander Staubo
notifications@github.comwrote:

No, you're right, I was looking at the wrong pull request.


Reply to this email directly or view it on GitHubhttps://github.com/rails/arel/pull/163#issuecomment-42712385
.

John G. Norman
Chief Software Architect
Iora Health
The American Twine Building
222 Third Street, Suite 3100
Cambridge MA 02142

@atombender - Do you have any idea how can I get "PARTITION BY" working with Rails 3 (without your pull request of course)?

@motymichaely Unfortunately, no.

Thanks.

@atombender - is there any way to monkey patch stuff to make it work? Or pure sql is the way to go?

@motymichaely I probably would just use pure SQL.

Thanks!

Member

vipulnsward commented Jun 20, 2014

I checked this patch locally. Looks great!
Much needed, since we already have windows but no support for partition.

@atombender this needs a rebase.

@rafaelfranca any thoughts if this can be merged, or any changes that are required?

I did a rebase. Hopefully should be correct.

+ SELECT FROM "users" WINDOW "a_window" AS (PARTITION BY "users"."bar", "users"."baz")
+ }
+ end
+
@vipulnsward

vipulnsward Jun 22, 2014

Member

@atombender would this take care of PARTITION and ORDER. If yes, would be nice to have a test for it.

@atombender

atombender Jun 22, 2014

Just added a test for both.

tenderlove added a commit that referenced this pull request Jun 26, 2014

Merge pull request #163 from atombender/master
Support for PARTITION BY in window

@tenderlove tenderlove merged commit ebbd786 into rails:master Jun 26, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment