Skip to content

Conversation

@tlm365
Copy link
Contributor

@tlm365 tlm365 commented Oct 13, 2024

Rationale for this change

Using the unary functions allows faster processing by avoiding branching on nulls.

What changes are included in this PR?

  • Apply unary
  • Add benchmark

Are these changes tested?

Existing testcases.

Are there any user-facing changes?

No.

**BENCHMARK RESULT
screenshot_2024-10-13_21-01-32

Signed-off-by: Tai Le Manh <manhtai.lmt@gmail.com>
@github-actions github-actions bot added the functions Changes to functions implementation label Oct 13, 2024
@tlm365 tlm365 marked this pull request as ready for review October 13, 2024 18:06
Copy link
Member

@jonahgao jonahgao left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @tlm365

@alamb
Copy link
Contributor

alamb commented Oct 15, 2024

Wow -- we are just cranking right along here. ❤️

///cot SQL function
fn cot(args: &[ArrayRef]) -> Result<ArrayRef> {
match args[0].data_type() {
Float64 => Ok(Arc::new(make_function_scalar_inputs!(
Copy link
Member

Choose a reason for hiding this comment

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

relates to #12923

@alamb alamb merged commit 90720c0 into apache:main Oct 16, 2024
@tlm365 tlm365 deleted the optimize-cot branch November 10, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants