Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ARRAY_SIZE alias for ARRAY_LENGTH #16685

Merged
merged 3 commits into from
Oct 25, 2024

Conversation

ding-young
Copy link
Contributor

@ding-young ding-young commented Oct 24, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

The PR introduces array_size as an alias for length because array_length is already an alias for length.
However, unlike Snowflake, where array_size(non-array) returns NULL,
(ref. https://docs.snowflake.com/en/sql-reference/functions/array_size)
this implementation behaves differently for non-array values since I simply registered array_size as an alias for length.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Oct 24, 2024
@BohuTANG BohuTANG requested a review from b41sh October 24, 2024 08:18
Copy link
Member

@b41sh b41sh 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 for your contribution. @ding-young
better to add some sqllogic test at this file tests/sqllogictests/suites/query/functions/02_0061_function_array.test

@ding-young
Copy link
Contributor Author

ding-young commented Oct 24, 2024

@b41sh I added some sqllogic tests. The PR appears to fail some checks, but I can't determine the reason as the failing tests seem unrelated to the changes I made. Could you help me identify the cause?

@BohuTANG
Copy link
Member

@b41sh I added some sqllogic tests. The PR appears to fail some checks, but I can't determine the reason as the failing tests seem unrelated to the changes I made. Could you help me identify the cause?

This failures seems not related to this PR, I have merge main branch into this PR, and wait the all the CI to run again.

@b41sh b41sh added this pull request to the merge queue Oct 25, 2024
@BohuTANG BohuTANG removed this pull request from the merge queue due to a manual request Oct 25, 2024
@BohuTANG BohuTANG merged commit c1c0362 into databendlabs:main Oct 25, 2024
72 checks passed
@BohuTANG
Copy link
Member

@ding-young Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: Add ARRAY_SIZE alias for ARRAY_LENGTH for Snowflake compatibility
3 participants