Working version of q3 on spark/hive