Commit 37c40fb
authored
### Rationale for this change
Replaces `boost::algorithm::join` with Arrow's internal `arrow::internal::JoinStrings` to remove the boost dependency. Both functions have equivalent behavior: they join a vector of strings with a delimiter.
### What changes are included in this PR?
Replaced `boost::algorithm::join(*create_params, ",")` with `arrow::internal::JoinStrings(*create_params, ",")` (line 112) at `cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_statement_get_type_info.cc`.
From `boost/algorithm/string/join.hpp`:
```cpp
template< typename SequenceSequenceT, typename Range1T>
inline typename range_value<SequenceSequenceT>::type
join(const SequenceSequenceT& Input, const Range1T& Separator)
{
// Define working types
typedef typename range_value<SequenceSequenceT>::type ResultT;
typedef typename range_const_iterator<SequenceSequenceT>::type InputIteratorT;
// Parse input
InputIteratorT itBegin=::boost::begin(Input);
InputIteratorT itEnd=::boost::end(Input);
// Construct container to hold the result
ResultT Result;
// Append first element
if(itBegin!=itEnd)
{
detail::insert(Result, ::boost::end(Result), *itBegin);
++itBegin;
}
for(;itBegin!=itEnd; ++itBegin)
{
// Add separator
detail::insert(Result, ::boost::end(Result), ::boost::as_literal(Separator));
// Add element
detail::insert(Result, ::boost::end(Result), *itBegin);
}
return Result;
}
```
From `cpp/src/arrow/util/string.cc:126-148`:
```cpp
template <typename StringLike>
static std::string JoinStringLikes(const std::vector<StringLike>& strings,
std::string_view delimiter) {
if (strings.size() == 0) {
return "";
}
std::string out = std::string(strings.front());
for (size_t i = 1; i < strings.size(); ++i) {
out.append(delimiter.begin(), delimiter.end());
out.append(strings[i].begin(), strings[i].end());
}
return out;
}
std::string JoinStrings(const std::vector<std::string>& strings,
std::string_view delimiter) {
return JoinStringLikes(strings, delimiter);
}
```
### Are these changes tested?
Yes. Existing test cases should verify the change.
### Are there any user-facing changes?
No.
* GitHub Issue: #48093
Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: David Li <[email protected]>
1 parent 1b0a220 commit 37c40fb
File tree
1 file changed
+2
-3
lines changed- cpp/src/arrow/flight/sql/odbc/odbc_impl
1 file changed
+2
-3
lines changedLines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
| 112 | + | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
| |||
0 commit comments