Skip to content

Conversation

@matriv
Copy link
Contributor

@matriv matriv commented Mar 29, 2019

After TIME SQL data type is introduced, implement
CURRENT_TIME/CURTIME functions similar to CURRENT_TIMESTAMP
that return the system's current time (only, without the date part).

Closes: #40648

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@matriv
Copy link
Contributor Author

matriv commented Mar 29, 2019

Needs to wait for #39802 and be rebased on top.

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

Copy link
Member

Choose a reason for hiding this comment

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

which is -> which are.

Copy link
Member

Choose a reason for hiding this comment

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

This should be a NOTE: or WARNING:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't use them in the limitations page. In the grouping.asciidoc there is and IMPORTANT paragraph mentioning the same limitation.

Copy link
Member

Choose a reason for hiding this comment

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

An alternative is to move these tests back to the docs.csv-spec and mark them as -Ignore which means they will not be ran.

After `TIME` SQL data type is introduced, implement
`CURRENT_TIME/CURTIME` functions similar to CURRENT_TIMESTAMP
that return the system's current time (only, without the date part).

Closes: elastic#40468
@matriv matriv removed the WIP label Apr 3, 2019
@matriv matriv requested a review from astefan April 3, 2019 13:46
Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

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

LGTM. Left few comments regarding the documentation.

--------------------------------------------------

["source","sql",subs="attributes,callouts,macros"]
--------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

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

Twice the same query? (see above)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be an example for CURTIME, fixing it.

[source, sql]
--------------------------------------------------
CURRENT_TIME
CURRENT_TIME(precision <1>)
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we were using the CURRENT_TIME([precision <1>]) (square brackets) for optional parameters, but looking at CURRENT_TIMESTAMP I see the same approach. Other functions (ROUND, TRUNCATE and few string functions) use the square brackets format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding the square brackets, will also fix it for CURRENT_TIMESTAMP with a separate PR.

--------------------------------------------------

[IMPORTANT]
Currently, Using a _precision_ greater than 3 doesn't make any difference to the output of the
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, lowercase Using.

@matriv matriv merged commit 9feede7 into elastic:master Apr 3, 2019
@matriv matriv deleted the mt/impl-40648 branch April 3, 2019 17:35
matriv added a commit that referenced this pull request Apr 4, 2019
After `TIME` SQL data type is introduced, implement
`CURRENT_TIME/CURTIME` functions similarly to CURRENT_TIMESTAMP
that return the system's current time (only, without the date part).

Closes: #40468
(cherry picked from commit 9feede7)
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
After `TIME` SQL data type is introduced, implement
`CURRENT_TIME/CURTIME` functions similarly to CURRENT_TIMESTAMP
that return the system's current time (only, without the date part).

Closes: elastic#40468
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQL: Implement CURTIME()/CURRENT_TIME()

5 participants