You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "lewiszlw (via GitHub)" <gi...@apache.org> on 2024/11/18 02:13:18 UTC

[PR] Support custom field metadata in UDF [datafusion]

lewiszlw opened a new pull request, #13458:
URL: https://github.com/apache/datafusion/pull/13458

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
   ## Rationale for this change
   
   In our case, we need put type data in schema metadata for supporting logical type. But there is no good way for the column generated by UDF.
   
   ## What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   ## Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   ## Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->
   


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Support custom field metadata in UDF [datafusion]

Posted by "Omega359 (via GitHub)" <gi...@apache.org>.
Omega359 commented on code in PR #13458:
URL: https://github.com/apache/datafusion/pull/13458#discussion_r1855634897


##########
datafusion/expr/src/udf.rs:
##########
@@ -477,6 +487,15 @@ pub trait ScalarUDFImpl: Debug + Send + Sync {
         true
     }
 
+    /// Returns the field metadata for this function.

Review Comment:
   I think a more detailed explanation would be useful for someone adding a new UDF to know why this method exists and what use case it is trying to solve. Without looking at this PR it's pretty opaque.



-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Support custom field metadata in UDF [datafusion]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13458:
URL: https://github.com/apache/datafusion/pull/13458#issuecomment-2614719631

   Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Support custom field metadata in UDF [datafusion]

Posted by "Omega359 (via GitHub)" <gi...@apache.org>.
Omega359 commented on PR #13458:
URL: https://github.com/apache/datafusion/pull/13458#issuecomment-2496436510

   I think a test would be in order that would showcase why the new metadata method exists and what problem it solves.


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Support custom field metadata in UDF [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #13458:
URL: https://github.com/apache/datafusion/pull/13458#discussion_r1847266643


##########
datafusion/expr/src/udf.rs:
##########
@@ -216,6 +217,15 @@ impl ScalarUDF {
         self.inner.is_nullable(args, schema)
     }
 
+    /// Returns the field metadata for this function.
+    pub fn metadata(

Review Comment:
   This feels similar in usecase to https://github.com/apache/datafusion/pull/13290 -- if we merged https://github.com/apache/datafusion/pull/13290 would that solve your usecase?



-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Support custom field metadata in UDF [datafusion]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #13458: Support custom field metadata in UDF
URL: https://github.com/apache/datafusion/pull/13458


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Support custom field metadata in UDF [datafusion]

Posted by "lewiszlw (via GitHub)" <gi...@apache.org>.
lewiszlw commented on code in PR #13458:
URL: https://github.com/apache/datafusion/pull/13458#discussion_r1847530305


##########
datafusion/expr/src/udf.rs:
##########
@@ -216,6 +217,15 @@ impl ScalarUDF {
         self.inner.is_nullable(args, schema)
     }
 
+    /// Returns the field metadata for this function.
+    pub fn metadata(

Review Comment:
   Looks like not. This pr is for supporting custom metadata when converting scalar function expr to schema field during planing.



-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Support custom field metadata in UDF [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #13458:
URL: https://github.com/apache/datafusion/pull/13458#issuecomment-2504613876

   Marking as draft as I think this PR is no longer waiting on feedback. Please mark it as ready for review when it is ready for another look 


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Support custom field metadata in UDF [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #13458:
URL: https://github.com/apache/datafusion/pull/13458#issuecomment-2499071332

   > I think a test would be in order that would showcase why the new metadata method exists and what problem it solves.
   
   I agree. 


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org