westonpace commented on a change in pull request #11892:
URL: https://github.com/apache/arrow/pull/11892#discussion_r764437960
##########
File path: cpp/src/arrow/dataset/file_csv.cc
##########
@@ -85,7 +86,13 @@ Result<std::unordered_set<std::string>> GetColumnNames(
RETURN_NOT_OK(
parser.VisitLastRow([&](const uint8_t* data, uint32_t size, bool quoted)
-> Status {
- util::string_view view{reinterpret_cast<const char*>(data), size};
+ // Skip BOM when reading column names (ARROW-14644)
+ ARROW_ASSIGN_OR_RAISE(auto data_no_bom, util::SkipUTF8BOM(data, size));
+ int32_t offset = data_no_bom - data;
+ DCHECK_GE(offset, 0);
+ size = size - offset;
Review comment:
```suggestion
ptrdiff_t offset = data_no_bom - data;
DCHECK_GE(offset, 0);
size = size - static_cast<uint32_t>(offset);
```
The Windows CI job is failing.
I think this will make windows happy but I never know and I don't have this
in my IDE at the moment so I may be way off base here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]