Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address some comments
  • Loading branch information
gengliangwang committed Jul 19, 2018
commit fb8e50f4b31583688aeacfbe753b3cee2469fc31
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import org.apache.spark.sql.types.{BinaryType, DataType}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ExpressionDescription and javadoc?

case class CatalystDataToAvro(child: Expression) extends UnaryExpression with CodegenFallback {

override lazy val dataType: DataType = BinaryType
override def dataType: DataType = BinaryType

@transient private lazy val avroType =
SchemaConverters.toAvroType(child.dataType, child.nullable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class AvroCatalystDataConversionSuite extends SparkFunSuite with ExpressionEvalH
""".stripMargin

// When read float data as double, avro reader fails(trying to read 8 bytes while the data have
// only 4 bytes), `AvroDataToCatalyst` catches the exception and returns null.
// only 4 bytes).
assertFail(data, new Schema.Parser().parse(avroTypeJson))
}

Expand Down