def run_hive(args, check_return_code=True):
    cmd = load_hive_cmd() + args
    p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    stdout, stderr = p.communicate()
    if check_return_code and p.returncode != 0:
        raise HiveCommandError("Hive command: {0} failed with error code: {1}".format(" ".join(cmd), p.returncode),
                               stdout, stderr)
    return stdout
Runs the `hive` from the command line, passing in the given args, and
dataset/ETHPy150Open spotify/luigi/luigi/contrib/hive.py/run_hive