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

ESQL: Add CEIL function #98847

Merged
merged 17 commits into from Aug 28, 2023
Merged

ESQL: Add CEIL function #98847

merged 17 commits into from Aug 28, 2023

Conversation

alex-spies
Copy link
Contributor

@alex-spies alex-spies commented Aug 24, 2023

Add the unary scalar function CEIL.

It takes a single double argument which is rounded up, and is a noop for integer arguments. Analogous to FLOOR.

  • Implement CEIL, add it to the function registry and make sure it is serializable.
  • Add csv tests, unit tests and docs.
  • Add additional csv tests with different data types and some edge cases for both CEIL and FLOOR
  • Add unit tests and update docs for FLOOR.

@alex-spies alex-spies added >enhancement Team:QL (Deprecated) Meta label for query languages team ES|QL-ui Impacts ES|QL UI v8.11.0 labels Aug 24, 2023
@github-actions
Copy link

Documentation preview:

@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label and removed Team:QL (Deprecated) Meta label for query languages team labels Aug 24, 2023
Comment on lines +42 to +43
* from within Intellij or, alternatively, via Gradle:
* {@code ./gradlew -p x-pack/plugin/esql test --tests "org.elasticsearch.xpack.esql.CsvTests"}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this because, at least on my Windows, running from within Intellij IDEA does not work for some classpath/dependency resolution reasons.

@alex-spies alex-spies added Team:QL (Deprecated) Meta label for query languages team :Analytics/ES|QL AKA ESQL and removed ES|QL-ui Impacts ES|QL UI needs:triage Requires assignment of a team area label labels Aug 24, 2023
@alex-spies
Copy link
Contributor Author

@elasticsearchmachine run Check labels

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-ql (Team:QL)

@elasticsearchmachine
Copy link
Collaborator

Hi @alex-spies, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/elasticsearch-esql (:Query Languages/ES|QL)

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

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

LGTM

docs/reference/esql/functions/ceil.asciidoc Show resolved Hide resolved
@alex-spies
Copy link
Contributor Author

@elasticsearchmachine run elasticsearch-ci/part-1

@alex-spies
Copy link
Contributor Author

Hm, SnapshotResiliencyTests » testSnapshotWithNodeDisconnects fails, but this seems unrelated/transient and I cannot reproduce locally. I'll try to re-run the CI one more time.

@alex-spies
Copy link
Contributor Author

@elasticsearchmachine run elasticsearch-ci/part-1

Copy link
Contributor

@abdonpijpelink abdonpijpelink left a 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 small docs suggestions, to put every command on its own line. Fixing it for FLOOR too, while we're at it.

@alex-spies alex-spies merged commit ca3dc3a into elastic:main Aug 28, 2023
12 checks passed
@alex-spies alex-spies deleted the esql-ceil-function branch August 28, 2023 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >enhancement Team:QL (Deprecated) Meta label for query languages team v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants