Hi,

If the intention is to read hourly data for a month, then the simplest way
is to specify like this.

        <data-in name="input" dataset="logs">
          <start-instance>${coord:current( -(coord:daysInMonth(0) -
1)*24 )}</start-instance>
          <end-instance>${coord:current(0)}</end-instance>
        </data-in>

This takes care of any month, however special handling is required for
daylight saving timezone, for details refer the coordinator functional spec
here.

https://oozie.apache.org/docs/3.1.3-incubating/CoordinatorFunctionalSpec.html

Thanks,
-Idris


On Sat, Nov 29, 2014 at 3:35 AM, J. McConnell <[email protected]>
wrote:

> I am either missing something or have hit a bug and would love if someone
> could help me determine which it is. I am trying to specify start/end
> instances for a month's worth of hourly data in a coordinator.xml file.
> Perhaps there is a better way of doing this, but what I was attempting was:
>
>   <input-events>
>     <data-in name="requests" dataset="request-logs">
>       <start-instance>${coord:offset(-1, 'MONTH')}</start-instance>
>       <end-instance>${coord:offset(-1, 'HOUR')}</end-instance>
>     </data-in>
>   </input-events>
>
> Where nominal time for an action would be midnight of the first of the next
> month. When submitting this, I get the error:
>
> start-instance should be equal or earlier than the end-instance
>
> That doesn't seem right. Looking at the code where the error is generated,
> this doesn't look right, either:
>
>                 if (funcType == OFFSET) {
>                      TimeUnit startU = TimeUnit.valueOf(startRestArg);
>                      TimeUnit endU = TimeUnit.valueOf(endRestArg);
>                      if (startU.getCalendarUnit() * startIndex >
> endU.getCalendarUnit() * endIndex) {
>                          throw new CommandException(ErrorCode.E1010,
>                                  " start-instance should be equal or
> earlier than the end-instance \n"
>                                          + XmlUtils.prettyPrint(event));
>                      }
>                      ...
>                 }
>
> IIUC, the ints returned by startU/endU.getCalendarUnit() have no relation
> to the magnitude of the unit, so scaling them by startIndex/endIndex is
> meaningless. Just after this block, the actual dates are resolved. At that
> point, it could be determined easily whether one instance came before
> another.
>
> Have I missed something? Does anyone have any suggestions for another
> method of grabbing a month's worth of hourly data?
>
> Thanks in advance for whatever help you can provide,
>
> - J.
>
> --
> J. McConnell
> Founder, Übermensch Consulting
>

Reply via email to