Return-Path: X-Original-To: apmail-orc-dev-archive@minotaur.apache.org Delivered-To: apmail-orc-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6E6B918F7C for ; Tue, 19 Jan 2016 18:42:45 +0000 (UTC) Received: (qmail 94061 invoked by uid 500); 19 Jan 2016 18:42:42 -0000 Delivered-To: apmail-orc-dev-archive@orc.apache.org Received: (qmail 93988 invoked by uid 500); 19 Jan 2016 18:42:42 -0000 Mailing-List: contact dev-help@orc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@orc.apache.org Delivered-To: mailing list dev@orc.apache.org Received: (qmail 93152 invoked by uid 99); 19 Jan 2016 18:42:41 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jan 2016 18:42:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 91F94E00DC; Tue, 19 Jan 2016 18:42:41 +0000 (UTC) From: asandryh To: dev@orc.apache.org Reply-To: dev@orc.apache.org References: In-Reply-To: Subject: [GitHub] orc pull request: ORC-8. Reimplement file-metadata to use the read... Content-Type: text/plain Message-Id: <20160119184241.91F94E00DC@git1-us-west.apache.org> Date: Tue, 19 Jan 2016 18:42:41 +0000 (UTC) Github user asandryh commented on a diff in the pull request: https://github.com/apache/orc/pull/15#discussion_r50154368 --- Diff: tools/src/FileMetadata.cc --- @@ -16,168 +16,162 @@ * limitations under the License. */ +#include #include #include #include #include #include -#include -#include "wrap/orc-proto-wrapper.hh" #include "orc/OrcFile.hh" -using namespace orc::proto; - -uint64_t getTotalPaddingSize(const Footer& footer) { - uint64_t paddedBytes = 0; - StripeInformation stripe; - for (int stripeIx=1; stripeIx stripe, + bool verbose) { + out << " { \"stripe\": " << index + << ", \"rows\": " << stripe->getNumberOfRows() << ",\n"; + out << " \"offset\": " << stripe->getOffset() + << ", \"length\": " << stripe->getLength() << ",\n"; + out << " \"index\": " << stripe->getIndexLength() + << ", \"data\": " << stripe->getDataLength() + << ", \"footer\": " << stripe->getFooterLength(); + if (verbose) { + out << ",\n \"encodings\": [\n"; + for(uint64_t col=0; col < columns; ++col) { + if (col != 0) { + out << ",\n"; + } + orc::ColumnEncodingKind encoding = stripe->getColumnEncoding(col); + out << " { \"column\": " << col + << ", \"encoding\": \"" + << columnEncodingKindToString(encoding) << "\""; + if (encoding == orc::ColumnEncodingKind_DICTIONARY || + encoding == orc::ColumnEncodingKind_DICTIONARY_V2) { + out << ", \"count\": " << stripe->getDictionarySize(col); + } + out << " }"; + } + out << "\n ],\n"; + out << " \"streams\": [\n"; + for(uint64_t str = 0; str < stripe->getNumberOfStreams(); ++str) { + if (str != 0) { + out << ",\n"; + } + ORC_UNIQUE_PTR stream = + stripe->getStreamInformation(str); + out << " { \"id\": " << str + << ", \"column\": " << stream->getColumnId() + << ", \"kind\": \"" << streamKindToString(stream->getKind()) + << "\",\n"; + out << " \"offset\": " << stream->getOffset() --- End diff -- This is may be nit-picking, but I find the output more readable if lines 67-68 are replaced with: << ", \"offset\": " << stream->getOffset() --- 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. ---