orc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From majetideepak <...@git.apache.org>
Subject [GitHub] orc pull request #110: ORC-87: [C++] Handle missing timezone conversion for ...
Date Wed, 26 Apr 2017 14:13:36 GMT
Github user majetideepak commented on a diff in the pull request:

    --- Diff: c++/src/Reader.cc ---
    @@ -526,16 +526,25 @@ namespace orc {
         if (metadata.get() == nullptr) {
           throw std::logic_error("No stripe statistics in file");
    +    auto currentStripeInfo = footer->stripes(static_cast<int>(stripeIndex));
    +    auto currentStripeFooter = getStripeFooter(currentStripeInfo, *contents.get());
    +    const Timezone& writerTZ =
    +      currentStripeFooter.has_writertimezone() ?
    +        getTimezoneByName(currentStripeFooter.writertimezone()) :
    +        getLocalTimezone();
    +    StatContext statContext;
    +    statContext.correctStats = hasCorrectStatistics();
    +    statContext.writerTimezone = &writerTZ;
         return std::unique_ptr<Statistics>
           (new StatisticsImpl(metadata->stripestats
    -                          (static_cast<int>(stripeIndex)),
    -                          hasCorrectStatistics()));
    +                          (static_cast<int>(stripeIndex)), statContext));
       std::unique_ptr<Statistics> ReaderImpl::getStatistics() const {
    +    StatContext statContext;
    +    statContext.correctStats = hasCorrectStatistics();
    --- End diff --
    `getStatistics()` is returning the statistics in the file footer. As far as I understood,
there is no timezone information available in the file footer. Looks like the timezone is
stored for each stripe.
    I am also curious about this design choice. I would imagine the file footer to have the
timezone information. Is it possible for different stripes to have different timezone values?

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message