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

Minor: improve error message by adding types to message #8065

Merged
merged 2 commits into from
Nov 6, 2023
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 datafusion/expr/src/logical_plan/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl LogicalPlanBuilder {
let data_type = expr.get_type(&empty_schema)?;
if let Some(prev_data_type) = &field_types[j] {
if prev_data_type != &data_type {
return plan_err!("Inconsistent data type across values list at row {i} column {j}");
return plan_err!("Inconsistent data type across values list at row {i} column {j}. Was {prev_data_type} but found {data_type}")
}
}
Ok(Some(data_type))
Expand Down
4 changes: 4 additions & 0 deletions datafusion/sqllogictest/test_files/errors.slt
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,7 @@ c9,
nth_value(c5, 2, 3) over (order by c9) as nv1
from aggregate_test_100
order by c9


statement error Inconsistent data type across values list at row 1 column 0. Was Int64 but found Utf8
create table foo as values (1), ('foo');
Loading