include some BinaryOperator from sqlparser#15327
Conversation
Signed-off-by: Ruihang Xia <[email protected]>
There was a problem hiding this comment.
Thanks @waynexia -- I think the idea is great. However, I think there should be sql level tests (sqllogitests) that run these operators. I think it will make extending operators easier for other systems built on DataFusion
The tests can / should probably error with unsupported
It might also be a good idea to include some documentation in the operators themselves that DataFusion doesn't have default implementations
| AtArrow | ArrowAt | Arrow | LongArrow | HashArrow | HashLongArrow | AtAt | ||
| | HashMinus | AtQuestion | Question | QuestionAnd | QuestionPipe | ||
| | IntegerDivide => { | ||
| unreachable!("These operators should be rewritten to functions") |
There was a problem hiding this comment.
I dont think this code is unreachable -- I got it to panic:
DataFusion CLI v46.0.1
> select 'foo' @> 'bar';
thread 'main' panicked at datafusion/physical-expr/src/expressions/binary.rs:799:17:
internal error: entered unreachable code: These operators should be rewritten to functions
note: run with `RUST_BACKTRACE=1` environment variable to display a backtraceThere was a problem hiding this comment.
I just realized <@ and @> are only supported for lists 🤣
Signed-off-by: Ruihang Xia <[email protected]>
That's a good idea! I think I know them much better after writing some SQLs (though none of them can run... lol) |
Signed-off-by: Ruihang Xia <[email protected]>
Added in 5828cba 👍 |
|
Thank you @alamb |
* include some BinaryOperator from sqlparser Signed-off-by: Ruihang Xia <[email protected]> * slt for new operators Signed-off-by: Ruihang Xia <[email protected]> * add document about availability Signed-off-by: Ruihang Xia <[email protected]> --------- Signed-off-by: Ruihang Xia <[email protected]>
* include some BinaryOperator from sqlparser Signed-off-by: Ruihang Xia <[email protected]> * slt for new operators Signed-off-by: Ruihang Xia <[email protected]> * add document about availability Signed-off-by: Ruihang Xia <[email protected]> --------- Signed-off-by: Ruihang Xia <[email protected]>
* include some BinaryOperator from sqlparser Signed-off-by: Ruihang Xia <[email protected]> * slt for new operators Signed-off-by: Ruihang Xia <[email protected]> * add document about availability Signed-off-by: Ruihang Xia <[email protected]> --------- Signed-off-by: Ruihang Xia <[email protected]>
Which issue does this PR close?
Rationale for this change
Follows #15326, this patch includes
Arrow,LongArrow,HashArrow,HashLongArrow,AtAt,IntegerDivide,HashMinus,AtQuestion,Question,QuestionAndandQuestionPipebinary operators.What changes are included in this PR?
New operators. Only
XORis actually implemented (functional) among them, by mapping to existingBitwiseXor.Are these changes tested?
Compiler tests it
Are there any user-facing changes?
New APIs