Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit a19ba01

Browse files
committed
Simple function to convert tuple to string CSV
1 parent 6c791c7 commit a19ba01

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/codegen/buffering_consumer.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ WrappedTuple &WrappedTuple::operator=(const WrappedTuple &o) {
4040
return *this;
4141
}
4242

43+
std::string WrappedTuple::ToCSV() const {
44+
std::string ret;
45+
for (uint32_t i = 0; i < tuple_.size(); i++) {
46+
if (i != 0) ret.append(",");
47+
ret.append(tuple_[i].ToString());
48+
}
49+
return ret;
50+
}
51+
4352
//===----------------------------------------------------------------------===//
4453
// BufferTuple() Proxy
4554
//===----------------------------------------------------------------------===//

src/include/codegen/buffering_consumer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ class WrappedTuple : public ContainerTuple<std::vector<peloton::type::Value>> {
4242
// Assignment
4343
WrappedTuple &operator=(const WrappedTuple &o);
4444

45+
std::string ToCSV() const;
46+
4547
// The tuple
4648
std::vector<peloton::type::Value> tuple_;
4749
};

0 commit comments

Comments
 (0)