MCPcopy Create free account
hub / github.com/apache/orc / printStripeInformation

Function printStripeInformation

tools/src/FileMetadata.cc:33–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31#include <google/protobuf/text_format.h>
32
33void printStripeInformation(std::ostream& out, uint64_t index, uint64_t columns,
34 std::unique_ptr<orc::StripeInformation> stripe, bool verbose) {
35 out << " { \"stripe\": " << index << ", \"rows\": " << stripe->getNumberOfRows() << ",\n";
36 out << " \"offset\": " << stripe->getOffset() << ", \"length\": " << stripe->getLength()
37 << ",\n";
38 out << " \"index\": " << stripe->getIndexLength()
39 << ", \"data\": " << stripe->getDataLength() << ", \"footer\": " << stripe->getFooterLength();
40 if (verbose) {
41 out << ",\n \"encodings\": [\n";
42 for (uint64_t col = 0; col < columns; ++col) {
43 if (col != 0) {
44 out << ",\n";
45 }
46 orc::ColumnEncodingKind encoding = stripe->getColumnEncoding(col);
47 out << " { \"column\": " << col << ", \"encoding\": \""
48 << columnEncodingKindToString(encoding) << "\"";
49 if (encoding == orc::ColumnEncodingKind_DICTIONARY ||
50 encoding == orc::ColumnEncodingKind_DICTIONARY_V2) {
51 out << ", \"count\": " << stripe->getDictionarySize(col);
52 }
53 out << " }";
54 }
55 out << "\n ],\n";
56 out << " \"streams\": [\n";
57 for (uint64_t str = 0; str < stripe->getNumberOfStreams(); ++str) {
58 if (str != 0) {
59 out << ",\n";
60 }
61 std::unique_ptr<orc::StreamInformation> stream = stripe->getStreamInformation(str);
62 out << " { \"id\": " << str << ", \"column\": " << stream->getColumnId()
63 << ", \"kind\": \"" << streamKindToString(stream->getKind())
64 << "\", \"offset\": " << stream->getOffset() << ", \"length\": " << stream->getLength()
65 << " }";
66 }
67 out << "\n ]";
68 std::string tz = stripe->getWriterTimezone();
69 if (tz.length() != 0) {
70 out << ",\n \"timezone\": \"" << tz << "\"";
71 }
72 }
73 out << "\n }";
74}
75
76void printRawTail(std::ostream& out, const char* filename) {
77 out << "Raw file tail: " << filename << "\n";

Callers 1

printMetadataFunction · 0.85

Calls 15

streamKindToStringFunction · 0.85
getDictionarySizeMethod · 0.80
getNumberOfStreamsMethod · 0.80
getStreamInformationMethod · 0.80
lengthMethod · 0.80
getNumberOfRowsMethod · 0.65
getOffsetMethod · 0.65
getLengthMethod · 0.65
getIndexLengthMethod · 0.65
getDataLengthMethod · 0.65
getFooterLengthMethod · 0.65

Tested by

no test coverage detected