File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 3333#include " iceberg/avro/avro_schema_util_internal.h"
3434#include " iceberg/avro/avro_stream_internal.h"
3535#include " iceberg/schema.h"
36- #include " iceberg/schema_internal.h"
3736#include " iceberg/util/checked_cast.h"
3837#include " iceberg/util/macros.h"
3938
@@ -60,8 +59,7 @@ struct WriteContext {};
6059class AvroWriter ::Impl {
6160 public:
6261 Status Open (const WriterOptions& options) {
63- write_arrow_schema_ = options.schema ;
64- ICEBERG_ASSIGN_OR_RAISE (write_schema_, FromArrowSchema (options.schema , std::nullopt ));
62+ write_schema_ = options.schema ;
6563
6664 auto root = std::make_shared<::avro::NodeRecord>();
6765 ToAvroNodeVisitor visitor;
@@ -103,7 +101,6 @@ class AvroWriter::Impl {
103101 Status InitWriteContext () { return {}; }
104102
105103 private:
106- ArrowSchema write_arrow_schema_;
107104 // The schema to write.
108105 std::shared_ptr<::iceberg::Schema> write_schema_;
109106 // The avro schema to write.
Original file line number Diff line number Diff line change 2929#include " iceberg/arrow_c_data.h"
3030#include " iceberg/file_format.h"
3131#include " iceberg/result.h"
32+ #include " iceberg/schema.h"
3233#include " iceberg/type_fwd.h"
3334
3435namespace iceberg {
@@ -38,7 +39,7 @@ struct ICEBERG_EXPORT WriterOptions {
3839 // / \brief The path to the file to write.
3940 std::string path;
4041 // / \brief The schema of the data to write.
41- ArrowSchema schema;
42+ std::shared_ptr<Schema> schema;
4243 // / \brief FileIO instance to open the file. Writer implementations should down cast it
4344 // / to the specific FileIO implementation. By default, the `iceberg-bundle` library uses
4445 // / `ArrowFileSystemFileIO` as the default implementation.
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ Result<std::unique_ptr<ManifestWriter>> ManifestWriter::MakeWriter(
3737 ICEBERG_ASSIGN_OR_RAISE (
3838 auto writer, WriterFactoryRegistry::Open (FileFormatType::kAvro ,
3939 {.path = std::string (manifest_location),
40+ .schema = schema,
4041 .io = std::move (file_io)}));
4142 return std::make_unique<ManifestWriterImpl>(std::move (writer), std::move (schema));
4243}
@@ -49,6 +50,7 @@ Result<std::unique_ptr<ManifestListWriter>> ManifestListWriter::MakeWriter(
4950 ICEBERG_ASSIGN_OR_RAISE (auto writer, WriterFactoryRegistry::Open (
5051 FileFormatType::kAvro ,
5152 {.path = std::string (manifest_list_location),
53+ .schema = schema,
5254 .io = std::move (file_io)}));
5355 return std::make_unique<ManifestListWriterImpl>(std::move (writer), std::move (schema));
5456}
You can’t perform that action at this time.
0 commit comments