redo hive to optiq conversion; add tests