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

octet_length() function not working for StringView columns (SQLancer) #12149

Open
2010YOUY01 opened this issue Aug 24, 2024 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@2010YOUY01
Copy link
Contributor

Describe the bug

Native StringView support for octet_length() has been added #11858
However it's not working for StringView column inside table

See reproducer in datafusion-cli
(Compiled from latest main using cargo run, commit a58416c)
The last query should work since this function should already have StringView support

DataFusion CLI v41.0.0
> create table t1(v1 text);
0 row(s) fetched.
Elapsed 0.058 seconds.

> insert into t1 values ('DataFusion'), ('datafusion');
+-------+
| count |
+-------+
| 2     |
+-------+
1 row(s) fetched.
Elapsed 0.047 seconds.

> create table t1_stringview as
select arrow_cast(v1, 'Utf8View') as v1
from t1;
0 row(s) fetched.
Elapsed 0.011 seconds.

# Now we have two equivalent tables `t1` and `t1_stringview`
# The difference is physical representation for string column (StringArray and StringViewArray)

> select octet_length(v1) from t1;
+---------------------+
| octet_length(t1.v1) |
+---------------------+
| 10                  |
| 10                  |
+---------------------+
2 row(s) fetched.
Elapsed 0.006 seconds.

> select octet_length(v1) from t1_stringview;
Arrow error: Compute error: length not supported for Utf8View

To Reproduce

No response

Expected behavior

No response

Additional context

Found by SQLancer #11030

@2010YOUY01 2010YOUY01 added the bug Something isn't working label Aug 24, 2024
@Omega359
Copy link
Contributor

take

@Omega359
Copy link
Contributor

This issue will be fixed once the arrow_string dependency is updated.

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

No branches or pull requests

2 participants