File tree Expand file tree Collapse file tree 13 files changed +37
-270
lines changed Expand file tree Collapse file tree 13 files changed +37
-270
lines changed Original file line number Diff line number Diff line change @@ -299,11 +299,26 @@ function(resolve_zlib_dependency)
299299
300300endfunction ()
301301
302+ # ----------------------------------------------------------------------
303+ # Zstd
304+
305+ function (resolve_zstd_dependency)
306+ find_package (zstd CONFIG)
307+ if (zstd_FOUND)
308+ list (APPEND ICEBERG_SYSTEM_DEPENDENCIES zstd)
309+ message (STATUS "Found zstd, version: ${zstd_VERSION} " )
310+ set (ICEBERG_SYSTEM_DEPENDENCIES
311+ ${ICEBERG_SYSTEM_DEPENDENCIES}
312+ PARENT_SCOPE)
313+ endif ()
314+ endfunction ()
315+
302316resolve_zlib_dependency()
303317resolve_nanoarrow_dependency()
304318resolve_nlohmann_json_dependency()
305319
306320if (ICEBERG_BUILD_BUNDLE)
307321 resolve_arrow_dependency()
308322 resolve_avro_dependency()
323+ resolve_zstd_dependency()
309324endif ()
Original file line number Diff line number Diff line change 1919
2020#include < iostream>
2121
22- #include " iceberg/arrow/demo_arrow.h"
23- #include " iceberg/avro/demo_avro.h"
24- #include " iceberg/demo.h"
22+ #include " iceberg/avro/avro_reader.h"
23+ #include " iceberg/file_reader.h"
2524
2625int main () {
27- std::cout << iceberg::Demo ().print () << std::endl;
28- std::cout << iceberg::arrow::DemoArrow ().print () << std::endl;
29- std::cout << iceberg::avro::DemoAvro ().print () << std::endl;
26+ iceberg::avro::AvroReader::Register ();
27+ auto open_result = iceberg::ReaderFactoryRegistry::Open (
28+ iceberg::FileFormatType::kAvro , {.path = " non-existing-file.avro" });
29+ if (!open_result.has_value ()) {
30+ std::cerr << " Failed to open avro file" << std::endl;
31+ return 1 ;
32+ }
3033 return 0 ;
3134}
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ set(ICEBERG_INCLUDES "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/src>"
2020set (ICEBERG_SOURCES
2121 arrow_c_data_internal.cc
2222 catalog/in_memory_catalog.cc
23- demo.cc
2423 expression/expression.cc
2524 expression/literal.cc
2625 file_reader.cc
@@ -94,9 +93,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iceberg_export.h
9493
9594if (ICEBERG_BUILD_BUNDLE)
9695 set (ICEBERG_BUNDLE_SOURCES
97- arrow/demo_arrow.cc
9896 arrow/arrow_fs_file_io.cc
99- avro/demo_avro.cc
10097 avro/avro_data_util.cc
10198 avro/avro_reader.cc
10299 avro/avro_schema_util.cc
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ class AvroReader::Impl {
123123 return {};
124124 }
125125
126- Result<Data > Next () {
126+ Result<std::optional<ArrowArray> > Next () {
127127 if (!context_) {
128128 ICEBERG_RETURN_UNEXPECTED (InitReadContext ());
129129 }
@@ -191,9 +191,9 @@ class AvroReader::Impl {
191191 return {};
192192 }
193193
194- Result<Data > ConvertBuilderToArrowArray () {
194+ Result<std::optional<ArrowArray> > ConvertBuilderToArrowArray () {
195195 if (context_->builder_ ->length () == 0 ) {
196- return {} ;
196+ return std:: nullopt ;
197197 }
198198
199199 auto builder_result = context_->builder_ ->Finish ();
@@ -227,7 +227,7 @@ class AvroReader::Impl {
227227 std::unique_ptr<ReadContext> context_;
228228};
229229
230- Result<Reader::Data > AvroReader::Next () { return impl_->Next (); }
230+ Result<std::optional<ArrowArray> > AvroReader::Next () { return impl_->Next (); }
231231
232232Result<ArrowSchema> AvroReader::Schema () { return impl_->Schema (); }
233233
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class ICEBERG_BUNDLE_EXPORT AvroReader : public Reader {
3535
3636 Status Close () final ;
3737
38- Result<Data > Next () final ;
38+ Result<std::optional<ArrowArray> > Next () final ;
3939
4040 Result<ArrowSchema> Schema () final ;
4141
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments