Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/21762#discussion_r202502724
--- Diff:
external/avro/src/main/scala/org/apache/spark/sql/avro/SchemaConverters.scala
---
@@ -17,34 +17,30 @@
package org.apache.spark.sql.avro
-import java.nio.ByteBuffer
-import java.sql.{Date, Timestamp}
-
import scala.collection.JavaConverters._
import org.apache.avro.{Schema, SchemaBuilder}
import org.apache.avro.Schema.Type._
-import org.apache.avro.SchemaBuilder._
-import org.apache.avro.generic.{GenericData, GenericRecord}
-import org.apache.avro.generic.GenericFixed
-import org.apache.spark.sql.catalyst.expressions.GenericRow
import org.apache.spark.sql.types._
/**
* This object contains method that are used to convert sparkSQL schemas
to avro schemas and vice
* versa.
*/
object SchemaConverters {
-
- class IncompatibleSchemaException(msg: String, ex: Throwable = null)
extends Exception(msg, ex)
-
case class SchemaType(dataType: DataType, nullable: Boolean)
+ /**
+ * This function takes an avro schema and returns a sql schema.
+ * An alias name of toCatalystType.
+ */
+ def toSqlType(avroSchema: Schema): SchemaType =
toCatalystType(avroSchema)
+
/**
* This function takes an avro schema and returns a sql schema.
*/
- def toSqlType(avroSchema: Schema): SchemaType = {
+ def toCatalystType(avroSchema: Schema): SchemaType = {
--- End diff --
maybe we don't need to rename it?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]