Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for converting LargeUtf8/LargeString in try_cast_to #71

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

gengteng
Copy link
Contributor

This PR addresses an issue in the MySQL implementation within the datafusion-table-providers project. In the MySQL implementation, varchar and json types are mapped to DataFusion's LargeUtf8 type, corresponding to the LargeString data type. In the test code of datafusion-table-providers, the try_cast_to function is used to convert the record batch from a query according to the schema used during table creation. However, the previous version only supported String and could not convert record batches from MySQL where json uses LargeString. This PR adds support for LargeString to enable the conversion of such record batches.

Copy link
Collaborator

@phillipleblanc phillipleblanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me, just a couple of minor comments.

datafusion-federation/src/schema_cast/record_convert.rs Outdated Show resolved Hide resolved
datafusion-federation/src/schema_cast/record_convert.rs Outdated Show resolved Hide resolved
@gengteng
Copy link
Contributor Author

@phillipleblanc Thank you for your review and valuable feedback! 😊

I have made the necessary changes based on your suggestions. Please let me know if there's anything else that needs adjustment.

Thanks again for your time and help, and I look forward to the merge! 🙌

@phillipleblanc
Copy link
Collaborator

cc @backkem @hozan23 - I plan to merge this in 24 hours if no other feedback.

@hozan23
Copy link
Collaborator

hozan23 commented Oct 24, 2024

cc @backkem @hozan23 - I plan to merge this in 24 hours if no other feedback.

Looks good to me.

@phillipleblanc phillipleblanc merged commit d4028cb into datafusion-contrib:main Oct 25, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants