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

[nit] make schema qualifier error message in field lookup more readable #1079

Merged
merged 1 commit into from
Oct 7, 2021
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
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: db_test
Expand Down
6 changes: 3 additions & 3 deletions datafusion/src/logical_plan/dfschema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl DFSchema {
.filter(|(_, field)| match (qualifier, &field.qualifier) {
// field to lookup is qualified.
// current field is qualified and not shared between relations, compare both
// qualifer and name.
// qualifier and name.
(Some(q), Some(field_q)) => q == field_q && field.name() == name,
// field to lookup is qualified but current field is unqualified.
(Some(_), None) => false,
Expand All @@ -170,7 +170,7 @@ impl DFSchema {
match matches.next() {
None => Err(DataFusionError::Plan(format!(
"No field named '{}.{}'. Valid fields are {}.",
qualifier.unwrap_or(""),
qualifier.unwrap_or("<unqualified>"),
name,
self.get_field_names()
))),
Expand All @@ -179,7 +179,7 @@ impl DFSchema {
// found more than one matches
Some(_) => Err(DataFusionError::Internal(format!(
"Ambiguous reference to qualified field named '{}.{}'",
qualifier.unwrap_or(""),
qualifier.unwrap_or("<unqualified>"),
name
))),
},
Expand Down