Skip to content

Commit

Permalink
Clean up Parquet reader file headers (#7414)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #7414

Test Plan: bypass-github-export-checks

Reviewed By: Yuhta

Differential Revision: D51040600

Pulled By: xiaoxmeng

fbshipit-source-id: 2b8306427fde8086d5c4f12d038b1b8764a93acb
  • Loading branch information
yingsu00 authored and facebook-github-bot committed Nov 7, 2023
1 parent 9e8e6ae commit 33538dd
Show file tree
Hide file tree
Showing 19 changed files with 65 additions and 41 deletions.
1 change: 0 additions & 1 deletion velox/dwio/parquet/reader/IntegerColumnReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#pragma once

#include "velox/dwio/common/SelectiveIntegerColumnReader.h"
#include "velox/dwio/parquet/reader/ParquetColumnReader.h"

namespace facebook::velox::parquet {

Expand Down
1 change: 0 additions & 1 deletion velox/dwio/parquet/reader/NestedStructureDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include "velox/dwio/parquet/reader/NestedStructureDecoder.h"

#include "velox/common/base/Exceptions.h"
#include "velox/dwio/common/BufferUtil.h"

namespace facebook::velox::parquet {
Expand Down
9 changes: 2 additions & 7 deletions velox/dwio/parquet/reader/PageReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,13 @@
*/

#include "velox/dwio/parquet/reader/PageReader.h"
#include "velox/common/compression/LzoDecompressor.h"

#include "velox/dwio/common/BufferUtil.h"
#include "velox/dwio/common/ColumnVisitors.h"
#include "velox/dwio/parquet/reader/NestedStructureDecoder.h"
#include "velox/dwio/parquet/thrift/ThriftTransport.h"
#include "velox/vector/FlatVector.h"

#include <lz4.h>
#include <snappy.h>
#include <thrift/protocol/TCompactProtocol.h> //@manual
#include <zlib.h>
#include <zstd.h>
#include <thrift/protocol/TCompactProtocol.h> // @manual

namespace facebook::velox::parquet {

Expand Down
4 changes: 2 additions & 2 deletions velox/dwio/parquet/reader/PageReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#pragma once

#include <arrow/util/rle_encoding.h>
#include "velox/common/compression/Compression.h"
#include "velox/dwio/common/BitConcatenation.h"
#include "velox/dwio/common/DirectDecoder.h"
Expand All @@ -26,7 +25,8 @@
#include "velox/dwio/parquet/reader/ParquetTypeWithId.h"
#include "velox/dwio/parquet/reader/RleBpDataDecoder.h"
#include "velox/dwio/parquet/reader/StringDecoder.h"
#include "velox/vector/BaseVector.h"

#include <arrow/util/rle_encoding.h>

namespace facebook::velox::parquet {

Expand Down
4 changes: 2 additions & 2 deletions velox/dwio/parquet/reader/ParquetColumnReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
//

#include "velox/dwio/parquet/reader/ParquetColumnReader.h"

#include "velox/dwio/common/SelectiveColumnReaderInternal.h"
#include "velox/dwio/parquet/reader/BooleanColumnReader.h"
#include "velox/dwio/parquet/reader/FloatingPointColumnReader.h"
#include "velox/dwio/parquet/reader/IntegerColumnReader.h"
#include "velox/dwio/parquet/reader/RepeatedColumnReader.h"
#include "velox/dwio/parquet/reader/Statistics.h"
#include "velox/dwio/parquet/reader/StringColumnReader.h"
#include "velox/dwio/parquet/reader/StructColumnReader.h"

#include "velox/dwio/parquet/reader/Statistics.h"
#include "velox/dwio/parquet/thrift/ParquetThriftTypes.h"

namespace facebook::velox::parquet {
Expand Down
2 changes: 2 additions & 0 deletions velox/dwio/parquet/reader/ParquetData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/

#include "velox/dwio/parquet/reader/ParquetData.h"

#include "velox/dwio/common/BufferedInput.h"
#include "velox/dwio/parquet/reader/Statistics.h"

namespace facebook::velox::parquet {
Expand Down
14 changes: 9 additions & 5 deletions velox/dwio/parquet/reader/ParquetData.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,20 @@

#pragma once

#include <thrift/protocol/TCompactProtocol.h> //@manual
#include "velox/common/base/RawVector.h"
#include "velox/dwio/common/BufferUtil.h"
#include "velox/dwio/common/BufferedInput.h"
#include "velox/dwio/common/ScanSpec.h"
#include "velox/dwio/parquet/reader/PageReader.h"
#include "velox/dwio/parquet/thrift/ParquetThriftTypes.h"
#include "velox/dwio/parquet/thrift/ThriftTransport.h"

namespace facebook::velox::common {
class ScanSpec;
} // namespace facebook::velox::common

namespace facebook::velox::dwio::common {
class BufferedInput;
} // namespace facebook::velox::dwio::common

namespace facebook::velox::parquet {

class ParquetParams : public dwio::common::FormatParams {
public:
ParquetParams(
Expand Down
7 changes: 4 additions & 3 deletions velox/dwio/parquet/reader/ParquetReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
*/

#include "velox/dwio/parquet/reader/ParquetReader.h"
#include <thrift/protocol/TCompactProtocol.h> //@manual
#include "velox/dwio/common/MetricsLog.h"
#include "velox/dwio/common/TypeUtils.h"

#include "velox/dwio/parquet/reader/ParquetColumnReader.h"
#include "velox/dwio/parquet/reader/StructColumnReader.h"
#include "velox/dwio/parquet/thrift/ThriftTransport.h"

#include <thrift/protocol/TCompactProtocol.h> //@manual

namespace facebook::velox::parquet {

using dwio::common::ColumnSelector;
Expand Down
10 changes: 7 additions & 3 deletions velox/dwio/parquet/reader/ParquetReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@

#pragma once

#include "velox/dwio/common/BufferedInput.h"
#include "velox/dwio/common/Reader.h"
#include "velox/dwio/common/ReaderFactory.h"
#include "velox/dwio/common/SelectiveColumnReader.h"
#include "velox/dwio/parquet/reader/ParquetTypeWithId.h"
#include "velox/dwio/parquet/thrift/ParquetThriftTypes.h"

namespace facebook::velox::dwio::common {

class SelectiveColumnReader;
class BufferedInput;

} // namespace facebook::velox::dwio::common

namespace facebook::velox::parquet {

Expand Down
2 changes: 2 additions & 0 deletions velox/dwio/parquet/reader/RepeatedColumnReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

namespace facebook::velox::parquet {

class ParquetTypeWithId;

namespace {
PageReader* FOLLY_NULLABLE readLeafRepDefs(
dwio::common::SelectiveColumnReader* FOLLY_NONNULL reader,
Expand Down
2 changes: 1 addition & 1 deletion velox/dwio/parquet/reader/RleBpDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "velox/dwio/parquet/reader/RleBpDecoder.h"

#include "velox/dwio/common/BitPackDecoder.h"
#include <folly/Varint.h>

namespace facebook::velox::parquet {

Expand Down
4 changes: 0 additions & 4 deletions velox/dwio/parquet/reader/RleBpDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
#include "velox/common/base/BitUtil.h"
#include "velox/dwio/common/BitPackDecoder.h"
#include "velox/dwio/common/DecoderUtil.h"
#include "velox/type/Filter.h"
#include "velox/vector/LazyVector.h"

#include <folly/Varint.h>

namespace facebook::velox::parquet {

Expand Down
2 changes: 2 additions & 0 deletions velox/dwio/parquet/reader/Statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/

#include "velox/dwio/parquet/reader/Statistics.h"

#include "velox/dwio/common/Statistics.h"
#include "velox/type/Type.h"

namespace facebook::velox::parquet {
Expand Down
15 changes: 12 additions & 3 deletions velox/dwio/parquet/reader/Statistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,18 @@

#pragma once

#include "velox/dwio/common/Statistics.h"
#include "velox/dwio/parquet/thrift/ParquetThriftTypes.h"
#include "velox/type/Type.h"

#include <cstring>
#include <optional>

namespace facebook::velox {
class Type;
}

namespace facebook::velox::dwio::common {
class ColumnStatistics;
}

namespace facebook::velox::parquet {

Expand All @@ -27,7 +36,7 @@ namespace facebook::velox::parquet {
template <typename T>
inline const T load(const char* ptr) {
T ret;
memcpy(&ret, ptr, sizeof(ret));
std::memcpy(&ret, ptr, sizeof(ret));
return ret;
}

Expand Down
3 changes: 2 additions & 1 deletion velox/dwio/parquet/reader/StringColumnReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*/

#include "velox/dwio/parquet/reader/StringColumnReader.h"
#include "velox/dwio/common/BufferUtil.h"

#include "velox/dwio/common/SelectiveColumnReaderInternal.h"

namespace facebook::velox::parquet {

Expand Down
2 changes: 1 addition & 1 deletion velox/dwio/parquet/reader/StringColumnReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#pragma once

#include "velox/dwio/common/SelectiveColumnReaderInternal.h"
#include "velox/dwio/common/SelectiveColumnReader.h"
#include "velox/dwio/parquet/reader/ParquetData.h"

namespace facebook::velox::parquet {
Expand Down
6 changes: 0 additions & 6 deletions velox/dwio/parquet/reader/StringDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

#pragma once

#include "velox/common/base/GTestMacros.h"
#include "velox/common/base/Nulls.h"
#include "velox/dwio/common/DecoderUtil.h"
#include "velox/dwio/common/IntDecoder.h"
#include "velox/dwio/common/TypeUtil.h"

namespace facebook::velox::parquet {

class StringDecoder {
Expand Down
7 changes: 7 additions & 0 deletions velox/dwio/parquet/reader/StructColumnReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@
*/

#include "velox/dwio/parquet/reader/StructColumnReader.h"

#include "velox/dwio/common/BufferedInput.h"
#include "velox/dwio/parquet/reader/ParquetColumnReader.h"
#include "velox/dwio/parquet/reader/RepeatedColumnReader.h"

namespace facebook::velox::common {
class ScanSpec;
}

namespace facebook::velox::parquet {

StructColumnReader::StructColumnReader(
Expand Down
11 changes: 10 additions & 1 deletion velox/dwio/parquet/reader/StructColumnReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,19 @@
#pragma once

#include "velox/dwio/common/SelectiveStructColumnReader.h"
#include "velox/dwio/parquet/reader/ParquetColumnReader.h"

#include <parquet/level_conversion.h>

namespace facebook::velox::dwio::common {
class BufferedInput;
}

namespace facebook::velox::parquet {

enum class LevelMode;
class PageReader;
class ParquetParams;

class StructColumnReader : public dwio::common::SelectiveStructColumnReader {
public:
StructColumnReader(
Expand Down

0 comments on commit 33538dd

Please sign in to comment.