$sql = str_replace('`', "", $sql); #log sql action $basedir = dirname(__FILE__) . "/"; $logfile = $basedir . $env['logs_path'] . $_SESSION['username'] . "_" . $time . ".log"; $etc->LogAction($logfile, "w", $sql . "\n"); # #didn't use sql verification, may cause be hacked if (!file_exists($env['output_path'] . '/hive_res.' . $time . '.out') || filesize($env['output_path'] . '/hive_res.' . $time . '.out') == 0) { #$exec = $LANG . $HADOOP_HOME . $HIVE_HOME . $JAVA_HOME. $env['hive_home'].'/bin/hive '.$UDF.' -e '.$sql.' > '.$env['output_path'].'/hive_res.'.$time.'.out'; $exec = $LANG . $HADOOP_HOME . $HIVE_HOME . $JAVA_HOME . $env['hive_home'] . '/bin/hive ' . $UDF . ' -f ' . $logfile . ' > ' . $env['output_path'] . '/hive_res.' . $time . '.out'; //passthru($exec); #$log = $env['logs_path'].$time.".debug"; #$etc->LogAction($log,"w",$exec."\n"); $runfile = $env['output_path'] . "/hive_run." . $time . ".out"; $etc->NonBlockingRun($exec, $time, $runfile, 2, $code); $etc->ExportCSV($time); } else { echo $lang['cliDone']; } } else { mkdir($env['output_path'], 777); $sql = trim(rawurldecode($query, $key)); $sql = str_replace("", "%", $sql); //decode for like "%" #$sql = str_replace('"','\"',$sql); #$sql = '"'.str_replace('`',"",$sql).'"'; $sql = str_replace('`', "", $sql); #log sql action $basedir = dirname(__FILE__) . "/"; #log sql action $logfile = $basedir . $env['logs_path'] . $_SESSION['username'] . "_" . $time . ".log";