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_r365600589
##########
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:
It is interesting that rewriting `supportsColumnar` as:
```scala
override val supportsColumnar: Boolean = {
val factory = readerFactory
require(partitions.forall(factory.supportColumnarReads) ||
!partitions.exists(factory.supportColumnarReads),
"Cannot mix row-based and columnar input partitions.")
partitions.exists(factory.supportColumnarReads)
}
```
does not help too because `DataSourceV2ScanExecBase` is initialized twice
from:
First time:
<img width="851" alt="Screen Shot 2020-01-12 at 20 52 49"
src="https://user-images.githubusercontent.com/1580697/72223223-84000780-357d-11ea-829e-768d37d3fd1f.png">
Second time in `TreeNode.makeCopy`:
<img width="797" alt="Screen Shot 2020-01-12 at 21 06 40"
src="https://user-images.githubusercontent.com/1580697/72223406-73e92780-357f-11ea-9c18-86ec0c84ae2c.png">
Making `supportsColumnar` as `lazy val` doesn't help as well because
`supportsColumnar` is invoked twice for different objects.
----------------------------------------------------------------
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]