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

Chore: explicitly list out all Expr types in TypeCoercionRewriter::mutate #9038

Merged
merged 1 commit into from
Jan 29, 2024
Merged
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
17 changes: 16 additions & 1 deletion datafusion/optimizer/src/analyzer/type_coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,22 @@ impl TreeNodeRewriter for TypeCoercionRewriter {
));
Ok(expr)
}
expr => Ok(expr),
Expr::Alias(_)
| Expr::Column(_)
| Expr::ScalarVariable(_, _)
| Expr::Literal(_)
| Expr::SimilarTo(_)
| Expr::IsNotNull(_)
| Expr::IsNull(_)
| Expr::Negative(_)
Copy link
Contributor

@alamb alamb Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 looks like there are some other bugs here;

❯ select -'100';
Internal error: Can't create negative physical expr for (- 'Literal { value: Utf8("100") }'), the type of child expr is Utf8, not signed numeric.
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
❯ select -'100'::int;
+-----------------+
| (- Utf8("100")) |
+-----------------+
| -100            |
+-----------------+

I will file another ticket -- #9060

| Expr::GetIndexedField(_)
| Expr::Cast(_)
| Expr::TryCast(_)
| Expr::Sort(_)
| Expr::Wildcard { .. }
| Expr::GroupingSet(_)
| Expr::Placeholder(_)
| Expr::OuterReferenceColumn(_, _) => Ok(expr),
}
}
}
Expand Down
Loading