Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
265 changes: 0 additions & 265 deletions hail/hail/src/is/hail/types/encoded/EStructOfArrays.scala

This file was deleted.

27 changes: 0 additions & 27 deletions hail/hail/src/is/hail/types/encoded/EType.scala
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,6 @@ object EType extends Logging {
),
required = rinterval.required,
)
case t: TArray
if (ctx.flags.isDefined(
EType.Flags.UseUnstableEncodings
) && t.elementType.isInstanceOf[TBaseStruct] && t.elementType.asInstanceOf[
TBaseStruct
].fields.forall(fld => EStructOfArrays.supportsFieldType(fld.typ))) =>
EStructOfArrays.fromTypeAndRequiredness(t, tcoerce[RIterable](r))
case t: TIterable =>
EArray(
fromTypeAndAnalysis(ctx, t.elementType, tcoerce[RIterable](r).elementType, useVarint),
Expand Down Expand Up @@ -512,26 +505,6 @@ object EType extends Logging {
val nDims = IRParser.int32_literal(it)
IRParser.punctuation(it, "]")
ENDArrayColumnMajor(elementType, nDims, req)
case "EStructOfArrays" =>
IRParser.punctuation(it, "[")
val structReq = it.head match {
case x: PunctuationToken if x.value == "+" =>
IRParser.punctuation(it, "+")
true
case _ => false
}
IRParser.punctuation(it, "{")
val args = IRParser.repsepUntil(
it,
IRParser.struct_field(eTypeParser),
PunctuationToken(","),
PunctuationToken("}"),
)
IRParser.punctuation(it, "}")
IRParser.punctuation(it, "]")
val fields = args.zipWithIndex.map { case ((name, t), i) => EField(name, t, i) }
EStructOfArrays(fields, required = req, structRequired = structReq)

case x => throw new UnsupportedOperationException(s"Couldn't parse $x ${it.toIndexedSeq}")
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

}
Expand Down
51 changes: 0 additions & 51 deletions hail/hail/test/src/is/hail/types/encoded/ETypeSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ class ETypeSuite {
required = true,
),
ENDArrayColumnMajor(EFloat64Required, 3),
EStructOfArrays(
FastSeq(
EField("a", EArray(EInt32Required, true), 0),
EField("b", EArray(EInt32Optional, true), 1),
),
required = true,
structRequired = false,
),
)

@ParameterizedTest
Expand Down Expand Up @@ -326,49 +318,6 @@ class ETypeSuite {
assertNoVarint(EType.fromPythonTypeEncoding(t), t)
}

@Test def testStructOfArrays(implicit ctx: ExecuteContext): Unit = {
val etype =
EStructOfArrays(
FastSeq(
EField("a", EArray(EInt32Required, true), 0),
EField("b", EArray(EFloat32Optional, true), 1),
EField("c", EArray(EBooleanRequired, true), 2),
)
)
val toEncode =
PCanonicalArray(PCanonicalStruct(
false,
"a" -> PInt32Required,
"b" -> PFloat32Optional,
"c" -> PBooleanRequired,
))
val toDecode = toEncode
val data = FastSeq(
RowSeq(1, 2f, true),
null,
RowSeq(3, null, false),
RowSeq(4, 5f, true),
null,
RowSeq(6, 7f, false),
RowSeq(8, null, true),
RowSeq(9, 10f, false),
)

assertEqualEncodeDecode(toEncode, etype, toDecode, data)
}

@Test def testUnstableEncodingsOfContainersOfStructs(implicit ctx: ExecuteContext): Unit =
withUnstableEncodings { implicit ctx =>
val elt = PCanonicalStruct(false, "a" -> PInt32Optional, "b" -> PFloat64Optional)
val cases = ArraySeq[(PType, Annotation)](
PCanonicalArray(elt) -> FastSeq(RowSeq(1, 2.0), null, RowSeq(3, null)),
PCanonicalSet(elt) -> Set(RowSeq(1, 2.0), null, RowSeq(3, null)),
PCanonicalDict(PInt32Optional, PFloat64Optional) -> Map(1 -> 2.0, 3 -> null),
)
for ((pt, a) <- cases)
assertEqualEncodeDecode(pt, EType.defaultFromPType(ctx, pt), pt, a)
}

// Loci of either representation, nested anywhere, decode and store into either representation,
// on the same reference genome or an equal copy of it. The session does not hold the custom
// reference genome: locus types carry their own.
Expand Down
Loading
Loading