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/09/22 12:09:52 UTC

[GitHub] [arrow] praveenbingo commented on a change in pull request #8095: ARROW-9897: [C++][Gandiva] Added to_date function

praveenbingo commented on a change in pull request #8095:
URL: https://github.com/apache/arrow/pull/8095#discussion_r492681566



##########
File path: cpp/src/gandiva/to_date_holder.cc
##########
@@ -47,18 +47,23 @@ Status ToDateHolder::Make(const FunctionNode& node,
   }
   auto pattern = arrow::util::get<std::string>(literal_pattern->holder());
 
-  auto literal_suppress_errors = dynamic_cast<LiteralNode*>(node.children().at(2).get());
-  if (literal_pattern == nullptr) {
-    return Status::Invalid(
-        "'to_date' function requires a int literal as the third parameter");
+  int suppress_errors = 0;
+  if (node.children().size() == 3) {
+    auto literal_suppress_errors =
+        dynamic_cast<LiteralNode*>(node.children().at(2).get());
+    if (literal_pattern == nullptr) {
+      return Status::Invalid(

Review comment:
       i think the error message can be improved a bit..something along lines of if third parameter is provided it needs to be an integer (to suppress errors (or) provide only two)




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