-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Convert built-in row_number to user-defined window function
#12030
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
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
6d66621
Adds new crate for window functions
jcsherin d49e4b8
Moves `row_number` to window functions crate
jcsherin 4886ebf
Fixes build errors
jcsherin a8692e0
Regenerates protobuf
jcsherin 2dcc41f
Makes `row_number` no-op temporarily
jcsherin 772bd6d
Minor: fixes formatting
jcsherin 3286d4b
Implements `WindowUDF` for `row_number`
jcsherin fa03665
Minor: fixes formatting
jcsherin ea5dc67
Adds singleton instance of UDWF: `row_number`
jcsherin b8798db
Adds partition evaluator
jcsherin 706b36d
Registers default window functions
jcsherin ec0c4ed
Implements `evaluate_all`
jcsherin 712010d
Fixes: allow non-uppercase globals
jcsherin 5a28098
Minor: prefix underscore for unused variable
jcsherin 2950e7f
Minor: fixes formatting
jcsherin 0785a54
Uses `row_number_udwf`
jcsherin 3a9b8d6
Fixes: unparser test for `row_number`
jcsherin bb9ec52
Uses row number to represent functional dependency
jcsherin 8e5588e
Minor: fixes formatting
jcsherin 152c447
Removes `row_number` from case-insensitive name test
jcsherin b901840
Deletes wrapper for `row_number` window expression
jcsherin 6a5f4fe
Merge branch 'main' into window-udf-row-number
jcsherin 666ea21
Fixes: lowercase name in error statement
jcsherin 29563b4
Fixes: `row_number` fields are not nullable
jcsherin 1920dd1
Fixes: lowercase name in explain output
jcsherin 7950bb1
Updates Cargo.lock
jcsherin 5b4ce46
Fixes: lowercase name in explain output
jcsherin 4782eee
Adds support for result ordering
jcsherin 1c9fa23
Merge branch 'main' into window-udf-row-number
jcsherin c3c923d
Minor: add newline between methods
jcsherin c7e1836
Fixes: re-export crate name in doc comments
jcsherin 2c3725f
Adds doc comment for `WindowUDFImpl::nullable`
jcsherin 49659d1
Minor: renames variable
jcsherin 8f33840
Minor: update doc comments
jcsherin 3dd236b
Deletes code
jcsherin 8400cf9
Minor: update doc comments
jcsherin f1c9d15
Minor: adds period
jcsherin 3e2da97
Adds doc comment for `row_number` window UDF
jcsherin a3ef37b
Adds fluent API for creating `row_number` expression
jcsherin bf516d9
Minor: removes unnecessary path prefix
jcsherin ac902ef
Adds roundtrip logical plan test case
jcsherin 33a39b7
Merge branch 'main' into window-udf-row-number
jcsherin c6d39d0
Updates unit tests for `row_number`
jcsherin e3f2196
Deletes code
jcsherin 2162649
Merge branch 'main' into window-udf-row-number
jcsherin 157bc5f
Minor: copy edit doc comments
jcsherin d2fed86
Minor: deletes comment
jcsherin f54c07c
Minor: copy edits udwf doc comments
jcsherin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| [package] | ||
| name = "datafusion-functions-window" | ||
| description = "Window function packages for the DataFusion query engine" | ||
| keywords = ["datafusion", "logical", "plan", "expressions"] | ||
| readme = "README.md" | ||
| version = { workspace = true } | ||
| edition = { workspace = true } | ||
| homepage = { workspace = true } | ||
| repository = { workspace = true } | ||
| license = { workspace = true } | ||
| authors = { workspace = true } | ||
| rust-version = { workspace = true } | ||
|
|
||
| [lints] | ||
| workspace = true | ||
|
|
||
| [lib] | ||
| name = "datafusion_functions_window" | ||
| path = "src/lib.rs" | ||
|
|
||
| # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
|
||
| [dependencies] | ||
| datafusion-common = { workspace = true } | ||
| datafusion-expr = { workspace = true } | ||
| datafusion-physical-expr-common = { workspace = true } | ||
| log = { workspace = true } | ||
|
|
||
| [dev-dependencies] | ||
| arrow = { workspace = true } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| <!--- | ||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
| --> | ||
|
|
||
| # DataFusion Window Function Library | ||
|
|
||
| [DataFusion][df] is an extensible query execution framework, written in Rust, that uses Apache Arrow as its in-memory format. | ||
|
|
||
| This crate contains user-defined window functions. | ||
|
|
||
| [df]: https://crates.io/crates/datafusion |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any suggestions on what keywords to place here?