Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[query] Fix NullPointerException in Avro import #14258

Merged
merged 1 commit into from Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions hail/src/main/scala/is/hail/io/avro/AvroTableReader.scala
@@ -1,6 +1,6 @@
package is.hail.io.avro

import is.hail.backend.ExecuteContext
import is.hail.backend.{ExecuteContext, HailStateManager}
import is.hail.expr.ir._
import is.hail.expr.ir.lowering.{LowererUnsupportedOperation, TableStage, TableStageDependency}
import is.hail.rvd.RVDPartitioner
Expand All @@ -17,7 +17,7 @@ class AvroTableReader(
unsafeOptions: Option[UnsafeAvroTableReaderOptions] = None,
) extends TableReaderWithExtraUID {

private val partitioner: RVDPartitioner =
private def partitioner(stateManager: HailStateManager): RVDPartitioner =
unsafeOptions.map { case UnsafeAvroTableReaderOptions(key, intervals, _) =>
require(
intervals.length == paths.length,
Expand All @@ -27,12 +27,12 @@ class AvroTableReader(
)} and ${intervals.length} ${plural(intervals.length, "interval")}",
)
RVDPartitioner.generate(
null,
stateManager,
partitionReader.fullRowType.typeAfterSelectNames(key),
intervals,
)
}.getOrElse {
RVDPartitioner.unkeyed(null, paths.length)
RVDPartitioner.unkeyed(stateManager, paths.length)
}

def pathsUsed: Seq[String] = paths
Expand Down Expand Up @@ -75,7 +75,7 @@ class AvroTableReader(
}
TableStage(
globals,
partitioner,
partitioner(ctx.stateManager),
TableStageDependency.none,
contexts,
ctx => ReadPartition(ctx, requestedType.rowType, partitionReader),
Expand Down