You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/04 11:51:09 UTC

[GitHub] [spark] hvanhovell commented on a change in pull request #26013: [SPARK-29347][SQL] Add JSON serialization for external Rows

hvanhovell commented on a change in pull request #26013: [SPARK-29347][SQL] Add JSON serialization for external Rows
URL: https://github.com/apache/spark/pull/26013#discussion_r331463197
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala
 ##########
 @@ -501,4 +513,88 @@ trait Row extends Serializable {
   private def getAnyValAs[T <: AnyVal](i: Int): T =
     if (isNullAt(i)) throw new NullPointerException(s"Value at index $i is null")
     else getAs[T](i)
+
+  /** The compact JSON representation of this row. */
+  def json: String = compact(jsonValue)
 
 Review comment:
   Well you still need the schema. The main reason for not using Jackson generator is that we need to convert back to an internal row and this is super slow.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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