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

SELECT split("1m_2d", '_')[0];Starrocks supports executing this sql, why not give an error instead of an error result?? #45433

Open
luckylhb90 opened this issue May 10, 2024 · 3 comments
Labels
type/bug Something isn't working

Comments

@luckylhb90
Copy link

Steps to reproduce the behavior (Required)

  1. SELECT split("1m_2d", '_')[0];

Expected behavior (Required)

I want to get an error or return a correct result like the other engines.

Real behavior (Required)

return null....
image

StarRocks version (Required)

@luckylhb90 luckylhb90 added the type/bug Something isn't working label May 10, 2024
@kangkaisen
Copy link
Collaborator

We will check and fix it, Thanks

@before-Sunrise
Copy link
Contributor

you can check https://docs.starrocks.io/docs/sql-reference/data-types/semi_structured/Array/#query-array-data, our array index begin from 1 instead of 0, and return NULL if index is invalid @luckylhb90

@luckylhb90
Copy link
Author

you can check https://docs.starrocks.io/docs/sql-reference/data-types/semi_structured/Array/#query-array-data, our array index begin from 1 instead of 0, and return NULL if index is invalid @luckylhb90

Why did you design it that way? Other engine indexes start at 0, so why do you have to do something special here?
If the index is invalid, should you give an error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants