Jedi18 commented on a change in pull request #11858:
URL: https://github.com/apache/arrow/pull/11858#discussion_r767822312



##########
File path: cpp/src/arrow/dataset/partition.cc
##########
@@ -580,19 +580,23 @@ Result<util::optional<KeyValuePartitioning::Key>> 
HivePartitioning::ParseKey(
   // Static method, so we have no better place for it
   util::InitializeUTF8();
 
-  auto name = segment.substr(0, name_end);
+  std::string name;
   std::string value;
   switch (options.segment_encoding) {
     case SegmentEncoding::None: {
+      name = segment.substr(0, name_end);
       value = segment.substr(name_end + 1);
-      if (ARROW_PREDICT_FALSE(!util::ValidateUTF8(value))) {
-        return Status::Invalid("Partition segment was not valid UTF-8: ", 
value);
+      if (ARROW_PREDICT_FALSE(!util::ValidateUTF8(value)) ||
+          ARROW_PREDICT_FALSE(!util::ValidateUTF8(name))) {
+        return Status::Invalid("Partition segment was not valid UTF-8: ", 
name, value);

Review comment:
       Ok done, thanks.




-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to