Skip to content
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
8 changes: 4 additions & 4 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 @@ -96,7 +96,7 @@ sha2 = "0.10"
simd-json = { version = "0.17", features = ["known-key", "128bit"] }
simdutf8 = "0.1.4"
slotmap = "1"
sqlparser = { version = "0.60", features = ["visitor"] }
sqlparser = { version = "0.61", features = ["visitor"] }
stacker = "0.1"
streaming-iterator = "0.1.9"
strength_reduce = "0.2"
Expand Down
14 changes: 11 additions & 3 deletions crates/polars-sql/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ impl SQLContext {
order_by,
limit,
delete_token: _,
optimizer_hint: _,
}) = stmt
{
let error_message: Option<&'static str> = if !tables.is_empty() {
Expand Down Expand Up @@ -1027,20 +1028,24 @@ impl SQLContext {
ref exclude,
ref into,
ref lateral_views,
ref optimizer_hint,
ref prewhere,
ref select_modifiers,
ref sort_by,
ref top,
ref value_table_mode,
} = *select_stmt;

// Raise specific error messages for unsupported attributes
polars_ensure!(cluster_by.is_empty(), SQLInterface: "`CLUSTER BY` clause is not supported");
polars_ensure!(connect_by.is_none(), SQLInterface: "`CONNECT BY` clause is not supported");
polars_ensure!(connect_by.is_empty(), SQLInterface: "`CONNECT BY` clause is not supported");
polars_ensure!(distribute_by.is_empty(), SQLInterface: "`DISTRIBUTE BY` clause is not supported");
polars_ensure!(exclude.is_none(), SQLInterface: "`EXCLUDE` clause is not supported");
polars_ensure!(into.is_none(), SQLInterface: "`SELECT INTO` clause is not supported");
polars_ensure!(lateral_views.is_empty(), SQLInterface: "`LATERAL VIEW` clause is not supported");
polars_ensure!(optimizer_hint.is_none(), SQLInterface: "optimizer hints are not supported");
polars_ensure!(prewhere.is_none(), SQLInterface: "`PREWHERE` clause is not supported");
polars_ensure!(select_modifiers.is_none(), SQLInterface: "select modifiers are not supported");
polars_ensure!(sort_by.is_empty(), SQLInterface: "`SORT BY` clause is not supported; use `ORDER BY` instead");
polars_ensure!(top.is_none(), SQLInterface: "`TOP` clause is not supported; use `LIMIT` instead");
polars_ensure!(value_table_mode.is_none(), SQLInterface: "`SELECT AS VALUE/STRUCT` is not supported");
Expand Down Expand Up @@ -1454,7 +1459,7 @@ impl SQLContext {
UniqueKeepStrategy::First,
));
},
None => lf,
Some(Distinct::All) | None => lf,
};
Ok(lf)
}
Expand Down Expand Up @@ -1796,8 +1801,11 @@ impl SQLContext {
lateral,
subquery,
alias,
sample,
} => {
polars_ensure!(!(*lateral), SQLInterface: "LATERAL not supported");
polars_ensure!(!(*lateral), SQLInterface: "LATERAL is not supported");
polars_ensure!(sample.is_none(), SQLInterface: "SAMPLE is not supported");

if let Some(alias) = alias {
let mut lf = self.execute_query_no_ctes(subquery)?;
lf = self.rename_columns_from_table_alias(lf, alias)?;
Expand Down
1 change: 1 addition & 0 deletions crates/polars-sql/src/sql_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ impl SQLExprVisitor<'_> {
expr,
data_type,
format,
array: _,
} => self.visit_cast(expr, data_type, format, kind),
SQLExpr::Ceil { expr, .. } => Ok(self.visit_expr(expr)?.ceil()),
SQLExpr::CompoundFieldAccess { root, access_chain } => {
Expand Down
Loading