Skip to content

Commit 6cf6d58

Browse files
pedroerpmeta-codesync[bot]
authored andcommitted
refactor: Remove usage of folly::StringPiece in dwio (facebookincubator#287)
Summary: X-link: facebookincubator/axiom#532 X-link: facebookincubator/velox#15225 Pull Request resolved: facebookincubator#287 Intermediate step while migrating legacy folly::StringPiece usages to std::string_view. Part of facebookincubator/velox#14456 Reviewed By: pansatadru, xiaoxmeng, Yuhta Differential Revision: D85061784 fbshipit-source-id: e2bdb2a112d6a31637fdd4f326b68663508ca4e3
1 parent 6bf1376 commit 6cf6d58

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

dwio/nimble/encodings/Encoding.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,13 +525,13 @@ void readWithVisitorFast(
525525
// ValueType is the type we store in values buffer of selective column reader.
526526
template <typename DataType>
527527
using ValueType = std::conditional_t<
528-
std::is_same_v<DataType, folly::StringPiece>,
528+
std::is_same_v<DataType, std::string_view>,
529529
velox::StringView,
530530
DataType>;
531531

532532
template <typename V, typename DataType>
533533
ValueType<DataType> dataToValue(const V& visitor, DataType data) {
534-
if constexpr (std::is_same_v<DataType, folly::StringPiece>) {
534+
if constexpr (std::is_same_v<DataType, std::string_view>) {
535535
return visitor.reader().copyStringValueIfNeed(data);
536536
} else {
537537
return data;

dwio/nimble/encodings/EncodingUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void callReadWithVisitor(
132132
V& visitor,
133133
ReadWithVisitorParams& params) {
134134
using T = typename V::DataType;
135-
if constexpr (std::is_same_v<T, folly::StringPiece>) {
135+
if constexpr (std::is_same_v<T, std::string_view>) {
136136
detail::encodingTypeDispatchString(encoding, [&](auto& typedEncoding) {
137137
typedEncoding.readWithVisitor(visitor, params);
138138
});

dwio/nimble/encodings/TrivialEncoding.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ void TrivialEncoding<std::string_view>::readWithVisitor(
332332
},
333333
[&] {
334334
auto len = *lengths++;
335-
folly::StringPiece value(pos_, len);
335+
std::string_view value(pos_, len);
336336
++row_;
337337
pos_ += len;
338338
return value;

dwio/nimble/velox/selective/StringColumnReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void StringColumnReader::read(
3232
int64_t offset,
3333
const RowSet& rows,
3434
const uint64_t* incomingNulls) {
35-
prepareRead<folly::StringPiece>(offset, rows, incomingNulls);
35+
prepareRead<std::string_view>(offset, rows, incomingNulls);
3636
dwio::common::StringColumnReadWithVisitorHelper<false, false>(
3737
*this, rows)([&](auto visitor) { decoder_.readWithVisitor(visitor); });
3838
readOffset_ += rows.back() + 1;

0 commit comments

Comments
 (0)