[SPARK-34311][SQL] PostgresDialect can't treat arrays of some types#31419
[SPARK-34311][SQL] PostgresDialect can't treat arrays of some types#31419sarutak wants to merge 4 commits intoapache:masterfrom
Conversation
|
For reviews: Array of serial is not implemented in PostgreSQL so I didn't care about |
srowen
left a comment
There was a problem hiding this comment.
Seems OK if these new types all have a string representation that's meaningful, and it just helps read more data types.
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Test build #134735 has finished for PR 31419 at commit
|
|
|
||
| conn.prepareStatement("CREATE TABLE st_with_array (c0 uuid, c1 inet, c2 cidr," + | ||
| "c3 json, c4 jsonb, c5 uuid[], c6 inet[], c7 cidr[], c8 json[], c9 jsonb[])") | ||
| "c3 json, c4 jsonb, c5 uuid[], c6 inet[], c7 cidr[], c8 json[], c9 jsonb[], c10 xml[], " + |
There was a problem hiding this comment.
How about adding tests for non-array cases, e.g., col xml and col tsvector?
There was a problem hiding this comment.
I found there are lots of types not tested so far. So I'll open another PR for non-array cases and focus on array cases in this PR.
There was a problem hiding this comment.
Does that mean there are types that aren't supported, but for which we support arrays? did I misunderstand that?
There was a problem hiding this comment.
I mean that some supported non-array types like numeric, varchar, date and etc are not tested.
So, we need to add tests for those types in addition to the types supported by this PR.
|
Does this PR supports all types in PostgreSQL? are there unsupported types? |
I think so except for serial types as I mentioned above. Here is all types in PostgreSQL. |
|
okay, could you copy the statement above into the PR description? |
|
I noticed the previous change didn't cover |
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Test build #134788 has finished for PR 31419 at commit
|
|
retest this please. |
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Test build #134798 has finished for PR 31419 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Test build #135000 has finished for PR 31419 at commit
|
srowen
left a comment
There was a problem hiding this comment.
Just so I'm clear, you're saying things like tsvector are already supported, and now tested, and now tsvector[] is also supported? If not then I'm still wondering why the non-array types can't be supported the same way.
Yes. For non-array types, So, tsvector is already supported. For array types, But, if there is no corresponding mapping definition for an array type, it's mapped to null rather than ArrayType.. |
|
@srowen |
|
No i just wondered if I should see tests for the non-array types here. It is OK if it's in another PR. This seems fine if you're ready to merge. |
maropu
left a comment
There was a problem hiding this comment.
I've checked the test can pass on my local env.
|
Thanks! Merged to master. |
What changes were proposed in this pull request?
This PR fixes the issue that
PostgresDialectcan't treat arrays of some types.Though PostgreSQL supports wide range of types (https://www.postgresql.org/docs/13/datatype.html), the current
PostgresDialectcan't treat arrays of the following types.NOTE: PostgreSQL doesn't implement arrays of serial types so this PR doesn't care about them.
Why are the changes needed?
To provide better support with PostgreSQL.
Does this PR introduce any user-facing change?
Yes. PostgresDialect can handle arrays of types shown above.
How was this patch tested?
New test.