Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ATS to Hive query plan extraction
import json
import sys
class ATSFile(object):
def __init__(self, name): = json.load(open(name)) = name
def dump(self):
info =["otherinfo"]
q = json.loads(info["QUERY"])
txt = q["queryText"]
plan = q["queryPlan"]
open("%s-query.txt" %, "w").write(txt)
json.dump(plan, open("%s-plan.txt" %,"w"), indent=2)
def main(args):
data = [ATSFile(f) for f in args]
for d in data:
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment