datawave icon indicating copy to clipboard operation
datawave copied to clipboard

Add date capabilities to #GROUPBY

Open lbschanno opened this issue 11 months ago • 3 comments

Add the ability to subselect part of a date in the #GROUPBY function. These can now be specified similar to the #UNIQUE function, and support the granularities MILLISECOND, SECOND, TENTH_OF_HOUR, HOUR, DAY, MONTH, and YEAR. In addition, the following functions have been added:

#GROUPBY_MILLISECOND() #GROUPBY_SECOND() #GROUPBY_TENTH_OF_HOUR() #GROUPBY_HOUR() #GROUPBY_DAY() #GROUPBY_MONTH() #GROUPBY_YEAR()

Closes #2703

lbschanno avatar Feb 05 '25 04:02 lbschanno

@FineAndDandy the original values are returned rather than the truncated values because the ticket did not specify a requirement that the transformed values should be returned, just that sub-selecting should be done on the transformed values. However, it could very well be that transformed values are supposed to be returned.

@ivakegg are the transformed or original values supposed to be returned by the #GROUPBY function when sub-selecting by dates?

lbschanno avatar Feb 20 '25 23:02 lbschanno

@ivakegg are the transformed or original values supposed to be returned by the #GROUPBY function when sub-selecting by dates?

I would expect that the truncated values are the ones that are in the groups being returned.

ivakegg avatar Feb 21 '25 18:02 ivakegg

Great tests, as usual.

hlgp avatar Mar 07 '25 21:03 hlgp