projectglow / glow

An open-source toolkit for large-scale genomic analysis
https://projectglow.io
Apache License 2.0
263 stars 110 forks source link

AnalysisException: Undefined function: 'nullif' when exporting from Hail to Glow #439

Closed williambrandler closed 5 months ago

williambrandler commented 2 years ago

If you get this error when exporting from Hail to Glow

df = functions.from_matrix_table(mt, include_sample_ids=True)

AnalysisException: Undefined function: 'nullif'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 0

The likely cause is that Glow was registered before Hail was imported

Please do imports in this order

`import hail as hl hl.init(sc, idempotent=True, quiet=True, skip_logging_configuration=True)

import glow spark = glow.register(spark) from glow.hail import functions`

TODO: add this as a troubleshooting tip in the docs