sarutak edited a comment on pull request #31419:
URL: https://github.com/apache/spark/pull/31419#issuecomment-776145646


   > Just so I'm clear, you're saying things like `tsvector` are already 
supported, and now tested, and now `tsvector[]` is also supported?
   
   Yes. `tsvector` is already supported but it's not tested so I opened #31456.
   On the other hand, `tsvector[]` and other array types added in this PR are 
not supported before this PR.
   
   For non-array types, `PostgresDialect` maps JDBC OTHER type to `StringType`. 
https://github.com/apache/spark/blob/2b51843ca41236f8cec29c406ea35ce1088364cf/sql/core/src/main/scala/org/apache/spark/sql/jdbc/PostgresDialect.scala#L41
   
   So, tsvector is already supported.
   
   For array types, `PostgresDialect` maps the JDBC type of elements to a Spark 
SQL type according to the type name.
   If a corresponding Spark SQL type is defined, JDBC ARRAY is mapped to 
`ArrayType`.
   
https://github.com/apache/spark/blob/2b51843ca41236f8cec29c406ea35ce1088364cf/sql/core/src/main/scala/org/apache/spark/sql/jdbc/PostgresDialect.scala#L49.
   But, if there is no corresponding mapping definition for an array type, it's 
mapped to `null` rather than `ArrayType`.
   
https://github.com/apache/spark/blob/2b51843ca41236f8cec29c406ea35ce1088364cf/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala#L197.


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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to