Skip to content

Commit

Permalink
Merge pull request #10964 from ObjatieGroba/bugfix_raw_column_size
Browse files Browse the repository at this point in the history
Fix incorrect Column byte size
  • Loading branch information
alexey-milovidov committed May 17, 2020
2 parents caab379 + ce451bf commit b6b1947
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Columns/ColumnDecimal.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class ColumnDecimal final : public COWHelper<ColumnVectorHelper, ColumnDecimal<T

Field operator[](size_t n) const override { return DecimalField(data[n], scale); }

StringRef getRawData() const override { return StringRef(reinterpret_cast<const char*>(data.data()), data.size()); }
StringRef getRawData() const override { return StringRef(reinterpret_cast<const char*>(data.data()), byteSize()); }
StringRef getDataAt(size_t n) const override { return StringRef(reinterpret_cast<const char *>(&data[n]), sizeof(data[n])); }
void get(size_t n, Field & res) const override { res = (*this)[n]; }
bool getBool(size_t n) const override { return bool(data[n]); }
Expand Down
2 changes: 1 addition & 1 deletion src/Columns/ColumnVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class ColumnVector final : public COWHelper<ColumnVectorHelper, ColumnVector<T>>

bool isFixedAndContiguous() const override { return true; }
size_t sizeOfValueIfFixed() const override { return sizeof(T); }
StringRef getRawData() const override { return StringRef(reinterpret_cast<const char*>(data.data()), data.size()); }
StringRef getRawData() const override { return StringRef(reinterpret_cast<const char*>(data.data()), byteSize()); }


bool structureEquals(const IColumn & rhs) const override
Expand Down

0 comments on commit b6b1947

Please sign in to comment.