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

[hail] LoadPlink ptype #6421

Merged
merged 8 commits into from Jun 27, 2019
Merged

[hail] LoadPlink ptype #6421

merged 8 commits into from Jun 27, 2019

Conversation

akotlar
Copy link
Contributor

@akotlar akotlar commented Jun 20, 2019

Stacked on #6416

@@ -505,6 +505,8 @@ class RegionValueBuilder(var region: Region) {
addRegionValue(t, uis.region, uis.aoff)
}

def addAnnotation(t: PType, a: Annotation): Unit = addAnnotation(t.virtualType, a)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid changing the 70 invocations of addAnnotation

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the wrong signature -- we should either have it be the virtual type, or no type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -12,7 +13,9 @@ class TableTypeSerializer extends CustomSerializer[TableType](format => (
{ case tt: TableType => JString(tt.toString) }))

case class TableType(rowType: TStruct, key: IndexedSeq[String], globalType: TStruct) extends BaseType {
lazy val canonicalRVDType = RVDType(rowType.physicalType, key)
lazy val canonicalPType = PType.canonical(rowType).asInstanceOf[PStruct]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lazy since derived from constructor arg, which is immutable

@@ -3,7 +3,7 @@ package is.hail.methods
import is.hail.HailContext
import is.hail.annotations._
import is.hail.expr.ir._
import is.hail.expr.types.physical.PString
import is.hail.expr.types.physical.{PFloat64, PInt64, PString, PStruct}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously all #6416

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


val signature = TStruct(("id", TString()), ("fam_id", TString()), ("pat_id", TString()),
("mat_id", TString()), ("is_female", TBoolean()), phenoSig)
val signature = PStruct(("id", PString()), ("fam_id", PString()), ("pat_id", PString()),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not certain this change is worthwhile, because it's only used in Table, and immediately converted back to virtualType.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the no-ptypes-if-no-offheap-data principle, but I think this is probably right -- we'll want to make some of these fields required, when we start doing that everywhere, and we won't be able to do that on virtual types.

@@ -148,6 +149,31 @@ object Table {
).keyBy(key, isSorted)
}

def apply(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tpoterba
Copy link
Contributor

mind rebasing and removing the stacked label? will review then

@akotlar
Copy link
Contributor Author

akotlar commented Jun 26, 2019

Done


val signature = TStruct(("id", TString()), ("fam_id", TString()), ("pat_id", TString()),
("mat_id", TString()), ("is_female", TBoolean()), phenoSig)
val signature = PStruct(("id", PString()), ("fam_id", PString()), ("pat_id", PString()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the no-ptypes-if-no-offheap-data principle, but I think this is probably right -- we'll want to make some of these fields required, when we start doing that everywhere, and we won't be able to do that on virtual types.

@danking danking merged commit c347def into hail-is:master Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants