Skip to content
Merged
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
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ regex = "1.12"
rstest = "0.26.1"
serde_json = "1"
sha2 = "^0.11.0"
sqlparser = { git = "https://github.com/Embucket/datafusion-sqlparser-rs.git", rev = "ff0378d5b2205e839360ab473efe9bcfa520f65f", default-features = false, features = [
sqlparser = { git = "https://github.com/Embucket/datafusion-sqlparser-rs.git", rev = "707457f75c46c99c441b2859ad5bb01e21e5f105", default-features = false, features = [
"std",
"visitor",
] }
Expand Down
3 changes: 3 additions & 0 deletions datafusion/sql/src/unparser/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ impl Unparser<'_> {
let cross_join = ast::Join {
relation: flatten_factor,
global: false,
directed: false,
join_operator: ast::JoinOperator::CrossJoin(
ast::JoinConstraint::None,
),
Expand Down Expand Up @@ -1449,6 +1450,7 @@ impl Unparser<'_> {
let ast_join = ast::Join {
relation,
global: false,
directed: false,
join_operator: self
.join_operator_to_sql(join.join_type, join_constraint)?,
};
Expand Down Expand Up @@ -1870,6 +1872,7 @@ impl Unparser<'_> {
let ast_join = ast::Join {
relation,
global: false,
directed: false,
join_operator: ast::JoinOperator::AsOf {
match_condition,
constraint,
Expand Down
18 changes: 18 additions & 0 deletions datafusion/sql/tests/sql_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3455,6 +3455,24 @@ fn minus_is_an_alias_for_except() {
);
}

#[test]
fn snowflake_directed_join_plans() {
let sql = "SELECT person.id, orders.order_id \
FROM person \
INNER DIRECTED JOIN orders \
ON person.id = orders.customer_id";
let plan = logical_plan_with_dialect(sql, &SnowflakeDialect {}).unwrap();
assert_snapshot!(
plan,
@r"
Projection: person.id, orders.order_id
Inner Join: Filter: person.id = orders.customer_id
TableScan: person
TableScan: orders
"
);
}

#[test]
fn empty_over() {
let sql = "SELECT order_id, MAX(order_id) OVER () from orders";
Expand Down
Loading