Skip to content

Commit

Permalink
GH-40154: [C++][Parquet] Separate encoders and decoder (#43972)
Browse files Browse the repository at this point in the history
### Rationale for this change

`encoding.cc` is quite large nowadays : around 4000 lines of code, which makes code navigation cumbersome. It combines the functionality of encoders and decoders, however, those use distinct infrastructures and do not share any code.

Other areas of Parquet tend to separate the reading and writing facilities: for example, `column_reader.cc` vs. `column_writer.cc`.

### What changes are included in this PR?

The main change is to move encoders to `encoder.cc`, decoders to `decoder.cc`, and remove `encoding.cc`.

A small improvement is also to remove the inclusion of `arrow/util/spaced.h` in `encoding.h` by moving the `TypedDecoder<T>::DecodeSpaced` implementation into `decoder.cc`.

Note the massive code shuffle may obscure the git history quite a bit. `git log -C` doesn't seem able to track earlier versions of the encoder and decoder code, but `git blame -C` is.

### Are these changes tested?

By existing tests.

### Are there any user-facing changes?

No.

* GitHub Issue: #40154

Authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
  • Loading branch information
pitrou authored Sep 5, 2024
1 parent 7a24729 commit c2123b8
Show file tree
Hide file tree
Showing 4 changed files with 1,866 additions and 1,810 deletions.
3 changes: 2 additions & 1 deletion cpp/src/parquet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ set(PARQUET_SRCS
column_reader.cc
column_scanner.cc
column_writer.cc
encoding.cc
decoder.cc
encoder.cc
encryption/encryption.cc
encryption/internal_file_decryptor.cc
encryption/internal_file_encryptor.cc
Expand Down
Loading

0 comments on commit c2123b8

Please sign in to comment.