Skip to content

Commit 38a9259

Browse files
committed
let iceberg_arrow to call api from iceberg_core
1 parent cbd661d commit 38a9259

File tree

6 files changed

+11
-2
lines changed

6 files changed

+11
-2
lines changed

example/demo_example.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ int main() {
2727
std::cout << iceberg::Table::create()->print() << std::endl;
2828
std::cout << iceberg::Puffin::create()->print() << std::endl;
2929
std::cout << iceberg::arrow::DemoArrow().print() << std::endl;
30+
std::cout << iceberg::arrow::DemoArrow().name() << std::endl;
3031
return 0;
3132
}

src/arrow/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if(NOT ICEBERG_ARROW)
2020
endif()
2121

2222
set(ICEBERG_ARROW_SOURCES demo_arrow.cc)
23-
set(ICEBERG_ARROW_INCLUDES "${ICEBERG_API_DIR}")
23+
set(ICEBERG_ARROW_INCLUDES "${ICEBERG_API_DIR}" "${CMAKE_SOURCE_DIR}/src")
2424

2525
# Libraries to link with exported libiceberg_arrow.{so,a}.
2626
set(ICEBERG_ARROW_STATIC_BUILD_INTERFACE_LIBS)

src/arrow/demo_arrow.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@
2121

2222
#include <arrow/config.h>
2323

24+
#include "core/demo_table.h"
25+
2426
namespace iceberg::arrow {
2527

2628
std::string DemoArrow::print() const { return ::arrow::GetBuildInfo().version_string; }
2729

30+
std::string_view DemoArrow::name() const { return DemoTable().name(); }
31+
2832
} // namespace iceberg::arrow

src/arrow/demo_arrow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace iceberg::arrow {
2828
class ICEBERG_EXPORT DemoArrow {
2929
public:
3030
std::string print() const;
31+
std::string_view name() const;
3132
};
3233

3334
} // namespace iceberg::arrow

src/core/demo_table.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121

2222
namespace iceberg {
2323

24-
std::string_view DemoTable::print() const { return "DemoTable"; }
24+
std::string_view DemoTable::print() const { return name(); }
25+
26+
std::string_view DemoTable::name() const { return "DemoTable"; }
2527

2628
std::unique_ptr<Table> Table::create() { return std::make_unique<DemoTable>(); }
2729

src/core/demo_table.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class ICEBERG_EXPORT DemoTable : public Table {
2929
~DemoTable() override = default;
3030

3131
std::string_view print() const override;
32+
std::string_view name() const;
3233
};
3334

3435
} // namespace iceberg

0 commit comments

Comments
 (0)