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/08/12 19:21:48 UTC
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #25419:
[SPARK-28698][SQL] Support user-specified output schema in `to_avro`
dongjoon-hyun commented on a change in pull request #25419: [SPARK-28698][SQL] Support user-specified output schema in `to_avro`
URL: https://github.com/apache/spark/pull/25419#discussion_r313087678
##########
File path: external/avro/src/main/scala/org/apache/spark/sql/avro/CatalystDataToAvro.scala
##########
@@ -19,19 +19,24 @@ package org.apache.spark.sql.avro
import java.io.ByteArrayOutputStream
+import org.apache.avro.Schema
import org.apache.avro.generic.GenericDatumWriter
import org.apache.avro.io.{BinaryEncoder, EncoderFactory}
import org.apache.spark.sql.catalyst.expressions.{Expression, UnaryExpression}
import org.apache.spark.sql.catalyst.expressions.codegen.{CodegenContext, ExprCode}
import org.apache.spark.sql.types.{BinaryType, DataType}
-case class CatalystDataToAvro(child: Expression) extends UnaryExpression {
+case class CatalystDataToAvro(
+ child: Expression,
+ jsonFormatSchema: Option[String]) extends UnaryExpression {
Review comment:
Can we have a default value `None`?
```scala
- jsonFormatSchema: Option[String]) extends UnaryExpression {
+ jsonFormatSchema: Option[String] = None) extends UnaryExpression {
```
----------------------------------------------------------------
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