File tree Expand file tree Collapse file tree
main/scala/org/apache/spark/sql/avro
test/scala/org/apache/spark/sql/avro Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .sql
1919
20- import org .apache .avro .Schema
21-
2220import org .apache .spark .annotation .Experimental
2321
2422package object avro {
25- /**
26- * Adds a method, `avro`, to DataFrameWriter that allows you to write avro files using
27- * the DataFileWriter
28- */
29- implicit class AvroDataFrameWriter [T ](writer : DataFrameWriter [T ]) {
30- def avro : String => Unit = writer.format(" avro" ).save
31- }
32-
33- /**
34- * Adds a method, `avro`, to DataFrameReader that allows you to read avro files using
35- * the DataFileReader
36- */
37- implicit class AvroDataFrameReader (reader : DataFrameReader ) {
38- def avro : String => DataFrame = reader.format(" avro" ).load
39-
40- @ scala.annotation.varargs
41- def avro (sources : String * ): DataFrame = reader.format(" avro" ).load(sources : _* )
42- }
43-
4423 /**
4524 * Converts a binary column of avro format into its corresponding catalyst value. The specified
4625 * schema must match the read data, otherwise the behavior is undefined: it may fail or return
You can’t perform that action at this time.
0 commit comments