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

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 .