waynexia commented on code in PR #8515:
URL: https://github.com/apache/arrow-datafusion/pull/8515#discussion_r1424793919


##########
datafusion/substrait/src/logical_plan/consumer.rs:
##########
@@ -1341,50 +1245,132 @@ fn from_substrait_null(null_type: &Type) -> 
Result<ScalarValue> {
     }
 }
 
-async fn make_datafusion_like(
-    case_insensitive: bool,
-    f: &ScalarFunction,
-    input_schema: &DFSchema,
-    extensions: &HashMap<u32, &String>,
-) -> Result<Arc<Expr>> {
-    let fn_name = if case_insensitive { "ILIKE" } else { "LIKE" };
-    if f.arguments.len() != 3 {
-        return not_impl_err!("Expect three arguments for `{fn_name}` expr");
+/// Build [`Expr`] from its name and required inputs.
+struct BuiltinExprBuilder {
+    expr_name: String,
+}
+
+impl BuiltinExprBuilder {
+    pub fn try_from_name(name: &str) -> Option<Self> {
+        match name {

Review Comment:
   Thanks for reminding me 👍 I added an item to #8149, I would take other 
implementations as a reference on how they handle case sensitivity.



##########
datafusion/substrait/src/logical_plan/consumer.rs:
##########
@@ -1341,50 +1245,132 @@ fn from_substrait_null(null_type: &Type) -> 
Result<ScalarValue> {
     }
 }
 
-async fn make_datafusion_like(
-    case_insensitive: bool,
-    f: &ScalarFunction,
-    input_schema: &DFSchema,
-    extensions: &HashMap<u32, &String>,
-) -> Result<Arc<Expr>> {
-    let fn_name = if case_insensitive { "ILIKE" } else { "LIKE" };
-    if f.arguments.len() != 3 {
-        return not_impl_err!("Expect three arguments for `{fn_name}` expr");
+/// Build [`Expr`] from its name and required inputs.
+struct BuiltinExprBuilder {
+    expr_name: String,
+}
+
+impl BuiltinExprBuilder {
+    pub fn try_from_name(name: &str) -> Option<Self> {
+        match name {

Review Comment:
   Thanks for reminding me 👍 I added an item to #8149, I would take other 
implementations as a reference on how they handle case sensitivity.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to