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-48186][SQL] Add support for AbstractMapType #46458

Closed
wants to merge 4 commits into from

Conversation

uros-db
Copy link
Contributor

@uros-db uros-db commented May 8, 2024

What changes were proposed in this pull request?

Addition of an abstract MapType (similar to abstract ArrayType in sql internal types) which accepts StringTypeCollated as keyType & valueType. Apart from extending this interface for all Spark functions, this PR also introduces collation awareness for json expression: schema_of_json.

Why are the changes needed?

This is needed in order to enable collation support for functions that use collated maps.

Does this PR introduce any user-facing change?

Yes, users should now be able to use collated strings within arguments for json function: schema_of_json.

How was this patch tested?

E2e sql tests.

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

No.

@github-actions github-actions bot added the SQL label May 8, 2024
@uros-db uros-db changed the title [WIP][SQL] Add support for AbstractMapType [SPARK-48186][SQL] Add support for AbstractMapType May 8, 2024
@dongjoon-hyun
Copy link
Member

Could you resolve the conflict?

@uros-db
Copy link
Contributor Author

uros-db commented May 8, 2024

@dongjoon-hyun resolved, please re-review

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in a4ab82b May 9, 2024
JacobZheng0927 pushed a commit to JacobZheng0927/spark that referenced this pull request May 11, 2024
### What changes were proposed in this pull request?
Addition of an abstract MapType (similar to abstract ArrayType in sql internal types) which accepts `StringTypeCollated` as `keyType` & `valueType`. Apart from extending this interface for all Spark functions, this PR also introduces collation awareness for json expression: schema_of_json.

### Why are the changes needed?
This is needed in order to enable collation support for functions that use collated maps.

### Does this PR introduce _any_ user-facing change?
Yes, users should now be able to use collated strings within arguments for json function: schema_of_json.

### How was this patch tested?
E2e sql tests.

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

Closes apache#46458 from uros-db/abstract-map.

Authored-by: Uros Bojanic <157381213+uros-db@users.noreply.github.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
cloud-fan pushed a commit that referenced this pull request May 22, 2024
…r parameter map to work with collated strings

### What changes were proposed in this pull request?
Following up on the introduction of AbstractMapType (#46458) and changes that introduce collation awareness for RaiseError expression (#46461), this PR should add the appropriate type casting rules for AbstractMapType.

### Why are the changes needed?
Fix the CI failure for the `Support RaiseError misc expression with collation` test when ANSI is off.

### Does this PR introduce _any_ user-facing change?
Yes, type casting is now allowed for map types with collated strings.

### How was this patch tested?
Extended suite `CollationSQLExpressionsANSIOffSuite` with ANSI disabled.

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

Closes #46661 from uros-db/fix-abstract-map.

Authored-by: Uros Bojanic <157381213+uros-db@users.noreply.github.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
a0x8o added a commit to a0x8o/spark that referenced this pull request May 22, 2024
…r parameter map to work with collated strings

### What changes were proposed in this pull request?
Following up on the introduction of AbstractMapType (apache/spark#46458) and changes that introduce collation awareness for RaiseError expression (apache/spark#46461), this PR should add the appropriate type casting rules for AbstractMapType.

### Why are the changes needed?
Fix the CI failure for the `Support RaiseError misc expression with collation` test when ANSI is off.

### Does this PR introduce _any_ user-facing change?
Yes, type casting is now allowed for map types with collated strings.

### How was this patch tested?
Extended suite `CollationSQLExpressionsANSIOffSuite` with ANSI disabled.

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

Closes #46661 from uros-db/fix-abstract-map.

Authored-by: Uros Bojanic <157381213+uros-db@users.noreply.github.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants