You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/07/07 05:09:03 UTC

[GitHub] [arrow] projjal opened a new pull request #7653: ARROW-9343: [C++][Gandiva] CastInt/Float from string functions should handle leading/trailing white spaces

projjal opened a new pull request #7653:
URL: https://github.com/apache/arrow/pull/7653


   Also refactored the code to remove the parse_float helper function from context. This was done earlier to save the constructor cost when the stringconverter object from arrow/util/parsing was needed to be constructed first. Now that it has changed to parametric functions, its not needed to keep them in the executioncontext.


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

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



[GitHub] [arrow] github-actions[bot] commented on pull request #7653: ARROW-9343: [C++][Gandiva] CastInt/Float from string functions should handle leading/trailing white spaces

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #7653:
URL: https://github.com/apache/arrow/pull/7653#issuecomment-654606536


   https://issues.apache.org/jira/browse/ARROW-9343


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

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



[GitHub] [arrow] praveenbingo closed pull request #7653: ARROW-9343: [C++][Gandiva] CastInt/Float from string functions should handle leading/trailing white spaces

Posted by GitBox <gi...@apache.org>.
praveenbingo closed pull request #7653:
URL: https://github.com/apache/arrow/pull/7653


   


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

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



[GitHub] [arrow] praveenbingo commented on a change in pull request #7653: ARROW-9343: [C++][Gandiva] CastInt/Float from string functions should handle leading/trailing white spaces

Posted by GitBox <gi...@apache.org>.
praveenbingo commented on a change in pull request #7653:
URL: https://github.com/apache/arrow/pull/7653#discussion_r450928004



##########
File path: cpp/src/gandiva/precompiled/string_ops.cc
##########
@@ -672,4 +674,27 @@ const char* replace_utf8_utf8_utf8(gdv_int64 context, const char* text,
                                              out_len);
 }
 
+#define CAST_NUMERIC_FROM_STRING(OUT_TYPE, ARROW_TYPE, TYPE_NAME)                   \
+  FORCE_INLINE                                                                      \
+  gdv_##OUT_TYPE cast##TYPE_NAME##_utf8(int64_t context, const char* data,          \
+                                        int32_t len) {                              \
+    gdv_##OUT_TYPE val = 0;                                                         \
+    int32_t trimmed_len;                                                            \
+    data = trim_utf8(context, data, len, &trimmed_len);                             \
+    if (!arrow::internal::StringConverter<ARROW_TYPE>::Convert(data, trimmed_len,   \
+                                                               &val)) {             \
+      gdv_fn_context_set_error_msg(context,                                         \
+                                   "Failed parsing the string to required format"); \

Review comment:
       would help to add the string to the error message..




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

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