Skip to content

Commit

Permalink
use IR for smol col annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
wang committed Mar 20, 2018
1 parent 5faa2ea commit 3b37894
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main/scala/is/hail/variant/MatrixTable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1583,11 +1583,12 @@ class MatrixTable(val hc: HailContext, val ast: MatrixIR) {

val irs = asts.flatMap { case (f, a) => a.toIR().map((f, _)) }

// if (irs.length == asts.length) {
// val newEntries = ir.InsertFields(ir.Ref("g"), irs)
//
// new MatrixTable(hc, MapEntries(ast, newEntries))
// } else {
val colValuesIsSmall = colType.size == 1 && colType.types.head.isOfType(TString())
if (irs.length == asts.length && colValuesIsSmall) {
val newEntries = ir.InsertFields(ir.Ref("g"), irs)

new MatrixTable(hc, MapEntries(ast, newEntries))
} else {

val (paths, types, f) = Parser.parseAnnotationExprs(expr, ec, Some(Annotation.ENTRY_HEAD))

Expand Down Expand Up @@ -1632,7 +1633,7 @@ class MatrixTable(val hc: HailContext, val ast: MatrixIR) {
}
rvb.endArray()
})
// }
}
}

def filterCols(p: (Annotation, Int) => Boolean): MatrixTable = {
Expand Down

0 comments on commit 3b37894

Please sign in to comment.