lidavidm commented on code in PR #2081:
URL: https://github.com/apache/arrow-adbc/pull/2081#discussion_r1722519772


##########
c/driver/framework/base_driver.cc:
##########
@@ -66,7 +66,24 @@ Result<std::string_view> Option::AsString() const {
         if constexpr (std::is_same_v<T, std::string>) {
           return value;
         }
-        return status::InvalidArgument("Invalid string value {}", *this);
+        return status::InvalidArgument("Invalid string value {}", 
this->Format());
+      },
+      value_);
+}
+
+std::string Option::Format() const {
+  return std::visit(
+      [&](auto&& value) {
+        using T = std::decay_t<decltype(value)>;
+        if constexpr (std::is_same_v<T, adbc::driver::Option::Unset>) {
+          return std::string("(NULL)");
+        } else if constexpr (std::is_same_v<T, std::string>) {
+          return std::string("'") + value + "'";

Review Comment:
   I thought the general advice is that stringstream is really slow? (It's also 
another header...) I'd rather keep the concat



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