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

When the table is empty, SR SQL syntax checker can not infer the type of user defined variable correctly #53019

Open
zhangyaqi1989 opened this issue Nov 19, 2024 · 0 comments
Labels
type/bug Something isn't working

Comments

@zhangyaqi1989
Copy link
Contributor

zhangyaqi1989 commented Nov 19, 2024

Steps to reproduce the behavior (Required)

1. CREATE TABLE quickstart.example_table (`pk` BIGINT, `activity` String) DISTRIBUTED BY HASH (`pk`) PROPERTIES("replication_num" = "1");
2. SET @var = (SELECT ARRAY_AGG(activity) FROM quickstart.example_table);
3. SELECT ARRAY_CONTAINS(ARRAY_CONCAT(@var), "a");

Expected behavior (Required)

The SQL should run successfully.

Note that if you insert a row in the table, the SQL will work. Also the below SQL which does not use user defined variable works.

WITH input AS (SELECT ARRAY_AGG(activity) AS activities FROM quickstart.example_table) SELECT ARRAY_CONTAINS(ARRAY_CONCAT(input.activities), "a") FROM input;

Real behavior (Required)

ERROR 1064 (HY000): Getting analyzing error from line 1, column 22 to line 1, column 39. Detail message: 1-th input of array_concat should be an array, rather than varchar.

StarRocks version (Required)

  • 3.3
@zhangyaqi1989 zhangyaqi1989 added the type/bug Something isn't working label Nov 19, 2024
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

1 participant