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

chore(deps): update sqlparser requirement from 0.35 to 0.36 #7037

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ arrow-buffer = { version = "43.0.0", default-features = false }
arrow-flight = { version = "43.0.0", features = ["flight-sql-experimental"] }
arrow-schema = { version = "43.0.0", default-features = false }
parquet = { version = "43.0.0", features = ["arrow", "async", "object_store"] }
sqlparser = { version = "0.35", features = ["visitor"] }
sqlparser = { version = "0.36", features = ["visitor"] }

[profile.release]
codegen-units = 1
Expand Down
102 changes: 51 additions & 51 deletions datafusion-cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions datafusion/core/tests/sqllogictests/test_files/decimal.slt
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,13 @@ select c1/c5 from decimal_simple;


query T
select arrow_typeof(c5%cast(0.00001 as decimal(5,5))) from decimal_simple limit 1;
select arrow_typeof(c5 % cast(0.00001 as decimal(5,5))) from decimal_simple limit 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was due to apache/datafusion-sqlparser-rs#913 from @izveigor where without a space this is parsed to something different.

I think this is a bug in sqlparser

c1%c5 is being parsed like this (note the value is 5, not c5)

                                BinaryOp {
                                    left: Identifier(
                                        Ident {
                                            value: "c1",
                                            quote_style: None,
                                        },
                                    ),
                                    op: Modulo,
                                    right: Value(
                                        Number(
                                            "5",
                                            false,
                                        ),
                                    ),
                                },

With spaces, c1 % c5 is parsed correctly:

                                BinaryOp {
                                    left: Identifier(
                                        Ident {
                                            value: "c1",
                                            quote_style: None,
                                        },
                                    ),
                                    op: Modulo,
                                    right: Identifier(
                                        Ident {
                                            value: "c5",
                                            quote_style: None,
                                        },
                                    ),
                                },```

I will file a ticket in sqlparser

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#7051 with upgrade with fix

----
Decimal128(7, 7)


query R rowsort
select c5%cast(0.00001 as decimal(5,5)) from decimal_simple;
select c5 % cast(0.00001 as decimal(5,5)) from decimal_simple;
----
0
0
Expand All @@ -441,13 +441,13 @@ select c5%cast(0.00001 as decimal(5,5)) from decimal_simple;


query T
select arrow_typeof(c1%c5) from decimal_simple limit 1;
select arrow_typeof(c1 % c5) from decimal_simple limit 1;
----
Decimal128(11, 7)


query R rowsort
select c1%c5 from decimal_simple;
select c1 % c5 from decimal_simple;
----
0
0
Expand Down
10 changes: 10 additions & 0 deletions datafusion/sql/src/set_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
let all = match set_quantifier {
SetQuantifier::All => true,
SetQuantifier::Distinct | SetQuantifier::None => false,
SetQuantifier::ByName => {
return Err(DataFusionError::NotImplemented(
"UNION BY NAME not implemented".to_string(),
));
}
SetQuantifier::AllByName => {
return Err(DataFusionError::NotImplemented(
"UNION ALL BY NAME not implemented".to_string(),
))
}
};

let left_plan = self.set_expr_to_plan(*left, planner_context)?;
Expand Down
Loading