Closed
Labels
bugSomething isn't working
Description
Describe the bug
When upgrading DataFusion in InfluxData IOx, we found a regression that fc34dac brought in, which comes from the PR below:
For example, querying substring("region", 1, 2) errors with the following message:
Unsupported ast node in sqltorel: Substring { expr: Identifier(Ident { value: "region", quote_style: None }), substring_from: Some(Value(Number("1", false))), substring_for: Some(Value(Number("2", false))), special: true }
I verified that the previous commit (eb72deb) doesn't have this bug
To Reproduce
- on the latest
apache/datafusionmain branch
git co fc34dacdb9842cde4d056d5a659796ede4ae5e74
- build datafusion-cli locally
cd datafusion-cli
cargo build
- run datafusion-cli locally
./target/debug/datafusion-cli
- Then in
datafusion-cli
DataFusion CLI v37.1.0
# create a table with one column
CREATE TABLE fruits (name VARCHAR(100));
INSERT INTO fruits (name) VALUES ('banana');
INSERT INTO fruits (name) VALUES ('apple');
0 row(s) fetched.
Elapsed 0.004 seconds.
+-------+
| count |
+-------+
| 1 |
+-------+
1 row(s) fetched.
Elapsed 0.004 seconds.
+-------+
| count |
+-------+
| 1 |
+-------+
1 row(s) fetched.
Elapsed 0.004 seconds.
> select * from fruits;
+--------+
| name |
+--------+
| banana |
| apple |
+--------+
2 row(s) fetched.
Elapsed 0.011 seconds.
> select substring("name", 1, 2) from fruits;
This feature is not implemented: Unsupported ast node in sqltorel: Substring { expr: Identifier(Ident { value: "name", quote_style: Some('"') }), substring_from: Some(Value(Number("1", false))), substring_for: Some(Value(Number("2", false))), special: true }Expected behavior
> select substring("name", 1, 2) from fruits;
+---------------------------------------+
| substr(fruits.name,Int64(1),Int64(2)) |
+---------------------------------------+
| ba |
| ap |
+---------------------------------------+
2 row(s) fetched.
Elapsed 0.015 seconds.I verified that substring() works fine when I built and ran the previous commit (eb72deb) locally
Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
Jefffrey commentedon Apr 26, 2024
Should be resolved by #10242
appletreeisyellow commentedon Apr 26, 2024
@Jefffrey I forgot to check the latest commits🤦♀️ Thank you!