Uh oh!
There was an error while loading. Please reload this page.
[SPARK-28218][SQL] Migrate Avro to File Data Source V2 - #25017
[SPARK-28218][SQL] Migrate Avro to File Data Source V2#25017gengliangwang wants to merge 3 commits into
Conversation
gengliangwang
commented
Jun 30, 2019
This is the last migration for file source V2. It is a relatively simple one. Please help review it. |
SparkQA
commented
Jun 30, 2019
Test build #107051 has finished for PR 25017 at commit
|
dongjoon-hyun
commented
Jul 1, 2019
Thank you for pinging me, @gengliangwang . |
dongjoon-hyun
commented
Jul 3, 2019
Retest this please. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
SparkQA
commented
Jul 3, 2019
Test build #107144 has finished for PR 25017 at commit
|
SparkQA
commented
Jul 4, 2019
Test build #107217 has finished for PR 25017 at commit
|
| job: Job, | ||
| options: Map[String, String], | ||
| dataSchema: StructType): OutputWriterFactory = { | ||
| val parsedOptions = new AvroOptions(options, job.getConfiguration) |
There was a problem hiding this comment.
Previously, this was the following (sharedState.sparkContext.hadoopConfiguration + SQLConf). Is job.getConfiguration enough for Avro?
valparsedOptions=newAvroOptions(options, spark.sessionState.newHadoopConf())There was a problem hiding this comment.
Yes, it is enough. Orc/Parquet also use the configuration from job.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| val parsedOptions = new AvroOptions(options, conf) | ||
| val userProvidedSchema = parsedOptions.schema.map(new Schema.Parser().parse) | ||
| if (parsedOptions.ignoreExtension || partitionedFile.filePath.endsWith(".avro")) { |
There was a problem hiding this comment.
Shall we have the same comment above this line in order not to forget that?
// TODO Removes this check once `FileFormat` gets a general file filtering interface method.// Doing input file filtering is improper because we may generate empty tasks that process no// input files but stress the scheduler. We should probably add a more general input file// filtering mechanism for `FileFormat` data sources. See SPARK-16317.There was a problem hiding this comment.
Actually, there is an option pathGlobFilter for it. I have marked it as deprecated in #24518.
I think we can still support it in 3.0. So I am not sure what to comment here.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| paths: Seq[String], | ||
| userSpecifiedSchema: Option[StructType], | ||
| fallbackFileFormat: Class[_ <: FileFormat]) | ||
| extends FileTable(sparkSession, options, paths, userSpecifiedSchema) with Logging { |
There was a problem hiding this comment.
Let's remove with Logging and line 23.
Uh oh!
There was an error while loading. Please reload this page.
dongjoon-hyun
left a comment
There was a problem hiding this comment.
I left a few comments. Could you update the PR, @gengliangwang ?
Uh oh!
There was an error while loading. Please reload this page.
| import org.apache.spark.sql.avro.{AvroDeserializer, AvroOptions} | ||
| import org.apache.spark.sql.catalyst.InternalRow | ||
| import org.apache.spark.sql.execution.datasources.PartitionedFile | ||
| import org.apache.spark.sql.execution.datasources.v2._ |
There was a problem hiding this comment.
-import org.apache.spark.sql.execution.datasources.v2._
+import org.apache.spark.sql.execution.datasources.v2.{EmptyPartitionReader, FilePartitionReaderFactory, PartitionReaderWithPartitionValues}
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
gengliangwang
commented
Jul 5, 2019
@dongjoon-hyun I have updated the code. Thanks for reviewing this in your vacation! |
SparkQA
commented
Jul 5, 2019
Test build #107263 has finished for PR 25017 at commit
|
dongjoon-hyun
left a comment
There was a problem hiding this comment.
+1, LGTM. Merged to master.
Thank you, @gengliangwang !
What changes were proposed in this pull request?
Migrate Avro to File source V2.
How was this patch tested?
Unit test