-
Notifications
You must be signed in to change notification settings - Fork 753
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
bug: Ambiguous column error when loading different case columns via COPY INTO #16473
Comments
The ambiguous column error you're encountering when using the if tables.len() > 1 {
return Err(ErrorCode::SemanticError(format!(
"The table of the internal column `{}` is ambiguous",
column_binding.internal_column.column_name()
)));
} This error can occur if the column names are not being correctly distinguished based on case sensitivity during the binding process [1]. To address this issue, you may need to ensure that the pub fn normalize_identifier(ident: &Identifier, context: &NameResolutionContext) -> Identifier {
if (ident.is_quoted() && context.quoted_ident_case_sensitive)
|| (!ident.is_quoted() && context.unquoted_ident_case_sensitive)
{
ident.clone()
} else {
Identifier::from_name(ident.span, ident.name.to_lowercase())
}
} You should verify that the If the issue persists, you might need to review the logic in the By ensuring that the case sensitivity settings and the identifier normalization logic are correctly implemented, you should be able to resolve the ambiguous column error. |
@youngsofun might be able to assist with this. |
Any ideas on this @youngsofun ? Is there any setting I could try to adjust? |
when copy from parquet fields are matched by name. the Available solution is to use transform
|
and I am working on this #16897 for better support of this issue |
Search before asking
Version
v1.2.635-nightly
What's Wrong?
When trying to load data via COPY INTO from a parquet file with case sensitive columns, an ambiguous column error is reported. Looks to be from https://github.com/datafuselabs/databend/blob/2c41faf63b5136ab22a2ab3ac972c9752dc4a7bf/src/query/sql/src/planner/binder/bind_context.rs#L301
The parquet file contains columns such as
c1
andC1
which exist within the target table.How to Reproduce?
Sorry not easy for me to write a script to replicate, but easy to describe
c1
&C1
create table t_sensitive ("c1" int, "C1" int);
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: