From 5d4468579481b36e53333c62bfd2440af1de1155 Mon Sep 17 00:00:00 2001 From: comphead Date: Tue, 23 Apr 2024 12:12:57 -0700 Subject: [PATCH 1/5] Doc: Modify docs to fix old naming (#10199) * fix docs on datafusion names * fix code * fmt * Update dev/release/README.md Co-authored-by: Andy Grove * Update dev/release/README.md Co-authored-by: Andy Grove * Update dev/release/README.md Co-authored-by: Andy Grove --------- Co-authored-by: Andy Grove --- datafusion-cli/src/catalog.rs | 5 ++--- datafusion-examples/README.md | 2 +- .../examples/flight/flight_sql_server.rs | 2 +- datafusion/sqllogictest/README.md | 2 +- .../src/engines/datafusion_engine/normalize.rs | 10 +++++----- dev/release/README.md | 8 ++++---- docs/source/contributor-guide/communication.md | 2 +- docs/source/user-guide/example-usage.md | 2 +- docs/source/user-guide/faq.md | 2 +- docs/source/user-guide/introduction.md | 4 ++-- 10 files changed, 19 insertions(+), 20 deletions(-) diff --git a/datafusion-cli/src/catalog.rs b/datafusion-cli/src/catalog.rs index 0fbb7a5908b57..faa657da6511e 100644 --- a/datafusion-cli/src/catalog.rs +++ b/datafusion-cli/src/catalog.rs @@ -345,10 +345,9 @@ mod tests { if cfg!(windows) { "USERPROFILE" } else { "HOME" }, test_home_path, ); - let input = - "~/Code/arrow-datafusion/benchmarks/data/tpch_sf1/part/part-0.parquet"; + let input = "~/Code/datafusion/benchmarks/data/tpch_sf1/part/part-0.parquet"; let expected = format!( - "{}{}Code{}arrow-datafusion{}benchmarks{}data{}tpch_sf1{}part{}part-0.parquet", + "{}{}Code{}datafusion{}benchmarks{}data{}tpch_sf1{}part{}part-0.parquet", test_home_path, MAIN_SEPARATOR, MAIN_SEPARATOR, diff --git a/datafusion-examples/README.md b/datafusion-examples/README.md index 5c596d1cda915..4b0e64ebdb7e7 100644 --- a/datafusion-examples/README.md +++ b/datafusion-examples/README.md @@ -31,7 +31,7 @@ To run the examples, use the `cargo run` command, such as: ```bash git clone https://github.com/apache/datafusion -cd arrow-datafusion +cd datafusion # Download test data git submodule update --init diff --git a/datafusion-examples/examples/flight/flight_sql_server.rs b/datafusion-examples/examples/flight/flight_sql_server.rs index ed9457643b7df..f04a559d002e8 100644 --- a/datafusion-examples/examples/flight/flight_sql_server.rs +++ b/datafusion-examples/examples/flight/flight_sql_server.rs @@ -73,7 +73,7 @@ macro_rules! status { /// /// JDBC connection string: "jdbc:arrow-flight-sql://127.0.0.1:50051/" /// -/// Based heavily on Ballista's implementation: https://github.com/apache/arrow-ballista/blob/main/ballista/scheduler/src/flight_sql.rs +/// Based heavily on Ballista's implementation: https://github.com/apache/datafusion-ballista/blob/main/ballista/scheduler/src/flight_sql.rs /// and the example in arrow-rs: https://github.com/apache/arrow-rs/blob/master/arrow-flight/examples/flight_sql_server.rs /// #[tokio::main] diff --git a/datafusion/sqllogictest/README.md b/datafusion/sqllogictest/README.md index 5a900cb994b24..930df47967762 100644 --- a/datafusion/sqllogictest/README.md +++ b/datafusion/sqllogictest/README.md @@ -225,7 +225,7 @@ query ``` -- `test_name`: Uniquely identify the test name (arrow-datafusion only) +- `test_name`: Uniquely identify the test name (Datafusion only) - `type_string`: A short string that specifies the number of result columns and the expected datatype of each result column. There is one character in the for each result column. The characters codes are: - 'B' - **B**oolean, diff --git a/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs b/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs index 7eef1f020ffa7..520b6b53b32da 100644 --- a/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs +++ b/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs @@ -142,21 +142,21 @@ fn normalize_paths(mut row: Vec) -> Vec { fn workspace_root() -> &'static object_store::path::Path { static WORKSPACE_ROOT_LOCK: OnceLock = OnceLock::new(); WORKSPACE_ROOT_LOCK.get_or_init(|| { - // e.g. /Software/arrow-datafusion/datafusion/core + // e.g. /Software/datafusion/datafusion/core let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - // e.g. /Software/arrow-datafusion/datafusion + // e.g. /Software/datafusion/datafusion let workspace_root = dir .parent() .expect("Can not find parent of datafusion/core") - // e.g. /Software/arrow-datafusion + // e.g. /Software/datafusion .parent() .expect("parent of datafusion") .to_string_lossy(); let sanitized_workplace_root = if cfg!(windows) { - // Object store paths are delimited with `/`, e.g. `D:/a/arrow-datafusion/arrow-datafusion/testing/data/csv/aggregate_test_100.csv`. - // The default windows delimiter is `\`, so the workplace path is `D:\a\arrow-datafusion\arrow-datafusion`. + // Object store paths are delimited with `/`, e.g. `/datafusion/datafusion/testing/data/csv/aggregate_test_100.csv`. + // The default windows delimiter is `\`, so the workplace path is `datafusion\datafusion`. workspace_root .replace(std::path::MAIN_SEPARATOR, object_store::path::DELIMITER) } else { diff --git a/dev/release/README.md b/dev/release/README.md index c1701062cadfe..32735588ed8f4 100644 --- a/dev/release/README.md +++ b/dev/release/README.md @@ -223,7 +223,7 @@ Here is my vote: +1 [1]: https://github.com/apache/datafusion/tree/a5dd428f57e62db20a945e8b1895de91405958c4 -[2]: https://dist.apache.org/repos/dist/dev/arrow/apache-arrow-datafusion-5.1.0 +[2]: https://dist.apache.org/repos/dist/dev/arrow/apache-datafusion-5.1.0 [3]: https://github.com/apache/datafusion/blob/a5dd428f57e62db20a945e8b1895de91405958c4/CHANGELOG.md ``` @@ -249,7 +249,7 @@ NOTE: steps in this section can only be done by PMC members. ### After the release is approved Move artifacts to the release location in SVN, e.g. -https://dist.apache.org/repos/dist/release/arrow/arrow-datafusion-5.1.0/, using +https://dist.apache.org/repos/dist/release/datafusion/datafusion-5.1.0/, using the `release-tarball.sh` script: ```shell @@ -437,7 +437,7 @@ svn ls https://dist.apache.org/repos/dist/dev/arrow | grep datafusion Delete a release candidate: ```bash -svn delete -m "delete old DataFusion RC" https://dist.apache.org/repos/dist/dev/arrow/apache-arrow-datafusion-7.1.0-rc1/ +svn delete -m "delete old DataFusion RC" https://dist.apache.org/repos/dist/dev/datafusion/apache-datafusion-7.1.0-rc1/ ``` #### Deleting old releases from `release` svn @@ -453,7 +453,7 @@ svn ls https://dist.apache.org/repos/dist/release/arrow | grep datafusion Delete a release: ```bash -svn delete -m "delete old DataFusion release" https://dist.apache.org/repos/dist/release/arrow/arrow-datafusion-7.0.0 +svn delete -m "delete old DataFusion release" https://dist.apache.org/repos/dist/release/datafusion/datafusion-7.0.0 ``` ### Publish the User Guide to the Arrow Site diff --git a/docs/source/contributor-guide/communication.md b/docs/source/contributor-guide/communication.md index 6e8e28cee3091..96f5e61d105e2 100644 --- a/docs/source/contributor-guide/communication.md +++ b/docs/source/contributor-guide/communication.md @@ -37,7 +37,7 @@ We use the Slack and Discord platforms for informal discussions and coordination meet other contributors and get guidance on where to contribute. It is important to note that any technical designs and decisions are made fully in the open, on GitHub. -Most of us use the `#arrow-datafusion` and `#arrow-rust` channels in the [ASF Slack workspace](https://s.apache.org/slack-invite) . +Most of us use the `#datafusion` and `#arrow-rust` channels in the [ASF Slack workspace](https://s.apache.org/slack-invite) . Unfortunately, due to spammers, the ASF Slack workspace requires an invitation to join. To get an invitation, request one in the `Arrow Rust` channel of the [Arrow Rust Discord server](https://discord.gg/Qw5gKqHxUM). diff --git a/docs/source/user-guide/example-usage.md b/docs/source/user-guide/example-usage.md index 25b398461f0ee..2fb4e55d698d1 100644 --- a/docs/source/user-guide/example-usage.md +++ b/docs/source/user-guide/example-usage.md @@ -274,7 +274,7 @@ backtrace: 0: std::backtrace_rs::backtrace::libunwind::trace 3: std::backtrace::Backtrace::capture at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/backtrace.rs:298:9 4: datafusion_common::error::DataFusionError::get_back_trace - at /arrow-datafusion/datafusion/common/src/error.rs:436:30 + at /datafusion/datafusion/common/src/error.rs:436:30 5: datafusion_sql::expr::function::>::sql_function_to_expr ............ ``` diff --git a/docs/source/user-guide/faq.md b/docs/source/user-guide/faq.md index fbc25f0b7233e..d803b11333f0e 100644 --- a/docs/source/user-guide/faq.md +++ b/docs/source/user-guide/faq.md @@ -28,7 +28,7 @@ DataFusion is a library for executing queries in-process using the Apache Arrow model and computational kernels. It is designed to run within a single process, using threads for parallel query execution. -[Ballista](https://github.com/apache/arrow-ballista) is a distributed compute platform built on DataFusion. +[Ballista](https://github.com/apache/datafusion-ballista) is a distributed compute platform built on DataFusion. # How does DataFusion Compare with `XYZ`? diff --git a/docs/source/user-guide/introduction.md b/docs/source/user-guide/introduction.md index a3fefdc56a7e3..676543b040341 100644 --- a/docs/source/user-guide/introduction.md +++ b/docs/source/user-guide/introduction.md @@ -95,7 +95,7 @@ Here are some active projects using DataFusion: - [Arroyo](https://github.com/ArroyoSystems/arroyo) Distributed stream processing engine in Rust -- [Ballista](https://github.com/apache/arrow-ballista) Distributed SQL Query Engine +- [Ballista](https://github.com/apache/datafusion-ballista) Distributed SQL Query Engine - [Comet](https://github.com/apache/datafusion-comet) Apache Spark native query execution plugin - [CnosDB](https://github.com/cnosdb/cnosdb) Open Source Distributed Time Series Database - [Cube Store](https://github.com/cube-js/cube.js/tree/master/rust) @@ -129,7 +129,7 @@ Here are some less active projects that used DataFusion: - [Flock](https://github.com/flock-lab/flock) - [Tensorbase](https://github.com/tensorbase/tensorbase) -[ballista]: https://github.com/apache/arrow-ballista +[ballista]: https://github.com/apache/datafusion-ballista [blaze]: https://github.com/blaze-init/blaze [cloudfuse buzz]: https://github.com/cloudfuse-io/buzz-rust [cnosdb]: https://github.com/cnosdb/cnosdb From 767bbca6347db7d396e1b1a5fa51d17373a9e5c2 Mon Sep 17 00:00:00 2001 From: Dmitry Bugakov Date: Tue, 23 Apr 2024 22:57:04 +0200 Subject: [PATCH 2/5] [MINOR] Remove ScalarFunction from datafusion.proto #10173 (#10202) --- datafusion/proto/proto/datafusion.proto | 156 -------- datafusion/proto/src/generated/pbjson.rs | 351 ------------------ datafusion/proto/src/generated/prost.rs | 190 +--------- .../proto/src/logical_plan/from_proto.rs | 10 +- .../proto/src/physical_plan/from_proto.rs | 6 - 5 files changed, 3 insertions(+), 710 deletions(-) diff --git a/datafusion/proto/proto/datafusion.proto b/datafusion/proto/proto/datafusion.proto index 7aa287055818f..5bffdc3af7741 100644 --- a/datafusion/proto/proto/datafusion.proto +++ b/datafusion/proto/proto/datafusion.proto @@ -389,7 +389,6 @@ message LogicalExprNode { NegativeNode negative = 13; InListNode in_list = 14; Wildcard wildcard = 15; - ScalarFunctionNode scalar_function = 16; TryCastNode try_cast = 17; // window expressions @@ -538,153 +537,6 @@ message InListNode { bool negated = 3; } -enum ScalarFunction { - // 0 was Abs before - // The first enum value must be zero for open enums - unknown = 0; - // 1 was Acos - // 2 was Asin - // 3 was Atan - // 4 was Ascii - // 5 was Ceil - // 6 was Cos - // 7 was Digest - // 8 was Exp - // 9 was Floor - // 10 was Ln - // 11 was Log - // 12 was Log10 - // 13 was Log2 - // 14 was Round - // 15 was Signum - // 16 was Sin - // 17 was Sqrt - // Tan = 18; - // 19 was Trunc - // 20 was Array - // RegexpMatch = 21; - // 22 was BitLength - // 23 was Btrim - // 24 was CharacterLength - // 25 was Chr - // 26 was Concat - // 27 was ConcatWithSeparator - // 28 was DatePart - // 29 was DateTrunc - // 30 was InitCap - // 31 was Left - // 32 was Lpad - // 33 was Lower - // 34 was Ltrim - // 35 was MD5 - // 36 was NullIf - // 37 was OctetLength - // 38 was Random - // 39 was RegexpReplace - // 40 was Repeat - // 41 was Replace - // 42 was Reverse - // 43 was Right - // 44 was Rpad - // 45 was Rtrim - // 46 was SHA224 - // 47 was SHA256 - // 48 was SHA384 - // 49 was SHA512 - // 50 was SplitPart - // StartsWith = 51; - // 52 was Strpos - // 53 was Substr - // ToHex = 54; - // 55 was ToTimestamp - // 56 was ToTimestampMillis - // 57 was ToTimestampMicros - // 58 was ToTimestampSeconds - // 59 was Now - // 60 was Translate - // Trim = 61; - // Upper = 62; - // 63 was Coalesce - // 64 was Power - // 65 was StructFun - // 66 was FromUnixtime - // 67 Atan2 - // 68 was DateBin - // 69 was ArrowTypeof - // 70 was CurrentDate - // 71 was CurrentTime - // 72 was Uuid - // 73 was Cbrt - // 74 Acosh - // 75 was Asinh - // 76 was Atanh - // 77 was Sinh - // 78 was Cosh - // Tanh = 79 - // 80 was Pi - // 81 was Degrees - // 82 was Radians - // 83 was Factorial - // 84 was Lcm - // 85 was Gcd - // 86 was ArrayAppend - // 87 was ArrayConcat - // 88 was ArrayDims - // 89 was ArrayRepeat - // 90 was ArrayLength - // 91 was ArrayNdims - // 92 was ArrayPosition - // 93 was ArrayPositions - // 94 was ArrayPrepend - // 95 was ArrayRemove - // 96 was ArrayReplace - // 97 was ArrayToString - // 98 was Cardinality - // 99 was ArrayElement - // 100 was ArraySlice - // 103 was Cot - // 104 was ArrayHas - // 105 was ArrayHasAny - // 106 was ArrayHasAll - // 107 was ArrayRemoveN - // 108 was ArrayReplaceN - // 109 was ArrayRemoveAll - // 110 was ArrayReplaceAll - // 111 was Nanvl - // 112 was Flatten - // 113 was IsNan - // 114 was Iszero - // 115 was ArrayEmpty - // 116 was ArrayPopBack - // 117 was StringToArray - // 118 was ToTimestampNanos - // 119 was ArrayIntersect - // 120 was ArrayUnion - // 121 was OverLay - // 122 is Range - // 123 is ArrayExcept - // 124 was ArrayPopFront - // 125 was Levenshtein - // 126 was SubstrIndex - // 127 was FindInSet - // 128 was ArraySort - // 129 was ArrayDistinct - // 130 was ArrayResize - // 131 was EndsWith - // 132 was InStr - // 133 was MakeDate - // 134 was ArrayReverse - // 135 is RegexpLike - // 136 was ToChar - // 137 was ToDate - // 138 was ToUnixtime -} - -message ScalarFunctionNode { - ScalarFunction fun = 1; - repeated LogicalExprNode args = 2; -} - enum AggregateFunction { MIN = 0; MAX = 1; @@ -1458,7 +1310,6 @@ message PhysicalExprNode { PhysicalSortExprNode sort = 10; PhysicalNegativeNode negative = 11; PhysicalInListNode in_list = 12; - PhysicalScalarFunctionNode scalar_function = 13; PhysicalTryCastNode try_cast = 14; // window expressions @@ -1559,13 +1410,6 @@ message PhysicalCaseNode { PhysicalExprNode else_expr = 3; } -message PhysicalScalarFunctionNode { - string name = 1; - ScalarFunction fun = 2; - repeated PhysicalExprNode args = 3; - ArrowType return_type = 4; -} - message PhysicalTryCastNode { PhysicalExprNode expr = 1; ArrowType arrow_type = 2; diff --git a/datafusion/proto/src/generated/pbjson.rs b/datafusion/proto/src/generated/pbjson.rs index 29724fa9cf667..0fb6f4623745c 100644 --- a/datafusion/proto/src/generated/pbjson.rs +++ b/datafusion/proto/src/generated/pbjson.rs @@ -13809,9 +13809,6 @@ impl serde::Serialize for LogicalExprNode { logical_expr_node::ExprType::Wildcard(v) => { struct_ser.serialize_field("wildcard", v)?; } - logical_expr_node::ExprType::ScalarFunction(v) => { - struct_ser.serialize_field("scalarFunction", v)?; - } logical_expr_node::ExprType::TryCast(v) => { struct_ser.serialize_field("tryCast", v)?; } @@ -13903,8 +13900,6 @@ impl<'de> serde::Deserialize<'de> for LogicalExprNode { "in_list", "inList", "wildcard", - "scalar_function", - "scalarFunction", "try_cast", "tryCast", "window_expr", @@ -13956,7 +13951,6 @@ impl<'de> serde::Deserialize<'de> for LogicalExprNode { Negative, InList, Wildcard, - ScalarFunction, TryCast, WindowExpr, AggregateUdfExpr, @@ -14012,7 +14006,6 @@ impl<'de> serde::Deserialize<'de> for LogicalExprNode { "negative" => Ok(GeneratedField::Negative), "inList" | "in_list" => Ok(GeneratedField::InList), "wildcard" => Ok(GeneratedField::Wildcard), - "scalarFunction" | "scalar_function" => Ok(GeneratedField::ScalarFunction), "tryCast" | "try_cast" => Ok(GeneratedField::TryCast), "windowExpr" | "window_expr" => Ok(GeneratedField::WindowExpr), "aggregateUdfExpr" | "aggregate_udf_expr" => Ok(GeneratedField::AggregateUdfExpr), @@ -14157,13 +14150,6 @@ impl<'de> serde::Deserialize<'de> for LogicalExprNode { return Err(serde::de::Error::duplicate_field("wildcard")); } expr_type__ = map_.next_value::<::std::option::Option<_>>()?.map(logical_expr_node::ExprType::Wildcard) -; - } - GeneratedField::ScalarFunction => { - if expr_type__.is_some() { - return Err(serde::de::Error::duplicate_field("scalarFunction")); - } - expr_type__ = map_.next_value::<::std::option::Option<_>>()?.map(logical_expr_node::ExprType::ScalarFunction) ; } GeneratedField::TryCast => { @@ -18526,9 +18512,6 @@ impl serde::Serialize for PhysicalExprNode { physical_expr_node::ExprType::InList(v) => { struct_ser.serialize_field("inList", v)?; } - physical_expr_node::ExprType::ScalarFunction(v) => { - struct_ser.serialize_field("scalarFunction", v)?; - } physical_expr_node::ExprType::TryCast(v) => { struct_ser.serialize_field("tryCast", v)?; } @@ -18572,8 +18555,6 @@ impl<'de> serde::Deserialize<'de> for PhysicalExprNode { "negative", "in_list", "inList", - "scalar_function", - "scalarFunction", "try_cast", "tryCast", "window_expr", @@ -18598,7 +18579,6 @@ impl<'de> serde::Deserialize<'de> for PhysicalExprNode { Sort, Negative, InList, - ScalarFunction, TryCast, WindowExpr, ScalarUdf, @@ -18636,7 +18616,6 @@ impl<'de> serde::Deserialize<'de> for PhysicalExprNode { "sort" => Ok(GeneratedField::Sort), "negative" => Ok(GeneratedField::Negative), "inList" | "in_list" => Ok(GeneratedField::InList), - "scalarFunction" | "scalar_function" => Ok(GeneratedField::ScalarFunction), "tryCast" | "try_cast" => Ok(GeneratedField::TryCast), "windowExpr" | "window_expr" => Ok(GeneratedField::WindowExpr), "scalarUdf" | "scalar_udf" => Ok(GeneratedField::ScalarUdf), @@ -18745,13 +18724,6 @@ impl<'de> serde::Deserialize<'de> for PhysicalExprNode { return Err(serde::de::Error::duplicate_field("inList")); } expr_type__ = map_.next_value::<::std::option::Option<_>>()?.map(physical_expr_node::ExprType::InList) -; - } - GeneratedField::ScalarFunction => { - if expr_type__.is_some() { - return Err(serde::de::Error::duplicate_field("scalarFunction")); - } - expr_type__ = map_.next_value::<::std::option::Option<_>>()?.map(physical_expr_node::ExprType::ScalarFunction) ; } GeneratedField::TryCast => { @@ -20110,151 +20082,6 @@ impl<'de> serde::Deserialize<'de> for PhysicalPlanNode { deserializer.deserialize_struct("datafusion.PhysicalPlanNode", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for PhysicalScalarFunctionNode { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.name.is_empty() { - len += 1; - } - if self.fun != 0 { - len += 1; - } - if !self.args.is_empty() { - len += 1; - } - if self.return_type.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("datafusion.PhysicalScalarFunctionNode", len)?; - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; - } - if self.fun != 0 { - let v = ScalarFunction::try_from(self.fun) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.fun)))?; - struct_ser.serialize_field("fun", &v)?; - } - if !self.args.is_empty() { - struct_ser.serialize_field("args", &self.args)?; - } - if let Some(v) = self.return_type.as_ref() { - struct_ser.serialize_field("returnType", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PhysicalScalarFunctionNode { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - "fun", - "args", - "return_type", - "returnType", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - Fun, - Args, - ReturnType, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - "fun" => Ok(GeneratedField::Fun), - "args" => Ok(GeneratedField::Args), - "returnType" | "return_type" => Ok(GeneratedField::ReturnType), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PhysicalScalarFunctionNode; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct datafusion.PhysicalScalarFunctionNode") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - let mut fun__ = None; - let mut args__ = None; - let mut return_type__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::Fun => { - if fun__.is_some() { - return Err(serde::de::Error::duplicate_field("fun")); - } - fun__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Args => { - if args__.is_some() { - return Err(serde::de::Error::duplicate_field("args")); - } - args__ = Some(map_.next_value()?); - } - GeneratedField::ReturnType => { - if return_type__.is_some() { - return Err(serde::de::Error::duplicate_field("returnType")); - } - return_type__ = map_.next_value()?; - } - } - } - Ok(PhysicalScalarFunctionNode { - name: name__.unwrap_or_default(), - fun: fun__.unwrap_or_default(), - args: args__.unwrap_or_default(), - return_type: return_type__, - }) - } - } - deserializer.deserialize_struct("datafusion.PhysicalScalarFunctionNode", FIELDS, GeneratedVisitor) - } -} impl serde::Serialize for PhysicalScalarUdfNode { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -22784,184 +22611,6 @@ impl<'de> serde::Deserialize<'de> for ScalarFixedSizeBinary { deserializer.deserialize_struct("datafusion.ScalarFixedSizeBinary", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ScalarFunction { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unknown => "unknown", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for ScalarFunction { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "unknown", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ScalarFunction; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> std::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "unknown" => Ok(ScalarFunction::Unknown), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for ScalarFunctionNode { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.fun != 0 { - len += 1; - } - if !self.args.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("datafusion.ScalarFunctionNode", len)?; - if self.fun != 0 { - let v = ScalarFunction::try_from(self.fun) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.fun)))?; - struct_ser.serialize_field("fun", &v)?; - } - if !self.args.is_empty() { - struct_ser.serialize_field("args", &self.args)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ScalarFunctionNode { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "fun", - "args", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Fun, - Args, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "fun" => Ok(GeneratedField::Fun), - "args" => Ok(GeneratedField::Args), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ScalarFunctionNode; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct datafusion.ScalarFunctionNode") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fun__ = None; - let mut args__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Fun => { - if fun__.is_some() { - return Err(serde::de::Error::duplicate_field("fun")); - } - fun__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Args => { - if args__.is_some() { - return Err(serde::de::Error::duplicate_field("args")); - } - args__ = Some(map_.next_value()?); - } - } - } - Ok(ScalarFunctionNode { - fun: fun__.unwrap_or_default(), - args: args__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("datafusion.ScalarFunctionNode", FIELDS, GeneratedVisitor) - } -} impl serde::Serialize for ScalarNestedValue { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/datafusion/proto/src/generated/prost.rs b/datafusion/proto/src/generated/prost.rs index 400a7bf75765b..d0210eb7cfd38 100644 --- a/datafusion/proto/src/generated/prost.rs +++ b/datafusion/proto/src/generated/prost.rs @@ -572,7 +572,7 @@ pub struct SubqueryAliasNode { pub struct LogicalExprNode { #[prost( oneof = "logical_expr_node::ExprType", - tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35" + tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35" )] pub expr_type: ::core::option::Option, } @@ -616,8 +616,6 @@ pub mod logical_expr_node { InList(::prost::alloc::boxed::Box), #[prost(message, tag = "15")] Wildcard(super::Wildcard), - #[prost(message, tag = "16")] - ScalarFunction(super::ScalarFunctionNode), #[prost(message, tag = "17")] TryCast(::prost::alloc::boxed::Box), /// window expressions @@ -841,14 +839,6 @@ pub struct InListNode { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ScalarFunctionNode { - #[prost(enumeration = "ScalarFunction", tag = "1")] - pub fun: i32, - #[prost(message, repeated, tag = "2")] - pub args: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] pub struct AggregateExprNode { #[prost(enumeration = "AggregateFunction", tag = "1")] pub aggr_function: i32, @@ -2060,7 +2050,7 @@ pub struct PhysicalExtensionNode { pub struct PhysicalExprNode { #[prost( oneof = "physical_expr_node::ExprType", - tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18" + tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18" )] pub expr_type: ::core::option::Option, } @@ -2097,8 +2087,6 @@ pub mod physical_expr_node { Negative(::prost::alloc::boxed::Box), #[prost(message, tag = "12")] InList(::prost::alloc::boxed::Box), - #[prost(message, tag = "13")] - ScalarFunction(super::PhysicalScalarFunctionNode), #[prost(message, tag = "14")] TryCast(::prost::alloc::boxed::Box), /// window expressions @@ -2275,18 +2263,6 @@ pub struct PhysicalCaseNode { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct PhysicalScalarFunctionNode { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(enumeration = "ScalarFunction", tag = "2")] - pub fun: i32, - #[prost(message, repeated, tag = "3")] - pub args: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub return_type: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] pub struct PhysicalTryCastNode { #[prost(message, optional, boxed, tag = "1")] pub expr: ::core::option::Option<::prost::alloc::boxed::Box>, @@ -2838,168 +2814,6 @@ impl JoinConstraint { } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -pub enum ScalarFunction { - /// 0 was Abs before - /// The first enum value must be zero for open enums - /// - /// 1 was Acos - /// 2 was Asin - /// 3 was Atan - /// 4 was Ascii - /// 5 was Ceil - /// 6 was Cos - /// 7 was Digest - /// 8 was Exp - /// 9 was Floor - /// 10 was Ln - /// 11 was Log - /// 12 was Log10 - /// 13 was Log2 - /// 14 was Round - /// 15 was Signum - /// 16 was Sin - /// 17 was Sqrt - /// Tan = 18; - /// 19 was Trunc - /// 20 was Array - /// RegexpMatch = 21; - /// 22 was BitLength - /// 23 was Btrim - /// 24 was CharacterLength - /// 25 was Chr - /// 26 was Concat - /// 27 was ConcatWithSeparator - /// 28 was DatePart - /// 29 was DateTrunc - /// 30 was InitCap - /// 31 was Left - /// 32 was Lpad - /// 33 was Lower - /// 34 was Ltrim - /// 35 was MD5 - /// 36 was NullIf - /// 37 was OctetLength - /// 38 was Random - /// 39 was RegexpReplace - /// 40 was Repeat - /// 41 was Replace - /// 42 was Reverse - /// 43 was Right - /// 44 was Rpad - /// 45 was Rtrim - /// 46 was SHA224 - /// 47 was SHA256 - /// 48 was SHA384 - /// 49 was SHA512 - /// 50 was SplitPart - /// StartsWith = 51; - /// 52 was Strpos - /// 53 was Substr - /// ToHex = 54; - /// 55 was ToTimestamp - /// 56 was ToTimestampMillis - /// 57 was ToTimestampMicros - /// 58 was ToTimestampSeconds - /// 59 was Now - /// 60 was Translate - /// Trim = 61; - /// Upper = 62; - /// 63 was Coalesce - /// 64 was Power - /// 65 was StructFun - /// 66 was FromUnixtime - /// 67 Atan2 - /// 68 was DateBin - /// 69 was ArrowTypeof - /// 70 was CurrentDate - /// 71 was CurrentTime - /// 72 was Uuid - /// 73 was Cbrt - /// 74 Acosh - /// 75 was Asinh - /// 76 was Atanh - /// 77 was Sinh - /// 78 was Cosh - /// Tanh = 79 - /// 80 was Pi - /// 81 was Degrees - /// 82 was Radians - /// 83 was Factorial - /// 84 was Lcm - /// 85 was Gcd - /// 86 was ArrayAppend - /// 87 was ArrayConcat - /// 88 was ArrayDims - /// 89 was ArrayRepeat - /// 90 was ArrayLength - /// 91 was ArrayNdims - /// 92 was ArrayPosition - /// 93 was ArrayPositions - /// 94 was ArrayPrepend - /// 95 was ArrayRemove - /// 96 was ArrayReplace - /// 97 was ArrayToString - /// 98 was Cardinality - /// 99 was ArrayElement - /// 100 was ArraySlice - /// 103 was Cot - /// 104 was ArrayHas - /// 105 was ArrayHasAny - /// 106 was ArrayHasAll - /// 107 was ArrayRemoveN - /// 108 was ArrayReplaceN - /// 109 was ArrayRemoveAll - /// 110 was ArrayReplaceAll - /// 111 was Nanvl - /// 112 was Flatten - /// 113 was IsNan - /// 114 was Iszero - /// 115 was ArrayEmpty - /// 116 was ArrayPopBack - /// 117 was StringToArray - /// 118 was ToTimestampNanos - /// 119 was ArrayIntersect - /// 120 was ArrayUnion - /// 121 was OverLay - /// 122 is Range - /// 123 is ArrayExcept - /// 124 was ArrayPopFront - /// 125 was Levenshtein - /// 126 was SubstrIndex - /// 127 was FindInSet - /// 128 was ArraySort - /// 129 was ArrayDistinct - /// 130 was ArrayResize - /// 131 was EndsWith - /// 132 was InStr - /// 133 was MakeDate - /// 134 was ArrayReverse - /// 135 is RegexpLike - /// 136 was ToChar - /// 137 was ToDate - /// 138 was ToUnixtime - Unknown = 0, -} -impl ScalarFunction { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ScalarFunction::Unknown => "unknown", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "unknown" => Some(Self::Unknown), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] pub enum AggregateFunction { Min = 0, Max = 1, diff --git a/datafusion/proto/src/logical_plan/from_proto.rs b/datafusion/proto/src/logical_plan/from_proto.rs index c0898db6f6719..83b232da9d21c 100644 --- a/datafusion/proto/src/logical_plan/from_proto.rs +++ b/datafusion/proto/src/logical_plan/from_proto.rs @@ -852,7 +852,7 @@ pub fn parse_expr( registry: &dyn FunctionRegistry, codec: &dyn LogicalExtensionCodec, ) -> Result { - use protobuf::{logical_expr_node::ExprType, window_expr_node, ScalarFunction}; + use protobuf::{logical_expr_node::ExprType, window_expr_node}; let expr_type = proto .expr_type @@ -1264,14 +1264,6 @@ pub fn parse_expr( Some(qualifier.clone()) }, }), - ExprType::ScalarFunction(expr) => { - let scalar_function = protobuf::ScalarFunction::try_from(expr.fun) - .map_err(|_| Error::unknown("ScalarFunction", expr.fun))?; - - match scalar_function { - ScalarFunction::Unknown => Err(proto_error("Unknown scalar function")), - } - } ExprType::ScalarUdfExpr(protobuf::ScalarUdfExprNode { fun_name, args, diff --git a/datafusion/proto/src/physical_plan/from_proto.rs b/datafusion/proto/src/physical_plan/from_proto.rs index 12a3288a76bb4..4b8a480623810 100644 --- a/datafusion/proto/src/physical_plan/from_proto.rs +++ b/datafusion/proto/src/physical_plan/from_proto.rs @@ -338,12 +338,6 @@ pub fn parse_physical_expr( )?, convert_required!(e.arrow_type)?, )), - ExprType::ScalarFunction(e) => { - return Err(proto_error(format!( - "Received an unknown scalar function: {}", - e.fun, - ))); - } ExprType::ScalarUdf(e) => { let udf = match &e.fun_definition { Some(buf) => codec.try_decode_udf(&e.name, buf)?, From 06895157e7f985fc4d9b0b6298c07d92abb4cc07 Mon Sep 17 00:00:00 2001 From: Phillip LeBlanc Date: Wed, 24 Apr 2024 05:57:32 +0900 Subject: [PATCH 3/5] Allow expr_to_sql unparsing with no quotes (#10198) * Allow expr_to_sql unparsing with no quotes * Add test --- datafusion/sql/src/unparser/dialect.rs | 2 +- datafusion/sql/src/unparser/expr.rs | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/datafusion/sql/src/unparser/dialect.rs b/datafusion/sql/src/unparser/dialect.rs index 3af33ad0afda9..ccbd388fc4b70 100644 --- a/datafusion/sql/src/unparser/dialect.rs +++ b/datafusion/sql/src/unparser/dialect.rs @@ -26,7 +26,7 @@ pub struct DefaultDialect {} impl Dialect for DefaultDialect { fn identifier_quote_style(&self) -> Option { - None + Some('"') } } diff --git a/datafusion/sql/src/unparser/expr.rs b/datafusion/sql/src/unparser/expr.rs index b99cfe11f0630..d091fbe14dbd5 100644 --- a/datafusion/sql/src/unparser/expr.rs +++ b/datafusion/sql/src/unparser/expr.rs @@ -358,7 +358,7 @@ impl Unparser<'_> { pub(super) fn new_ident(&self, str: String) -> ast::Ident { ast::Ident { value: str, - quote_style: Some(self.dialect.identifier_quote_style().unwrap_or('"')), + quote_style: self.dialect.identifier_quote_style(), } } @@ -965,4 +965,20 @@ mod tests { Ok(()) } + + #[test] + fn custom_dialect_none() -> Result<()> { + let dialect = CustomDialect::new(None); + let unparser = Unparser::new(&dialect); + + let expr = col("a").gt(lit(4)); + let ast = unparser.expr_to_sql(&expr)?; + + let actual = format!("{}", ast); + + let expected = r#"(a > 4)"#; + assert_eq!(actual, expected); + + Ok(()) + } } From 65ecfda84f7a105412bbf4040885a1b1774668d1 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Tue, 23 Apr 2024 22:21:48 -0400 Subject: [PATCH 4/5] Minor: Avoid a clone in ArrayFunctionRewriter (#10204) --- datafusion/functions-array/src/rewrite.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/datafusion/functions-array/src/rewrite.rs b/datafusion/functions-array/src/rewrite.rs index d231dce4cb68c..32d15b5563a56 100644 --- a/datafusion/functions-array/src/rewrite.rs +++ b/datafusion/functions-array/src/rewrite.rs @@ -152,9 +152,8 @@ impl FunctionRewrite for ArrayFunctionRewriter { expr, field: GetFieldAccess::NamedStructField { name }, }) => { - let expr = *expr.clone(); let name = Expr::Literal(name); - Transformed::yes(get_field(expr, name.clone())) + Transformed::yes(get_field(*expr, name)) } // expr[idx] ==> array_element(expr, idx) From fe268bcab9e1ff93bf0f9c8ee72a252d0440b614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?x=C2=B3u=C2=B3?= Date: Wed, 24 Apr 2024 11:08:44 +0800 Subject: [PATCH 5/5] Move coalesce function from math to core (#10201) * Move coalesce function from math to core Signed-off-by: xxxuuu * Make `cargo doc` happy Signed-off-by: xxxuuu --------- Signed-off-by: xxxuuu --- datafusion/functions/src/{math => core}/coalesce.rs | 4 ++-- datafusion/functions/src/core/mod.rs | 5 ++++- datafusion/functions/src/math/mod.rs | 8 -------- 3 files changed, 6 insertions(+), 11 deletions(-) rename datafusion/functions/src/{math => core}/coalesce.rs (98%) diff --git a/datafusion/functions/src/math/coalesce.rs b/datafusion/functions/src/core/coalesce.rs similarity index 98% rename from datafusion/functions/src/math/coalesce.rs rename to datafusion/functions/src/core/coalesce.rs index cc4a921c75ef7..76f2a3ed741b4 100644 --- a/datafusion/functions/src/math/coalesce.rs +++ b/datafusion/functions/src/core/coalesce.rs @@ -132,11 +132,11 @@ mod test { use datafusion_expr::ScalarUDFImpl; - use crate::math; + use crate::core; #[test] fn test_coalesce_return_types() { - let coalesce = math::coalesce::CoalesceFunc::new(); + let coalesce = core::coalesce::CoalesceFunc::new(); let return_type = coalesce .return_type(&[DataType::Date32, DataType::Date32]) .unwrap(); diff --git a/datafusion/functions/src/core/mod.rs b/datafusion/functions/src/core/mod.rs index 0f6920ccffa94..753134bdfdc21 100644 --- a/datafusion/functions/src/core/mod.rs +++ b/datafusion/functions/src/core/mod.rs @@ -19,6 +19,7 @@ pub mod arrow_cast; pub mod arrowtypeof; +pub mod coalesce; pub mod getfield; pub mod named_struct; pub mod nullif; @@ -35,6 +36,7 @@ make_udf_function!(arrowtypeof::ArrowTypeOfFunc, ARROWTYPEOF, arrow_typeof); make_udf_function!(r#struct::StructFunc, STRUCT, r#struct); make_udf_function!(named_struct::NamedStructFunc, NAMED_STRUCT, named_struct); make_udf_function!(getfield::GetFieldFunc, GET_FIELD, get_field); +make_udf_function!(coalesce::CoalesceFunc, COALESCE, coalesce); // Export the functions out of this package, both as expr_fn as well as a list of functions export_functions!( @@ -45,5 +47,6 @@ export_functions!( (arrow_typeof, arg_1, "Returns the Arrow type of the input expression."), (r#struct, args, "Returns a struct with the given arguments"), (named_struct, args, "Returns a struct with the given names and arguments pairs"), - (get_field, arg_1 arg_2, "Returns the value of the field with the given name from the struct") + (get_field, arg_1 arg_2, "Returns the value of the field with the given name from the struct"), + (coalesce, args, "Returns `coalesce(args...)`, which evaluates to the value of the first expr which is not NULL") ); diff --git a/datafusion/functions/src/math/mod.rs b/datafusion/functions/src/math/mod.rs index 1d9e5d94a90d0..b6e8d26b64607 100644 --- a/datafusion/functions/src/math/mod.rs +++ b/datafusion/functions/src/math/mod.rs @@ -21,7 +21,6 @@ use datafusion_expr::ScalarUDF; use std::sync::Arc; pub mod abs; -pub mod coalesce; pub mod cot; pub mod factorial; pub mod gcd; @@ -47,7 +46,6 @@ make_math_unary_udf!(AtanhFunc, ATANH, atanh, atanh, Some(vec![Some(true)])); make_math_binary_udf!(Atan2, ATAN2, atan2, atan2, Some(vec![Some(true)])); make_math_unary_udf!(CbrtFunc, CBRT, cbrt, cbrt, None); make_math_unary_udf!(CeilFunc, CEIL, ceil, ceil, Some(vec![Some(true)])); -make_udf_function!(coalesce::CoalesceFunc, COALESCE, coalesce); make_math_unary_udf!(CosFunc, COS, cos, cos, None); make_math_unary_udf!(CoshFunc, COSH, cosh, cosh, None); make_udf_function!(cot::CotFunc, COT, cot); @@ -130,11 +128,6 @@ pub mod expr_fn { super::ceil().call(vec![num]) } - #[doc = "returns `coalesce(args...)`, which evaluates to the value of the first [Expr] which is not NULL"] - pub fn coalesce(args: Vec) -> Expr { - super::coalesce().call(args) - } - #[doc = "cosine"] pub fn cos(num: Expr) -> Expr { super::cos().call(vec![num]) @@ -289,7 +282,6 @@ pub fn functions() -> Vec> { atanh(), cbrt(), ceil(), - coalesce(), cos(), cosh(), cot(),