datafusion
datafusion copied to clipboard
initial prettier unparse
Which issue does this PR close?
Takes a shot at #10633 .
Rationale for this change
Algorithm adopted from this SO answer.
What changes are included in this PR?
Make unparsed binary expressions easier to read.
Are these changes tested?
Can use more tests/statements/plans to unparse.
Are there any user-facing changes?
New pretty_expr_to_sql unparser function. Also IMHO I think this is better (and easier to implement, review and maintain) than directly changing the existing expr_to_sql.
Hi @alamb this can use more testing, match cases and moving stuff around as I'm not too familiar with the unparser. ~~And I'm still working on subtraction and division~~
Appreciate if you can provide other cases/expressions that should be tested.
I plan to review this tomorrow
FYI @phillipleblanc
Thanks @alamb and @phillipleblanc. Updated PR accordingly
I'm aware of a failing test, will look into it later today.
thanks @MohamedAbdeen21 -- I am very behind on reviews. I put this one on my list again
cc @backkem and @devinjdangelo
Here is a PR to improve the documentation https://github.com/apache/datafusion/pull/11395 (based on this one)
Thanks again @MohamedAbdeen21