Skip to content

GH-39860: [C++] Expression ExecuteScalarExpression execute empty args function with a wrong result - #39908

Merged
bkietz merged 3 commits into
apache:mainfrom
ZhangHuiGui:fix-GH-39860
Feb 5, 2024
Merged

bkietz merged 3 commits into
apache:mainfrom
ZhangHuiGui:fix-GH-39860

Conversation

@ZhangHuiGui

@ZhangHuiGui ZhangHuiGui commented Feb 2, 2024 •

Copy link
Copy Markdown
Contributor

Rationale for this change

Try to fix #39860.

What changes are included in this PR?

Deal with the call->arguments.size() == 0's condition in ExecuteScalarExpression when we call some functions
has no arguments, like (random, hash_count ...).

Are these changes tested?

Yes

Are there any user-facing changes?

No.

@github-actions

github-actions Bot commented Feb 2, 2024

Copy link
Copy Markdown

Thanks for opening a pull request!

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

In the case of PARQUET issues on JIRA the title also supports:

PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

See also:

@ZhangHuiGui ZhangHuiGui changed the title close GH-39860 GH-39860: [C++] Expression ExecuteScalarExpression execute empty args function with a wrong result Feb 2, 2024
@github-actions

github-actions Bot commented Feb 2, 2024

Copy link
Copy Markdown

⚠️ GitHub issue #39860 has been automatically assigned in GitHub to PR creator.

@mapleFU
mapleFU requested a review from bkietz February 2, 2024 09:36
Comment thread cpp/src/arrow/compute/expression.cc Resolved
exec_context->func_registry()->GetFunction("random"));
ASSERT_OK_AND_ASSIGN(Datum expected,
function->Execute(input, &random_options, exec_context));
AssertDatumsEqual(actual, expected, /*verbose=*/true);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check the output length == 10 explicit?

@bkietz bkietz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit fd69d30.

There were 2 benchmark results with an error:

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…y args function with a wrong result (apache#39908)

### Rationale for this change

Try to fix apache#39860.

### What changes are included in this PR?

Deal with the call->arguments.size() == 0's condition in ExecuteScalarExpression when we call some functions
has no arguments, like (random, hash_count ...).

### Are these changes tested?

Yes

### Are there any user-facing changes?

No.
* Closes: apache#39860

Lead-authored-by: hugo.zhang <hugo.zhang@openpie.com>
Co-authored-by: 张回归 <zhanghuigui@zhanghuiguideMacBook-Pro-1681.local>
Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
raulcd pushed a commit that referenced this pull request Feb 20, 2024
… function with a wrong result (#39908)

### Rationale for this change

Try to fix #39860.

### What changes are included in this PR?

Deal with the call->arguments.size() == 0's condition in ExecuteScalarExpression when we call some functions
has no arguments, like (random, hash_count ...).

### Are these changes tested?

Yes

### Are there any user-facing changes?

No.
* Closes: #39860

Lead-authored-by: hugo.zhang <hugo.zhang@openpie.com>
Co-authored-by: 张回归 <zhanghuigui@zhanghuiguideMacBook-Pro-1681.local>
Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
mdianjun pushed a commit to marsno1/arrow that referenced this pull request Mar 1, 2024
…y args function with a wrong result (apache#39908)

Try to fix apache#39860.

Deal with the call->arguments.size() == 0's condition in ExecuteScalarExpression when we call some functions
has no arguments, like (random, hash_count ...).

Yes

No.
* Closes: apache#39860

Lead-authored-by: hugo.zhang <hugo.zhang@openpie.com>
Co-authored-by: 张回归 <zhanghuigui@zhanghuiguideMacBook-Pro-1681.local>
Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++] Expression ExecuteScalarExpression execute empty args function with a wrong result

3 participants