Implement fullname for ambiguity column name
@@ -71,12 +71,25 @@ impl JoinedSchema {
for table_desc in &self.tables_long_name_columns {
for column_desc in table_desc.get_columns_desc() {
+ match column_desc.is_ambiguity {
+ true => {
+ let prefix = table_desc.get_name_parts().join(".");
+ let fullname = format!("{}.{}", prefix, column_desc.short_name);
fields.push(DataField::new(
- &column_desc.column_name(),
+ &fullname,
column_desc.data_type.clone(),
column_desc.nullable,
));
}
+ false => {
+ fields.push(DataField::new(
+ &column_desc.short_name,
+ column_desc.data_type.clone(),
+ column_desc.nullable,
+ ));
+ }
+ };
+ }
}
Arc::new(DataSchema::new(fields))
@@ -207,12 +220,5 @@ impl JoinedColumnDesc {
is_ambiguity: false,
}
}
-
- pub fn column_name(&self) -> String {
- match self.is_ambiguity {
- true => unimplemented!(),
- false => self.short_name.clone()
- }
- }
}
