Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21829#discussion_r204100563
  
    --- Diff: 
external/avro/src/main/scala/org/apache/spark/sql/avro/AvroOutputWriterFactory.scala
 ---
    @@ -17,21 +17,24 @@
     
     package org.apache.spark.sql.avro
     
    +import org.apache.avro.Schema
     import org.apache.hadoop.mapreduce.TaskAttemptContext
     
     import org.apache.spark.sql.execution.datasources.{OutputWriter, 
OutputWriterFactory}
     import org.apache.spark.sql.types.StructType
     
     private[avro] class AvroOutputWriterFactory(
         schema: StructType,
    -    avroSchema: SerializableSchema) extends OutputWriterFactory {
    +    avroJsonSchema: String) extends OutputWriterFactory {
    +
    +  private lazy val avroSchema = new Schema.Parser().parse(avroJsonSchema)
    --- End diff --
    
    the naming is confusing. We have `schema`, `avroJsonSchema` and 
`avroSchema`. Also add comments about these variables. 


---

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

Reply via email to