Skip to content

Commit

Permalink
PARQUET-643: Add const modifier to schema pointer reference
Browse files Browse the repository at this point in the history
Author: Uwe L. Korn <uwelk@xhochy.com>

Closes apache#128 from xhochy/parquet-643 and squashes the following commits:

6f18fca [Uwe L. Korn] PARQUET-643: Add const modifier to schema pointer reference in ParquetFileWriter

Change-Id: I1e019444d6154785e062c195d9160e4dd8799a5a
  • Loading branch information
xhochy authored and wesm committed Jun 27, 2016
1 parent a8ad3a4 commit 8e98b5c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cpp/src/parquet/file/writer-internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void RowGroupSerializer::Close() {
// FileSerializer

std::unique_ptr<ParquetFileWriter::Contents> FileSerializer::Open(
std::shared_ptr<OutputStream> sink, std::shared_ptr<GroupNode>& schema,
std::shared_ptr<OutputStream> sink, const std::shared_ptr<GroupNode>& schema,
const std::shared_ptr<WriterProperties>& properties) {
std::unique_ptr<ParquetFileWriter::Contents> result(
new FileSerializer(sink, schema, properties));
Expand Down Expand Up @@ -249,7 +249,7 @@ void FileSerializer::WriteMetaData() {
}

FileSerializer::FileSerializer(std::shared_ptr<OutputStream> sink,
std::shared_ptr<GroupNode>& schema,
const std::shared_ptr<GroupNode>& schema,
const std::shared_ptr<WriterProperties>& properties)
: sink_(sink),
allocator_(properties->allocator()),
Expand Down
5 changes: 3 additions & 2 deletions cpp/src/parquet/file/writer-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ class RowGroupSerializer : public RowGroupWriter::Contents {
class FileSerializer : public ParquetFileWriter::Contents {
public:
static std::unique_ptr<ParquetFileWriter::Contents> Open(
std::shared_ptr<OutputStream> sink, std::shared_ptr<schema::GroupNode>& schema,
std::shared_ptr<OutputStream> sink,
const std::shared_ptr<schema::GroupNode>& schema,
const std::shared_ptr<WriterProperties>& properties = default_writer_properties());

void Close() override;
Expand All @@ -128,7 +129,7 @@ class FileSerializer : public ParquetFileWriter::Contents {

private:
explicit FileSerializer(std::shared_ptr<OutputStream> sink,
std::shared_ptr<schema::GroupNode>& schema,
const std::shared_ptr<schema::GroupNode>& schema,
const std::shared_ptr<WriterProperties>& properties);

std::shared_ptr<OutputStream> sink_;
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/parquet/file/writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ParquetFileWriter::~ParquetFileWriter() {
}

std::unique_ptr<ParquetFileWriter> ParquetFileWriter::Open(
std::shared_ptr<OutputStream> sink, std::shared_ptr<GroupNode>& schema,
std::shared_ptr<OutputStream> sink, const std::shared_ptr<GroupNode>& schema,
const std::shared_ptr<WriterProperties>& properties) {
auto contents = FileSerializer::Open(sink, schema, properties);

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/parquet/file/writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class ParquetFileWriter {
~ParquetFileWriter();

static std::unique_ptr<ParquetFileWriter> Open(std::shared_ptr<OutputStream> sink,
std::shared_ptr<schema::GroupNode>& schema,
const std::shared_ptr<schema::GroupNode>& schema,
const std::shared_ptr<WriterProperties>& properties = default_writer_properties());

void Open(std::unique_ptr<Contents> contents);
Expand Down

0 comments on commit 8e98b5c

Please sign in to comment.