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

[SPARK-46152][SQL] XML: Add DecimalType support in XML schema inference #44069

Closed
wants to merge 2 commits into from

Conversation

sandip-db
Copy link
Contributor

What changes were proposed in this pull request?

Add DecimalType support in XML schema inference

Why are the changes needed?

Add DecimalType support in XML schema inference

Does this PR introduce any user-facing change?

Yes, XML schema inference will infer DecimalType correctly.

How was this patch tested?

Added a new unit test

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Nov 29, 2023
@@ -39,6 +40,8 @@ class XmlInferSchema(options: XmlOptions, caseSensitive: Boolean)
extends Serializable
with Logging {

private val decimalParser = ExprUtils.getDecimalParser(options.locale)
Copy link
Contributor

Choose a reason for hiding this comment

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

a qq - Does this parser function the same as our XSD conversion?

Copy link
Member

Choose a reason for hiding this comment

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

If not, let's make a followup to match.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This parser converts a decimal string to DecimalType. The one in XSDToSchema converts XSD type to DecimalType.

@HyukjinKwon
Copy link
Member

Merged to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants