Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions cpp/src/arrow/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class ARROW_EXPORT Array {
int32_t length() const { return length_; }
int32_t null_count() const { return null_count_; }

const std::shared_ptr<DataType>& type() const { return type_; }
std::shared_ptr<DataType> type() const { return type_; }
Type::type type_enum() const { return type_->type; }

const std::shared_ptr<Buffer>& null_bitmap() const { return null_bitmap_; }
std::shared_ptr<Buffer> null_bitmap() const { return null_bitmap_; }

const uint8_t* null_bitmap_data() const { return null_bitmap_data_; }

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ class ARROW_EXPORT ArrayBuilder {
// this function responsibly.
Status Advance(int32_t elements);

const std::shared_ptr<PoolBuffer>& null_bitmap() const { return null_bitmap_; }
std::shared_ptr<PoolBuffer> null_bitmap() const { return null_bitmap_; }

// Creates new array object to hold the contents of the builder and transfers
// ownership of the data. This resets all variables on the builder.
virtual Status Finish(std::shared_ptr<Array>* out) = 0;

const std::shared_ptr<DataType>& type() const { return type_; }
std::shared_ptr<DataType> type() const { return type_; }

protected:
MemoryPool* pool_;
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/column.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Column::Column(

Status Column::ValidateData() {
for (int i = 0; i < data_->num_chunks(); ++i) {
const std::shared_ptr<DataType>& type = data_->chunk(i)->type();
std::shared_ptr<DataType> type = data_->chunk(i)->type();
if (!this->type()->Equals(type)) {
std::stringstream ss;
ss << "In chunk " << i << " expected type " << this->type()->ToString()
Expand Down
8 changes: 4 additions & 4 deletions cpp/src/arrow/column.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ARROW_EXPORT ChunkedArray {

int num_chunks() const { return chunks_.size(); }

const std::shared_ptr<Array>& chunk(int i) const { return chunks_[i]; }
std::shared_ptr<Array> chunk(int i) const { return chunks_[i]; }

protected:
ArrayVector chunks_;
Expand All @@ -68,16 +68,16 @@ class ARROW_EXPORT Column {

int64_t null_count() const { return data_->null_count(); }

const std::shared_ptr<Field>& field() const { return field_; }
std::shared_ptr<Field> field() const { return field_; }

// @returns: the column's name in the passed metadata
const std::string& name() const { return field_->name; }

// @returns: the column's type according to the metadata
const std::shared_ptr<DataType>& type() const { return field_->type; }
std::shared_ptr<DataType> type() const { return field_->type; }

// @returns: the column's data as a chunked logical array
const std::shared_ptr<ChunkedArray>& data() const { return data_; }
std::shared_ptr<ChunkedArray> data() const { return data_; }
// Verify that the column's array data is consistent with the passed field's
// metadata
Status ValidateData();
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/ipc/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Status FileReader::ReadFooter() {
return footer_->GetSchema(&schema_);
}

const std::shared_ptr<Schema>& FileReader::schema() const {
std::shared_ptr<Schema> FileReader::schema() const {
return schema_;
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/ipc/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class ARROW_EXPORT FileReader {
static Status Open(const std::shared_ptr<io::ReadableFileInterface>& file,
int64_t footer_offset, std::shared_ptr<FileReader>* reader);

const std::shared_ptr<Schema>& schema() const;
std::shared_ptr<Schema> schema() const;

// Shared dictionaries for dictionary-encoding cross record batches
// TODO(wesm): Implement dictionary reading when we also have dictionary
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/ipc/metadata-internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ Status SchemaToFlatbuffer(
FBB& fbb, const Schema* schema, flatbuffers::Offset<flatbuf::Schema>* out) {
std::vector<FieldOffset> field_offsets;
for (int i = 0; i < schema->num_fields(); ++i) {
const std::shared_ptr<Field>& field = schema->field(i);
std::shared_ptr<Field> field = schema->field(i);
FieldOffset offset;
RETURN_NOT_OK(FieldToFlatbuffer(fbb, field, &offset));
field_offsets.push_back(offset);
Expand Down
8 changes: 4 additions & 4 deletions cpp/src/arrow/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ class ARROW_EXPORT RecordBatch {
bool ApproxEquals(const RecordBatch& other) const;

// @returns: the table's schema
const std::shared_ptr<Schema>& schema() const { return schema_; }
std::shared_ptr<Schema> schema() const { return schema_; }

// @returns: the i-th column
// Note: Does not boundscheck
const std::shared_ptr<Array>& column(int i) const { return columns_[i]; }
std::shared_ptr<Array> column(int i) const { return columns_[i]; }

const std::vector<std::shared_ptr<Array>>& columns() const { return columns_; }

Expand Down Expand Up @@ -88,11 +88,11 @@ class ARROW_EXPORT Table {
const std::string& name() const { return name_; }

// @returns: the table's schema
const std::shared_ptr<Schema>& schema() const { return schema_; }
std::shared_ptr<Schema> schema() const { return schema_; }

// Note: Does not boundscheck
// @returns: the i-th column
const std::shared_ptr<Column>& column(int i) const { return columns_[i]; }
std::shared_ptr<Column> column(int i) const { return columns_[i]; }

// @returns: the number of columns in the table
int num_columns() const { return columns_.size(); }
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ std::string StructType::ToString() const {
s << "struct<";
for (int i = 0; i < this->num_children(); ++i) {
if (i > 0) { s << ", "; }
const std::shared_ptr<Field>& field = this->child(i);
std::shared_ptr<Field> field = this->child(i);
s << field->name << ": " << field->type->ToString();
}
s << ">";
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/arrow/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ struct ARROW_EXPORT DataType {
return Equals(other.get());
}

const std::shared_ptr<Field>& child(int i) const { return children_[i]; }
std::shared_ptr<Field> child(int i) const { return children_[i]; }

const std::vector<std::shared_ptr<Field>>& children() const { return children_; }

Expand Down Expand Up @@ -319,9 +319,9 @@ struct ARROW_EXPORT ListType : public DataType, public NoExtraMeta {
children_ = {value_field};
}

const std::shared_ptr<Field>& value_field() const { return children_[0]; }
std::shared_ptr<Field> value_field() const { return children_[0]; }

const std::shared_ptr<DataType>& value_type() const { return children_[0]->type; }
std::shared_ptr<DataType> value_type() const { return children_[0]->type; }

Status Accept(TypeVisitor* visitor) const override;
std::string ToString() const override;
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/types/construct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Status MakeBuilder(MemoryPool* pool, const std::shared_ptr<DataType>& type,

case Type::LIST: {
std::shared_ptr<ArrayBuilder> value_builder;
const std::shared_ptr<DataType>& value_type =
std::shared_ptr<DataType> value_type =
static_cast<ListType*>(type.get())->value_type();
RETURN_NOT_OK(MakeBuilder(pool, value_type, &value_builder));
out->reset(new ListBuilder(pool, value_builder));
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/arrow/types/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ class ARROW_EXPORT ListArray : public Array {

// Return a shared pointer in case the requestor desires to share ownership
// with this array.
const std::shared_ptr<Array>& values() const { return values_; }
std::shared_ptr<Array> values() const { return values_; }
std::shared_ptr<Buffer> offsets() const {
return std::static_pointer_cast<Buffer>(offset_buffer_);
}

const std::shared_ptr<DataType>& value_type() const { return values_->type(); }
std::shared_ptr<DataType> value_type() const { return values_->type(); }

const int32_t* raw_offsets() const { return offsets_; }

Expand Down Expand Up @@ -152,7 +152,7 @@ class ARROW_EXPORT ListBuilder : public ArrayBuilder {

Status AppendNull() { return Append(false); }

const std::shared_ptr<ArrayBuilder>& value_builder() const {
std::shared_ptr<ArrayBuilder> value_builder() const {
DCHECK(!values_) << "Using value builder is pointless when values_ is set";
return value_builder_;
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/types/primitive.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ARROW_EXPORT PrimitiveArray : public Array {
public:
virtual ~PrimitiveArray() {}

const std::shared_ptr<Buffer>& data() const { return data_; }
std::shared_ptr<Buffer> data() const { return data_; }

bool EqualsExact(const PrimitiveArray& other) const;
bool Equals(const std::shared_ptr<Array>& arr) const override;
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/types/struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ARROW_EXPORT StructArray : public Array {

// Return a shared pointer in case the requestor desires to share ownership
// with this array.
const std::shared_ptr<Array>& field(int32_t pos) const {
std::shared_ptr<Array> field(int32_t pos) const {
DCHECK_GT(field_arrays_.size(), 0);
return field_arrays_[pos];
}
Expand Down Expand Up @@ -99,7 +99,7 @@ class ARROW_EXPORT StructBuilder : public ArrayBuilder {

Status AppendNull() { return Append(false); }

const std::shared_ptr<ArrayBuilder> field_builder(int pos) const {
std::shared_ptr<ArrayBuilder> field_builder(int pos) const {
DCHECK_GT(field_builders_.size(), 0);
return field_builders_[pos];
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/util/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ARROW_EXPORT Buffer : public std::enable_shared_from_this<Buffer> {

int64_t size() const { return size_; }

const std::shared_ptr<Buffer> parent() const { return parent_; }
std::shared_ptr<Buffer> parent() const { return parent_; }

protected:
bool is_mutable_;
Expand Down
22 changes: 11 additions & 11 deletions python/pyarrow/includes/libarrow.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ cdef extern from "arrow/api.h" namespace "arrow" nogil:

c_bool Equals(const shared_ptr[CSchema]& other)

const shared_ptr[CField]& field(int i)
shared_ptr[CField] field(int i)
int num_fields()
c_string ToString()

cdef cppclass CArray" arrow::Array":
const shared_ptr[CDataType]& type()
shared_ptr[CDataType] type()

int32_t length()
int32_t null_count()
Expand Down Expand Up @@ -142,8 +142,8 @@ cdef extern from "arrow/api.h" namespace "arrow" nogil:
const int32_t* offsets()
int32_t offset(int i)
int32_t value_length(int i)
const shared_ptr[CArray]& values()
const shared_ptr[CDataType]& value_type()
shared_ptr[CArray] values()
shared_ptr[CDataType] value_type()

cdef cppclass CStringArray" arrow::StringArray"(CListArray):
c_string GetString(int i)
Expand All @@ -152,7 +152,7 @@ cdef extern from "arrow/api.h" namespace "arrow" nogil:
int64_t length()
int64_t null_count()
int num_chunks()
const shared_ptr[CArray]& chunk(int i)
shared_ptr[CArray] chunk(int i)

cdef cppclass CColumn" arrow::Column":
CColumn(const shared_ptr[CField]& field,
Expand All @@ -164,17 +164,17 @@ cdef extern from "arrow/api.h" namespace "arrow" nogil:
int64_t length()
int64_t null_count()
const c_string& name()
const shared_ptr[CDataType]& type()
const shared_ptr[CChunkedArray]& data()
shared_ptr[CDataType] type()
shared_ptr[CChunkedArray] data()

cdef cppclass CRecordBatch" arrow::RecordBatch":
CRecordBatch(const shared_ptr[CSchema]& schema, int32_t num_rows,
const vector[shared_ptr[CArray]]& columns)

c_bool Equals(const CRecordBatch& other)

const shared_ptr[CSchema]& schema()
const shared_ptr[CArray]& column(int i)
shared_ptr[CSchema] schema()
shared_ptr[CArray] column(int i)
const c_string& column_name(int i)

const vector[shared_ptr[CArray]]& columns()
Expand All @@ -191,8 +191,8 @@ cdef extern from "arrow/api.h" namespace "arrow" nogil:

const c_string& name()

const shared_ptr[CSchema]& schema()
const shared_ptr[CColumn]& column(int i)
shared_ptr[CSchema] schema()
shared_ptr[CColumn] column(int i)


cdef extern from "arrow/ipc/metadata.h" namespace "arrow::ipc" nogil:
Expand Down
2 changes: 1 addition & 1 deletion python/pyarrow/includes/libarrow_ipc.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ cdef extern from "arrow/ipc/file.h" namespace "arrow::ipc" nogil:
CStatus Open2" Open"(const shared_ptr[ReadableFileInterface]& file,
int64_t footer_offset, shared_ptr[CFileReader]* out)

const shared_ptr[CSchema]& schema()
shared_ptr[CSchema] schema()

int num_dictionaries()
int num_record_batches()
Expand Down