[
https://issues.apache.org/jira/browse/ORC-8?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15107168#comment-15107168
]
ASF GitHub Bot commented on ORC-8:
----------------------------------
Github user asandryh commented on a diff in the pull request:
https://github.com/apache/orc/pull/15#discussion_r50154961
--- Diff: tools/src/FileMetadata.cc ---
@@ -16,168 +16,162 @@
* limitations under the License.
*/
+#include <getopt.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <sstream>
-#include <iomanip>
-#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<footer.stripes_size(); stripeIx++) {
- stripe = footer.stripes(stripeIx-1);
- uint64_t prevStripeOffset = stripe.offset();
- uint64_t prevStripeLen = stripe.datalength() + stripe.indexlength() +
- stripe.footerlength();
- paddedBytes += footer.stripes(stripeIx).offset() -
- (prevStripeOffset + prevStripeLen);
- };
- return paddedBytes;
+void printStripeInformation(std::ostream& out,
+ uint64_t index,
+ uint64_t columns,
+ std::unique_ptr<orc::StripeInformation> stripe,
+ bool verbose) {
+ out << " { \"stripe\": " << index
+ << ", \"rows\": " << stripe->getNumberOfRows() << ",\n";
+ out << " \"offset\": " << stripe->getOffset()
+ << ", \"length\": " << stripe->getLength() << ",\n";
--- End diff --
This is nit-picking, but I find the output more readable if there are no
newlines on lines 34 and 36 (and, correspondingly, no extra white space on
lines 35 and 37). The output appears more consistent when we print either one
parameter per line or all parameters on one line.
> Replace tool implementation to use Reader interface
> ---------------------------------------------------
>
> Key: ORC-8
> URL: https://issues.apache.org/jira/browse/ORC-8
> Project: Orc
> Issue Type: Bug
> Reporter: Owen O'Malley
> Assignee: Owen O'Malley
>
> Currently FileMetadata is using custom parsing of the ORC footer and
> postscript. It should use the standard interface from Reader.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)