This is an automated email from the ASF dual-hosted git repository.
jakevin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 71be0fcce0 fix: typo in substrait (#7224)
71be0fcce0 is described below
commit 71be0fcce04c137b899e9cc00dc121ca2cf51013
Author: Ruihang Xia <[email protected]>
AuthorDate: Tue Aug 8 13:02:17 2023 +0800
fix: typo in substrait (#7224)
---
datafusion/substrait/src/logical_plan/producer.rs | 2 +-
.../substrait/tests/cases/roundtrip_logical_plan.rs | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/datafusion/substrait/src/logical_plan/producer.rs
b/datafusion/substrait/src/logical_plan/producer.rs
index 07da2dc0be..d3337e736d 100644
--- a/datafusion/substrait/src/logical_plan/producer.rs
+++ b/datafusion/substrait/src/logical_plan/producer.rs
@@ -471,7 +471,7 @@ pub fn operator_to_name(op: Operator) -> &'static str {
Operator::Gt => "gt",
Operator::GtEq => "gte",
Operator::Plus => "add",
- Operator::Minus => "substract",
+ Operator::Minus => "subtract",
Operator::Multiply => "multiply",
Operator::Divide => "divide",
Operator::Modulo => "mod",
diff --git a/datafusion/substrait/tests/cases/roundtrip_logical_plan.rs
b/datafusion/substrait/tests/cases/roundtrip_logical_plan.rs
index f297264c3d..90c3d199b7 100644
--- a/datafusion/substrait/tests/cases/roundtrip_logical_plan.rs
+++ b/datafusion/substrait/tests/cases/roundtrip_logical_plan.rs
@@ -410,6 +410,21 @@ async fn roundtrip_outer_join() -> Result<()> {
roundtrip("SELECT data.a FROM data FULL OUTER JOIN data2 ON data.a =
data2.a").await
}
+#[tokio::test]
+async fn roundtrip_arithmetic_ops() -> Result<()> {
+ roundtrip("SELECT a - a FROM data").await?;
+ roundtrip("SELECT a + a FROM data").await?;
+ roundtrip("SELECT a * a FROM data").await?;
+ roundtrip("SELECT a / a FROM data").await?;
+ roundtrip("SELECT a = a FROM data").await?;
+ roundtrip("SELECT a != a FROM data").await?;
+ roundtrip("SELECT a > a FROM data").await?;
+ roundtrip("SELECT a >= a FROM data").await?;
+ roundtrip("SELECT a < a FROM data").await?;
+ roundtrip("SELECT a <= a FROM data").await?;
+ Ok(())
+}
+
#[tokio::test]
async fn roundtrip_like() -> Result<()> {
roundtrip("SELECT f FROM data WHERE f LIKE 'a%b'").await