-
Notifications
You must be signed in to change notification settings - Fork 25k
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
[ES|QL] Allow DateTime as the third and fourth inputs to auto_bucket #104547
Conversation
…_bucket Committer: Fang Xing <[email protected]>
Pinging @elastic/es-analytical-engine (Team:Analytics) |
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.
Looks about right! I've left a few comments asking to move some methods around and run the formatter, but it does seem to get the job done!
.../test/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucketTests.java
Outdated
Show resolved
Hide resolved
...l/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucket.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/TypeResolutions.java
Outdated
Show resolved
Hide resolved
Thanks for reviewing! All of the comments are addressed. |
...l/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucket.java
Outdated
Show resolved
Hide resolved
.../test/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucketTests.java
Outdated
Show resolved
Hide resolved
.../test/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucketTests.java
Outdated
Show resolved
Hide resolved
@fang-xing-esql I've made two more small suggestions. That second one about randomization should be fun to learn about. It's quite useful and the way we randomize our tests is fairly unique. Very not-quickcheck. Very low overhead at write and runtime but kind of annoying to reproduce. It works ok though! |
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.
Left a couple of comments.
x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/TypeResolutions.java
Outdated
Show resolved
Hide resolved
...l/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucket.java
Outdated
Show resolved
Hide resolved
Thank you for the suggestions! |
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.
LGTM
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.
Forgot to mention - please add some basic csv tests, next to the existing auto-bucket ones.
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.
LG, only left minor notes.
...l/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucket.java
Show resolved
Hide resolved
...l/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucket.java
Outdated
Show resolved
Hide resolved
...l/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucket.java
Outdated
Show resolved
Hide resolved
.../test/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucketTests.java
Outdated
Show resolved
Hide resolved
.../test/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucketTests.java
Show resolved
Hide resolved
Added a new test case, and modified a few existing test cases in CsvTest to allow auto_bucket to take DateTime as input. |
Thank you for reviewing, all of the comments are addressed. |
@elasticmachine run buildkite/docs-build-pr |
@elasticmachine run buildkite/docs-build-pr |
run docs-build |
Resolves: #102756 #104646
Currently, the AUTO_BUCKET function takes only String data type for the start and end time range. This enhances the AUTO_BUCKET function by allowing data with DateTime type as input to the start and end time range, users do not need to convert the input parameters from DateTime to String type manually.
The AUTO_BUCKET function does not allow variables as input to the start and end time range yet, this will be addressed in a separate PR.