Skip to content
Merged
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
18 changes: 17 additions & 1 deletion datafusion/core/src/execution/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,8 @@ impl ContextProvider for SessionState {
return None;
}

let provider_type = if &variable_names[0][0..2] == "@@" {
let first_variable = &variable_names[0];
let provider_type = if first_variable.len() > 1 && &first_variable[0..2] == "@@" {
VarType::System
} else {
VarType::UserDefined
Expand Down Expand Up @@ -1857,6 +1858,21 @@ mod tests {
Ok(())
}

#[tokio::test]
async fn create_variable_err() -> Result<()> {
let ctx = SessionContext::new();

let err = plan_and_collect(&ctx, "SElECT @= X#=?!~ 5")
.await
.unwrap_err();

assert_eq!(
err.to_string(),
"Execution error: variable [\"@\"] has no type information"
);
Ok(())
}

#[tokio::test]
async fn register_deregister() -> Result<()> {
let tmp_dir = TempDir::new()?;
Expand Down