You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "hvanhovell (via GitHub)" <gi...@apache.org> on 2023/08/16 01:47:13 UTC

[GitHub] [spark] hvanhovell commented on pull request #41928: [SPARK-44475][SQL][CONNECT] Relocate DataType and Parser to sql/api

hvanhovell commented on PR #41928:
URL: https://github.com/apache/spark/pull/41928#issuecomment-1679847802

   @JackBuggins while `StructType` is definitely stable & public API, the `toAttributes` methods was not. It was clearly marked as `protected[sql]` and it returned a sequence of an internal catalyst type (`Attribute`). We can always change those methods.
   
   There is no real way to bring back this particular method. We can however provide an implicit conversion that will make life a bit easier, e.g.:
   ```scala
   implicit class RichStructType(val schema: StructType) extends AnyVal {
     def toAttributes: Seq[Attribute] = DataTypeUtils.toAttributes(schema)
   }
   
   ```
   
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org