You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "ZhangHuiGui (via GitHub)" <gi...@apache.org> on 2024/03/07 06:01:17 UTC

[I] [C++] SimplifyWithGuarantee evaluate a wrong result for a function call which has no arguments [arrow]

ZhangHuiGui opened a new issue, #40395:
URL: https://github.com/apache/arrow/issues/40395

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   Code like below:
   ```c
     const int kCount = 10;
     auto random_options = RandomOptions::FromSeed(/*seed=*/0);
     ExecBatch input({}, kCount);
     ExecBatch input({}, kCount);
   
     Expression random_expr = call("random", {}, random_options);
     ASSERT_OK_AND_ASSIGN(random_expr, random_expr.Bind(float64()));
     ASSERT_OK_AND_ASSIGN(auto simplify_expr, SimplifyWithGuarantee(random_expr, input.guarantee));
   
     ASSERT_OK_AND_ASSIGN(Datum actual, ExecuteScalarExpression(simplify_expr, input)); // failed
   ```
   Failed with `Invalid: ExecuteScalarExpression cannot Execute non-scalar expression Array[int64]`.
   
   It's caused by below codes in `FoldConstans`:
   https://github.com/apache/arrow/blob/49cdb0fe4e98fda19031c864a18e6156c6edbf3c/cpp/src/arrow/compute/expression.cc#L848C1-L856C10
   
   We should not go into the all_of branch for the call has no arguments, but the `all_of` will return true for this situation.
   
   
   ### Component(s)
   
   C++


-- 
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: issues-unsubscribe@arrow.apache.org.apache.org

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


Re: [I] [C++] SimplifyWithGuarantee evaluate a wrong result for a function call which has no arguments [arrow]

Posted by "bkietz (via GitHub)" <gi...@apache.org>.
bkietz commented on issue #40395:
URL: https://github.com/apache/arrow/issues/40395#issuecomment-1994644475

   Issue resolved by pull request 40396
   https://github.com/apache/arrow/pull/40396


-- 
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-unsubscribe@arrow.apache.org

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


Re: [I] [C++] SimplifyWithGuarantee evaluate a wrong result for a function call which has no arguments [arrow]

Posted by "bkietz (via GitHub)" <gi...@apache.org>.
bkietz closed issue #40395: [C++] SimplifyWithGuarantee evaluate a wrong result for a function call which has no arguments
URL: https://github.com/apache/arrow/issues/40395


-- 
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: issues-unsubscribe@arrow.apache.org

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