lidavidm commented on code in PR #13390:
URL: https://github.com/apache/arrow/pull/13390#discussion_r909527428


##########
cpp/src/arrow/util/uri.cc:
##########
@@ -208,6 +208,12 @@ std::string Uri::path() const {
   return std::move(ss).str();
 }
 
+std::string Uri::extension() const { 
+  std::string filename = impl_->path_segments_.back().to_string();

Review Comment:
   again, isn't it possible for path_segments_ to be empty?



##########
cpp/src/arrow/util/uri.cc:
##########
@@ -208,6 +208,12 @@ std::string Uri::path() const {
   return std::move(ss).str();
 }
 
+std::string Uri::extension() const { 
+  std::string filename = impl_->path_segments_.back().to_string();
+  size_t extension_index = filename.find(".");

Review Comment:
   Should we use this instead? Though, I suppose that requires 
ARROW_FILESYSTEM=ON: 
https://github.com/apache/arrow/blob/4b74c72d1f97f35746a6aee8515639b37579f332/cpp/src/arrow/filesystem/path_util.h#L41-L43
   
   At the very least, use `find_last_of`? 
https://github.com/apache/arrow/blob/4b74c72d1f97f35746a6aee8515639b37579f332/cpp/src/arrow/filesystem/path_util.cc#L82-L87



-- 
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]

Reply via email to