Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion external/avro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>spark-sql-avro_2.11</artifactId>
<artifactId>spark-avro_2.11</artifactId>
<properties>
<sbt.project.name>avro</sbt.project.name>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private[avro] class AvroFileFormat extends FileFormat with DataSourceRegister {
spark: SparkSession,
options: Map[String, String],
files: Seq[FileStatus]): Option[StructType] = {
val conf = spark.sparkContext.hadoopConfiguration
val conf = spark.sessionState.newHadoopConf()
Copy link
Member

Choose a reason for hiding this comment

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

A good catch!

Copy link
Contributor

Choose a reason for hiding this comment

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

can we add a linter rule for this?

Copy link
Member

Choose a reason for hiding this comment

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

@gengliangwang Please help this?

Copy link
Member Author

@gengliangwang gengliangwang Jul 25, 2018

Choose a reason for hiding this comment

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

Sure, will do it.
Can I make it a simple one, check the appearance of
spark.sparkContext.hadoopConfiguration ?
Otherwise there are too many usage for the sparkContext.hadoopConfiguration

val parsedOptions = new AvroOptions(options, conf)

// Schema evolution is not supported yet. Here we only pick a single random sample file to
Expand Down