Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/3794#discussion_r22325585
--- Diff: core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala ---
@@ -203,9 +204,27 @@ class HadoopRDD[K, V](
for (i <- 0 until inputSplits.size) {
array(i) = new HadoopPartition(id, i, inputSplits(i))
}
+ logDebug("Get these partitions took %f s".format((System.nanoTime -
start) / 1e9))
array
}
+ @transient private var thesePartitions_ : Array[Partition] = {
+ try {
+ getThesePartitions()
+ } catch {
+ case e: Exception =>
+ logDebug("Error initializing HadoopRDD's partitions", e)
+ null
--- End diff --
(This comment is kind of moot since I proposed a more general fix in a
top-level comment, but I'll still post it anyways:)
I don't think that logging an exception at debug level then returning
`null` is a good error-handling strategy; this is likely to cause a confusing
NPE somewhere else with no obvious cause since most users won't have
debug-level logging enabled.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]