You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/08/23 11:41:06 UTC

[GitHub] [arrow] jorgecarleitao opened a new pull request #8030: ARROW-9835: [Rust][DataFusion] Removed FunctionMeta and FunctionType

jorgecarleitao opened a new pull request #8030:
URL: https://github.com/apache/arrow/pull/8030


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] alamb commented on a change in pull request #8030: ARROW-9835: [Rust][DataFusion] Removed FunctionMeta and FunctionType

Posted by GitBox <gi...@apache.org>.
alamb commented on a change in pull request #8030:
URL: https://github.com/apache/arrow/pull/8030#discussion_r475225101



##########
File path: rust/datafusion/src/execution/context.rs
##########
@@ -489,15 +489,13 @@ impl SchemaProvider for ExecutionContextState {
         self.datasources.get(name).map(|ds| ds.schema().clone())
     }
 
-    fn get_function_meta(&self, name: &str) -> Option<Arc<FunctionMeta>> {
-        self.scalar_functions.get(name).map(|f| {
-            Arc::new(FunctionMeta::new(
-                name.to_owned(),
-                f.args.clone(),
-                f.return_type.clone(),
-                FunctionType::Scalar,
-            ))
-        })
+    fn get_function_meta(&self, name: &str) -> Option<Arc<ScalarFunction>> {

Review comment:
       Fascinatingly, I have added basically the same signature in https://github.com/apache/arrow/pull/8031. So I feel like we are heading in the same direction

##########
File path: rust/datafusion/src/execution/context.rs
##########
@@ -489,15 +489,13 @@ impl SchemaProvider for ExecutionContextState {
         self.datasources.get(name).map(|ds| ds.schema().clone())
     }
 
-    fn get_function_meta(&self, name: &str) -> Option<Arc<FunctionMeta>> {
-        self.scalar_functions.get(name).map(|f| {
-            Arc::new(FunctionMeta::new(
-                name.to_owned(),
-                f.args.clone(),
-                f.return_type.clone(),
-                FunctionType::Scalar,
-            ))
-        })
+    fn get_function_meta(&self, name: &str) -> Option<Arc<ScalarFunction>> {
+        let fun = self.scalar_functions.get(name);

Review comment:
       I think you can do this in a single line:
   ```
           self.scalar_functions.get(name).and_then(|func| Some(func.clone()))
   ```




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] andygrove closed pull request #8030: ARROW-9835: [Rust][DataFusion] Removed FunctionMeta and FunctionType

Posted by GitBox <gi...@apache.org>.
andygrove closed pull request #8030:
URL: https://github.com/apache/arrow/pull/8030


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] jorgecarleitao commented on a change in pull request #8030: ARROW-9835: [Rust][DataFusion] Removed FunctionMeta and FunctionType

Posted by GitBox <gi...@apache.org>.
jorgecarleitao commented on a change in pull request #8030:
URL: https://github.com/apache/arrow/pull/8030#discussion_r475227407



##########
File path: rust/datafusion/src/execution/context.rs
##########
@@ -489,15 +489,13 @@ impl SchemaProvider for ExecutionContextState {
         self.datasources.get(name).map(|ds| ds.schema().clone())
     }
 
-    fn get_function_meta(&self, name: &str) -> Option<Arc<FunctionMeta>> {
-        self.scalar_functions.get(name).map(|f| {
-            Arc::new(FunctionMeta::new(
-                name.to_owned(),
-                f.args.clone(),
-                f.return_type.clone(),
-                FunctionType::Scalar,
-            ))
-        })
+    fn get_function_meta(&self, name: &str) -> Option<Arc<ScalarFunction>> {
+        let fun = self.scalar_functions.get(name);

Review comment:
       On, nice idiom. Thanks!




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] github-actions[bot] commented on pull request #8030: ARROW-9835: [Rust][DataFusion] Removed FunctionMeta and FunctionType

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #8030:
URL: https://github.com/apache/arrow/pull/8030#issuecomment-678764184


   https://issues.apache.org/jira/browse/ARROW-9835


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org