alamb commented on code in PR #23125:
URL: https://github.com/apache/datafusion/pull/23125#discussion_r3460105371


##########
datafusion/datasource/src/rewrite.rs:
##########
@@ -0,0 +1,333 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! Rewrites that lower scan-metadata scalar UDFs into concrete physical
+//! expressions for the specific file being scanned.

Review Comment:
   It might be good to make this more general "rewrite expressions in 
preparation for files being scanned, such as scan-metadata scalar UDFs"



##########
datafusion/datasource/src/rewrite.rs:
##########
@@ -0,0 +1,333 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! Rewrites that lower scan-metadata scalar UDFs into concrete physical
+//! expressions for the specific file being scanned.
+//!
+//! Functions like `file_row_index()` and `input_file_name()` are placeholders

Review Comment:
   I recommend making these actual links so the compiler can make sure the do 
not get stale
   
   ```markdown
   //! Functions like [`file_row_index()`] and [`input_file_name()`] are 
placeholders
   ```



##########
datafusion/datasource/Cargo.toml:
##########
@@ -52,6 +52,7 @@ datafusion-common = { workspace = true, features = 
["object_store"] }
 datafusion-common-runtime = { workspace = true }
 datafusion-execution = { workspace = true }
 datafusion-expr = { workspace = true }
+datafusion-functions = { workspace = true }

Review Comment:
   I think we are trying very hard to avoid this dependency -- the data sources 
should not depend on the pre-packaged functions to keep them as general as 
possible



##########
datafusion/datasource/Cargo.toml:
##########
@@ -52,6 +52,7 @@ datafusion-common = { workspace = true, features = 
["object_store"] }
 datafusion-common-runtime = { workspace = true }
 datafusion-execution = { workspace = true }
 datafusion-expr = { workspace = true }
+datafusion-functions = { workspace = true }

Review Comment:
   Maybe
   
   > datafusion-physical-expr-adatper
   
   That would be a better choice



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to