MaxGekk commented on a change in pull request #27174: [SPARK-30490][SQL]
Eliminate compiler warnings in Avro datasource
URL: https://github.com/apache/spark/pull/27174#discussion_r365598841
##########
File path:
external/avro/src/main/scala/org/apache/spark/sql/avro/AvroOptions.scala
##########
@@ -78,7 +80,17 @@ class AvroOptions(
parameters
.get(AvroOptions.ignoreExtensionKey)
.map(_.toBoolean)
- .getOrElse(!ignoreFilesWithoutExtension)
+ .map { ignoreExtensionOption =>
+ if (ignoreExtensionOption != !ignoreFilesWithoutExtensionByDefault) {
+ warn(s"The Avro option '${AvroOptions.ignoreExtensionKey}'")
Review comment:
When I moved instantiation of AvroOptions out of buildReader():
<img width="857" alt="Screen Shot 2020-01-12 at 20 14 06"
src="https://user-images.githubusercontent.com/1580697/72222647-359c3a00-3578-11ea-92d3-0802dbb21b3c.png">
The warning is printed always 2 times. It means `AvroPartitionReaderFactory`
is constructed twice.
And both times from
https://github.com/apache/spark/blob/053dd858d38e6107bc71e0aa3a4954291b74f8c8/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2ScanExecBase.scala#L60-L66
which is called:
First time from
<img width="860" alt="Screen Shot 2020-01-12 at 20 32 02"
src="https://user-images.githubusercontent.com/1580697/72222900-a8a6b000-357a-11ea-8792-2e94532199f0.png">
The second time from:
<img width="656" alt="Screen Shot 2020-01-12 at 20 33 36"
src="https://user-images.githubusercontent.com/1580697/72222915-d5f35e00-357a-11ea-9f91-da36c59d62ff.png">
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]