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
3 changes: 3 additions & 0 deletions datafusion/sql/src/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
if !select.sort_by.is_empty() {
return Err(DataFusionError::NotImplemented("SORT BY".to_string()));
}
if select.into.is_some() {
return Err(DataFusionError::NotImplemented("INTO".to_string()));
}

// process `from` clause
let plan = self.plan_from_tables(select.from, planner_context)?;
Expand Down
31 changes: 31 additions & 0 deletions datafusion/sql/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3350,6 +3350,37 @@ fn test_select_distinct_order_by() {
assert_eq!(err.to_string(), expected);
}

#[rstest]
#[case::select_cluster_by_unsupported(
"SELECT customer_name, SUM(order_total) as total_order_amount FROM orders CLUSTER BY customer_name",
"This feature is not implemented: CLUSTER BY"
)]
#[case::select_lateral_view_unsupported(
"SELECT id, number FROM person LATERAL VIEW explode(numbers) exploded_table AS number",
"This feature is not implemented: LATERAL VIEWS"
)]
#[case::select_qualify_unsupported(
"SELECT i, p, o FROM person QUALIFY ROW_NUMBER() OVER (PARTITION BY p ORDER BY o) = 1",
"This feature is not implemented: QUALIFY"
)]
#[case::select_top_unsupported(
"SELECT TOP (5) * FROM person",
"This feature is not implemented: TOP"
)]
#[case::select_sort_by_unsupported(
"SELECT * FROM person SORT BY id",
"This feature is not implemented: SORT BY"
)]
#[case::select_into_unsupported(
"SELECT * INTO test FROM person",
"This feature is not implemented: INTO"
)]
#[test]
fn test_select_unsupported_syntax_errors(#[case] sql: &str, #[case] error: &str) {
let err = logical_plan(sql).unwrap_err();
assert_eq!(err.to_string(), error)
}

#[test]
fn select_order_by_with_cast() {
let sql =
Expand Down