Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8269712
Include arrow as a dependency
liuzicheng1987 Apr 18, 2025
e83e889
Began writing the parquet interface
liuzicheng1987 Apr 18, 2025
0709376
Merge
liuzicheng1987 Aug 13, 2025
919af4b
Merge branch 'main' into f/parquet
liuzicheng1987 Aug 13, 2025
617ec90
Used more idiomatic solutions for has_reflection_method_v and has_ref…
liuzicheng1987 Aug 16, 2025
9e83f61
Basic parquet write appears to work
liuzicheng1987 Aug 17, 2025
d4a09d9
Made sure we can save files
liuzicheng1987 Aug 17, 2025
5a9c4d1
Started writing the ArrowReader and ChunkedArrayIterator
liuzicheng1987 Aug 20, 2025
9200247
Continued developing the arrow reader
liuzicheng1987 Aug 22, 2025
69db63d
Added support for reading parquet files
liuzicheng1987 Aug 24, 2025
ffd4ed5
Improved the ArrowReader
liuzicheng1987 Aug 24, 2025
bedac40
Added the load function
liuzicheng1987 Aug 24, 2025
255d421
Added support for timestamps
liuzicheng1987 Aug 25, 2025
f3928a1
Added support for processors
liuzicheng1987 Aug 26, 2025
d499331
Added support for optionals
liuzicheng1987 Aug 26, 2025
2b832c0
Added a test for deques
liuzicheng1987 Aug 26, 2025
c040b3a
Made sure that the processors actually do what they are supposed to
liuzicheng1987 Aug 26, 2025
234084d
Add static_asserts for the processors that make no sense in a tabular…
liuzicheng1987 Aug 26, 2025
02715ad
Added support for bytestrings
liuzicheng1987 Aug 26, 2025
71bbd9b
Added support for boolean columns
liuzicheng1987 Aug 30, 2025
5d43c55
Added support for enums
liuzicheng1987 Aug 30, 2025
c351b28
Added settings
liuzicheng1987 Aug 31, 2025
46a05be
Moved compression into settings
liuzicheng1987 Aug 31, 2025
0441ea5
Pass by reference, where appropriate
liuzicheng1987 Aug 31, 2025
50b6c25
Added more tests
liuzicheng1987 Aug 31, 2025
d74df01
Added documentation for the parquet foramt
liuzicheng1987 Aug 31, 2025
87f9d1f
Fixed typo
liuzicheng1987 Aug 31, 2025
854dab7
Added test for rfl::Flatten
liuzicheng1987 Aug 31, 2025
b875ccc
Document all of the compression formats
liuzicheng1987 Aug 31, 2025
a075407
Merge branch 'main' into f/parquet
liuzicheng1987 Aug 31, 2025
c4c216c
Updated parquet to 21.0.0
liuzicheng1987 Aug 31, 2025
ae5e60f
Updated the README
liuzicheng1987 Aug 31, 2025
6f73ac5
Use timegm for the Timestamp
liuzicheng1987 Sep 1, 2025
e082549
Run the parquet tests && install bison
liuzicheng1987 Sep 1, 2025
ff53c75
Install bison on all macOS version
liuzicheng1987 Sep 1, 2025
de4e63c
Use _mkgmtime on Windows
liuzicheng1987 Sep 1, 2025
488ed78
Removed unneeded source files
liuzicheng1987 Sep 2, 2025
5c0068a
Use thread-safe versions
liuzicheng1987 Sep 2, 2025
44b1cb4
Fixed typo
liuzicheng1987 Sep 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
format: ["JSON", "AVRO", "CAPNPROTO", "CBOR", "FLEXBUFFERS", "MSGPACK", "XML", "TOML", "UBJSON", "YAML", "benchmarks"]
format: ["JSON", "AVRO", "CAPNPROTO", "CBOR", "FLEXBUFFERS", "MSGPACK", "PARQUET", "TOML", "UBJSON", "XML", "YAML", "benchmarks"]
compiler: [llvm, gcc]
compiler-version: [11, 12, 13, 14, 16, 17, 18]
cxx: [20, 23]
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
os: ["macos-latest", "macos-13"]
format: ["JSON", "AVRO", "CAPNPROTO", "CBOR", "FLEXBUFFERS", "MSGPACK", "XML", "TOML", "UBJSON", "YAML", "benchmarks"]
format: ["JSON", "AVRO", "CAPNPROTO", "CBOR", "FLEXBUFFERS", "MSGPACK", "PARQUET", "TOML", "UBJSON", "XML", "YAML", "benchmarks"]
name: "${{ matrix.os }} (${{ matrix.format }})"
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -28,6 +28,8 @@ jobs:
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Run vcpkg
uses: lukka/run-vcpkg@v11
- name: Install bison
run: brew install bison
- name: Install ninja
run: brew install ninja
if: matrix.os == 'macos-latest'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
format: ["JSON", "CAPNPROTO", "CBOR", "FLEXBUFFERS", "MSGPACK", "XML", "TOML", "UBJSON", "YAML", "benchmarks"]
format: ["JSON", "AVRO", "CAPNPROTO", "CBOR", "FLEXBUFFERS", "MSGPACK", "PARQUET", "TOML", "UBJSON", "XML", "YAML", "benchmarks"]
name: "windows-msvc (${{ matrix.format }})"
runs-on: windows-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
*.fb
*.flexbuf
*.msgpack
*.parquet
*.toml
*.ubjson
*.xml
Expand Down
19 changes: 18 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ option(REFLECTCPP_CAPNPROTO "Enable Cap’n Proto support" ${REFLECTCPP_ALL_FORM
option(REFLECTCPP_CBOR "Enable CBOR support" ${REFLECTCPP_ALL_FORMATS})
option(REFLECTCPP_FLEXBUFFERS "Enable flexbuffers support" ${REFLECTCPP_ALL_FORMATS})
option(REFLECTCPP_MSGPACK "Enable msgpack support" ${REFLECTCPP_ALL_FORMATS})
option(REFLECTCPP_PARQUET "Enable parquet support" ${REFLECTCPP_ALL_FORMATS})
option(REFLECTCPP_XML "Enable XML support" ${REFLECTCPP_ALL_FORMATS})
option(REFLECTCPP_TOML "Enable TOML support" ${REFLECTCPP_ALL_FORMATS})
option(REFLECTCPP_UBJSON "Enable UBJSON support" ${REFLECTCPP_ALL_FORMATS})
Expand Down Expand Up @@ -55,7 +56,8 @@ endif()
if (REFLECTCPP_BUILD_TESTS OR REFLECTCPP_BUILD_BENCHMARKS OR
(REFLECTCPP_JSON AND NOT REFLECTCPP_USE_BUNDLED_DEPENDENCIES) OR REFLECTCPP_AVRO OR
REFLECTCPP_BSON OR REFLECTCPP_CAPNPROTO OR REFLECTCPP_CBOR OR REFLECTCPP_FLEXBUFFERS OR
REFLECTCPP_MSGPACK OR REFLECTCPP_XML OR REFLECTCPP_TOML OR REFLECTCPP_UBJSON OR REFLECTCPP_YAML)
REFLECTCPP_MSGPACK OR REFLECTCPP_PARQUET OR REFLECTCPP_XML OR
REFLECTCPP_TOML OR REFLECTCPP_UBJSON OR REFLECTCPP_YAML)
# enable vcpkg per default if features other than JSON are required
set(REFLECTCPP_USE_VCPKG_DEFAULT ON)
endif()
Expand Down Expand Up @@ -109,6 +111,10 @@ if (REFLECTCPP_USE_VCPKG)
list(APPEND VCPKG_MANIFEST_FEATURES "msgpack")
endif()

if (REFLECTCPP_PARQUET)
list(APPEND VCPKG_MANIFEST_FEATURES "parquet")
endif()

if (REFLECTCPP_TOML)
list(APPEND VCPKG_MANIFEST_FEATURES "toml")
endif()
Expand Down Expand Up @@ -260,6 +266,17 @@ if (REFLECTCPP_MSGPACK)
target_link_libraries(reflectcpp PUBLIC msgpack-c)
endif ()

if (REFLECTCPP_PARQUET)
if (NOT TARGET Arrow)
find_package(Arrow CONFIG REQUIRED)
endif()
if (NOT TARGET Parquet)
find_package(Parquet CONFIG REQUIRED)
endif()
target_link_libraries(reflectcpp PUBLIC "$<IF:$<BOOL:${ARROW_BUILD_STATIC}>,Arrow::arrow_static,Arrow::arrow_shared>")
target_link_libraries(reflectcpp PUBLIC "$<IF:$<BOOL:${ARROW_BUILD_STATIC}>,Parquet::parquet_static,Parquet::parquet_shared>")
endif ()

if (REFLECTCPP_TOML)
list(APPEND REFLECT_CPP_SOURCES
src/reflectcpp_toml.cpp
Expand Down
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ reflect-cpp and sqlgen fill important gaps in C++ development. They reduce boile

<br>


## Table of Contents

### On this page
- [Serialization formats](#serialization-formats)
- [Feature Overview](#feature-overview)
- [Simple Example](#simple-example)
- [More Comprehensive Example](#more-comprehensive-example)
- [Tabular data](#tabular-data)
- [Error messages](#error-messages)
- [JSON schema](#json-schema)
- [Enums](#enums)
Expand Down Expand Up @@ -70,6 +70,7 @@ The following table lists the serialization formats currently supported by refle
| CBOR | [jsoncons](https://github.com/danielaparker/jsoncons)| >= 0.176.0 | BSL 1.0 | JSON-like binary format |
| flexbuffers | [flatbuffers](https://github.com/google/flatbuffers) | >= 23.5.26 | Apache 2.0 | Schema-less version of flatbuffers, binary format |
| msgpack | [msgpack-c](https://github.com/msgpack/msgpack-c) | >= 6.0.0 | BSL 1.0 | JSON-like binary format |
| parquet | [Apache Arrow](https://arrow.apache.org/) | >= 21.0.0 | Apache 2.0 | Tabular binary format |
| TOML | [toml++](https://github.com/marzer/tomlplusplus) | >= 3.4.0 | MIT | Textual format with an emphasis on readability |
| UBJSON | [jsoncons](https://github.com/danielaparker/jsoncons)| >= 0.176.0 | BSL 1.0 | JSON-like binary format |
| XML | [pugixml](https://github.com/zeux/pugixml) | >= 1.14 | MIT | Textual format used in many legacy projects |
Expand Down Expand Up @@ -145,7 +146,7 @@ age: 45
```

This will work for just about any example in the entire documentation
and any supported format, except where explicitly noted otherwise:
and any of the following formats, except where explicitly noted otherwise:

```cpp
rfl::avro::write(homer);
Expand Down Expand Up @@ -242,6 +243,34 @@ std::cout << "Hello, my name is " << homer2.first_name() << " "
<< homer2.last_name() << "." << std::endl;
```

### Tabular data

reflect-cpp also supports tabular data formats, like Parquet:

```cpp
#include <rfl/parquet.hpp>

const auto people =
std::vector<Person>({Person{.first_name = "Bart",
.birthday = "1987-04-19",
.age = 10,
.email = "bart@simpson.com"},
Person{.first_name = "Lisa",
.birthday = "1987-04-19",
.age = 8,
.email = "lisa@simpson.com"},
Person{.first_name = "Maggie",
.birthday = "1987-04-19",
.age = 0,
.email = "maggie@simpson.com"},
Person{.first_name = "Homer",
.birthday = "1987-04-19",
.age = 45,
.email = "homer@simpson.com"}});

const auto bytestring = rfl::parquet::write(people);
```

### Error messages

reflect-cpp returns clear and comprehensive error messages:
Expand Down
Loading
Loading