You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/05/24 09:16:52 UTC

[GitHub] [incubator-pinot] reallocf opened a new pull request #5438: Add additional datetime functionality

reallocf opened a new pull request #5438:
URL: https://github.com/apache/incubator-pinot/pull/5438


   This PR continues to add more datetime functionality during both ingestion and query time. It is inspired by PrestoDB's datetime functionality, detailed here: https://prestodb.io/docs/current/functions/datetime.html
   
   Also does some refactoring of FunctionRegistry to allow for function overloading.
   
   New functions include:
   1. `timezone` -> returns a DateTimeZone to be passed into other functions
   2. `timezone_hour` -> returns the hour difference between the passed timezone and UTC
   3. `timezone_minute` -> returns the minute difference between the passed timezone and UTC
   4. `day` -> returns the day of the month for the passed epoch time, can pass in timezone as well
   5. `day_of_month` -> alias for `day`
   6. `day_of_week` -> returns the day of the week for the passed epoch time, can pass in timezone as well
   7. `dow` -> alias for `day_of_week`
   8. `day_of_year` -> returns the day of the year for the passed epoch time, can pass in timezone as well
   9. `doy` -> alias for `day_of_year`
   10. `hour` -> returns the hour of the day for the passed epoch time, can pass in timezone as well
   11. `millisecond` -> returns the number of milliseconds since the last second for the passed epoch time, can pass in timezone as well
   12. `minute` -> return the number of minutes of the hour for the passed epoch time, can pass in timezone as well
   13. `month` -> return the month of the year for the passed epoch time, can pass in timezone as well
   14. `quarter` -> return the quarter of the year for the passed epoch time, can pass in timezone as well
   15. `second` -> return the number of seconds of the minute for the passed epoch time, can pass in timezone as well
   16. `week` -> return the week of the year for the passed epoch time, can pass in timezone as well
   17. `year` -> return the year for the passed epoch time, can pass in timezone as well
   18. `year_of_week` -> return the year of week for the passed epoch time, can pass in timezone as well
   19. `yow` -> alias for `year_of_week`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] fx19880617 commented on pull request #5438: Add additional datetime functionality

Posted by GitBox <gi...@apache.org>.
fx19880617 commented on pull request #5438:
URL: https://github.com/apache/incubator-pinot/pull/5438#issuecomment-638364905


   Overall lgtm, could you also add some integration tests for this.
   
   Also for the null primitive arguments functions, do we expect them to be only in nested functions? like `SELECT timezone_hour(timezone('UTC')) from myTable`
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] fx19880617 commented on pull request #5438: Add additional datetime functionality

Posted by GitBox <gi...@apache.org>.
fx19880617 commented on pull request #5438:
URL: https://github.com/apache/incubator-pinot/pull/5438#issuecomment-640925133


   Could you try to resolve the conflict and then we can merge this.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] npawar commented on pull request #5438: Add additional datetime functionality

Posted by GitBox <gi...@apache.org>.
npawar commented on pull request #5438:
URL: https://github.com/apache/incubator-pinot/pull/5438#issuecomment-673003546


   @fx19880617 i've resolved the merge conflicts on this one. could you take a look again?
   @KKcorps i had to change the ScalarTransformFunctionWrapper constructor. Please look if these changes are fine. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] kishoreg commented on pull request #5438: Add additional datetime functionality

Posted by GitBox <gi...@apache.org>.
kishoreg commented on pull request #5438:
URL: https://github.com/apache/incubator-pinot/pull/5438#issuecomment-650900742


   @reallocf can we resolve conflicts and merge this


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] KKcorps commented on pull request #5438: Add additional datetime functionality

Posted by GitBox <gi...@apache.org>.
KKcorps commented on pull request #5438:
URL: https://github.com/apache/incubator-pinot/pull/5438#issuecomment-673017035


   @reallocf Can we keep java function names in camelCase and use @ScalarFunction annotation's name parameter to provide names to be used in queries?
   Otherwise LGTM! Some tests are failing though. Please take a look at them.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] Jackie-Jiang merged pull request #5438: Add additional datetime functionality

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang merged pull request #5438:
URL: https://github.com/apache/incubator-pinot/pull/5438


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] npawar commented on pull request #5438: Add additional datetime functionality

Posted by GitBox <gi...@apache.org>.
npawar commented on pull request #5438:
URL: https://github.com/apache/incubator-pinot/pull/5438#issuecomment-673033710


   > @reallocf Can we keep java function names in camelCase and use @ScalarFunction annotation's name parameter to provide names to be used in queries?
   > Otherwise LGTM! Some tests are failing though. Please take a look at them.
   
   Fixed both


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] npawar edited a comment on pull request #5438: Add additional datetime functionality

Posted by GitBox <gi...@apache.org>.
npawar edited a comment on pull request #5438:
URL: https://github.com/apache/incubator-pinot/pull/5438#issuecomment-673033710


   > @reallocf Can we keep java function names in camelCase and use @ScalarFunction annotation's name parameter to provide names to be used in queries?
   > Otherwise LGTM! Some tests are failing though. Please take a look at them.
   
   Fixed both. Tests are also passing now @KKcorps 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org