-
Notifications
You must be signed in to change notification settings - Fork 0
UNPIVOT command #24
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
UNPIVOT command #24
Conversation
Note for the reviewers: test doc fails is currently expected. The clippy error is very weird. I figure it out later. If you want it to be clean I can just exclude this part from clippy for now. |
datafusion/sql/src/relation/mod.rs
Outdated
let mut builder = LogicalPlanBuilder::from(base_plan.clone()) | ||
.project(projection_exprs)?; | ||
|
||
if null_inclusion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: if let Some(NullInclusion::ExcludeNulls) | None = null_inclusion {
datafusion/sql/src/relation/mod.rs
Outdated
for column_ident in &columns { | ||
let column_name = column_ident.value.clone(); | ||
|
||
if let Some(idx) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: I personally find it easier to read when with an "exit early" approach, subjectively this can be rewritten as
let idx = if let Some(i) = base_schema.index_of_column_by_name(None, &column_name) {
i
} else {
return plan_err!("Column '{}' not found in input", column_name);
};
let field = base_schema.field(idx);
let field_type = field.data_type();
Which issue does this PR close?
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?