You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "LucaCappelletti94 (via GitHub)" <gi...@apache.org> on 2025/09/15 07:58:29 UTC

[PR] Implemented the `From` method for all clear variants in Statement [datafusion-sqlparser-rs]

LucaCappelletti94 opened a new pull request, #2028:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2028

   This PR introduces the `From` trait implementation for all variants of the `Statement` enum which are evidently mapped 1-1. There are a few variants which are not mappable in such a way, and therefore I refrained from creating one From impl for those. I have also added some `.into()` in the code where I have seen clear examples of statements conversion which may benefit from using the `From` trait instead of specifying the Statement variant. There are certainly more such cases, but I thought it was outside of the scope of this PR to replace such things.
   
   This PR closes #2020 


-- 
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] Implemented the `From` method for all clear variants in Statement [datafusion-sqlparser-rs]

Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio commented on code in PR #2028:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2028#discussion_r2352339660


##########
src/ast/statement_from_impls.rs:
##########


Review Comment:
   Yeah I think we can move the impls close to the associated struct definitions, indeed it would be nice to split the large files but I imagine splitting based on e.g. statement types or similar dimension grouping related structs in the same file



-- 
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] Implemented the `From` method for all clear variants in Statement [datafusion-sqlparser-rs]

Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio merged PR #2028:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2028


-- 
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] Implemented the `From` method for all clear variants in Statement [datafusion-sqlparser-rs]

Posted by "LucaCappelletti94 (via GitHub)" <gi...@apache.org>.
LucaCappelletti94 commented on code in PR #2028:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2028#discussion_r2348801228


##########
src/ast/statement_from_impls.rs:
##########


Review Comment:
   I created the different module as the main one is ever more massive, so I thought it best not to add even more to it. That being said, if you prefer avoiding specialised sub modules but keep the monolitic one I can copy everything back into it.



-- 
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] Implemented the `From` method for all clear variants in Statement [datafusion-sqlparser-rs]

Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio commented on code in PR #2028:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2028#discussion_r2348771915


##########
src/ast/statement_from_impls.rs:
##########


Review Comment:
   For this I'm thinking it could make more sense to have the impls right next to the struct definitions (similar to how we do for display impls) vs a dedicated file for it?



-- 
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] Implemented the `From` method for all clear variants in Statement [datafusion-sqlparser-rs]

Posted by "LucaCappelletti94 (via GitHub)" <gi...@apache.org>.
LucaCappelletti94 commented on code in PR #2028:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2028#discussion_r2352347539


##########
src/ast/statement_from_impls.rs:
##########


Review Comment:
   Done in commit [9ef033f](https://github.com/apache/datafusion-sqlparser-rs/pull/2028/commits/9ef033fc349cbfce0b94ae72570b6b7e30c79c72)



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