Index: ql/src/test/results/clientnegative/authorization_fail_5.q.out =================================================================== --- ql/src/test/results/clientnegative/authorization_fail_5.q.out (revision 1417762) +++ ql/src/test/results/clientnegative/authorization_fail_5.q.out (working copy) @@ -1,6 +1,10 @@ -PREHOOK: query: create table authorization_fail (key int, value string) partitioned by (ds string) +PREHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_fail (key int, value string) partitioned by (ds string) PREHOOK: type: CREATETABLE -POSTHOOK: query: create table authorization_fail (key int, value string) partitioned by (ds string) +POSTHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_fail (key int, value string) partitioned by (ds string) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@authorization_fail PREHOOK: query: grant Alter on table authorization_fail to user hive_test_user Index: ql/src/test/results/clientnegative/authorization_fail_3.q.out =================================================================== --- ql/src/test/results/clientnegative/authorization_fail_3.q.out (revision 1417762) +++ ql/src/test/results/clientnegative/authorization_fail_3.q.out (working copy) @@ -1,6 +1,10 @@ -PREHOOK: query: create table authorization_fail_3 (key int, value string) partitioned by (ds string) +PREHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_fail_3 (key int, value string) partitioned by (ds string) PREHOOK: type: CREATETABLE -POSTHOOK: query: create table authorization_fail_3 (key int, value string) partitioned by (ds string) +POSTHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_fail_3 (key int, value string) partitioned by (ds string) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@authorization_fail_3 PREHOOK: query: grant Create on table authorization_fail_3 to user hive_test_user Index: ql/src/test/results/clientnegative/authorization_fail_6.q.out =================================================================== --- ql/src/test/results/clientnegative/authorization_fail_6.q.out (revision 1417762) +++ ql/src/test/results/clientnegative/authorization_fail_6.q.out (working copy) @@ -1,6 +1,10 @@ -PREHOOK: query: create table authorization_part_fail (key int, value string) partitioned by (ds string) +PREHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_part_fail (key int, value string) partitioned by (ds string) PREHOOK: type: CREATETABLE -POSTHOOK: query: create table authorization_part_fail (key int, value string) partitioned by (ds string) +POSTHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_part_fail (key int, value string) partitioned by (ds string) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@authorization_part_fail Authorization failed:No privilege 'Alter' found for inputs { database:default, table:authorization_part_fail}. Use show grant to get more details. Index: ql/src/test/results/clientnegative/authorization_part.q.out =================================================================== --- ql/src/test/results/clientnegative/authorization_part.q.out (revision 1417762) +++ ql/src/test/results/clientnegative/authorization_part.q.out (working copy) @@ -1,6 +1,10 @@ -PREHOOK: query: create table authorization_part_fail (key int, value string) partitioned by (ds string) +PREHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_part_fail (key int, value string) partitioned by (ds string) PREHOOK: type: CREATETABLE -POSTHOOK: query: create table authorization_part_fail (key int, value string) partitioned by (ds string) +POSTHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_part_fail (key int, value string) partitioned by (ds string) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@authorization_part_fail PREHOOK: query: ALTER TABLE authorization_part_fail SET TBLPROPERTIES ("PARTITION_LEVEL_PRIVILEGE"="TRUE") Index: ql/src/test/results/clientnegative/authorization_fail_4.q.out =================================================================== --- ql/src/test/results/clientnegative/authorization_fail_4.q.out (revision 1417762) +++ ql/src/test/results/clientnegative/authorization_fail_4.q.out (working copy) @@ -1,6 +1,10 @@ -PREHOOK: query: create table authorization_fail_4 (key int, value string) partitioned by (ds string) +PREHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_fail_4 (key int, value string) partitioned by (ds string) PREHOOK: type: CREATETABLE -POSTHOOK: query: create table authorization_fail_4 (key int, value string) partitioned by (ds string) +POSTHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_fail_4 (key int, value string) partitioned by (ds string) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@authorization_fail_4 PREHOOK: query: grant Alter on table authorization_fail_4 to user hive_test_user Index: ql/src/test/results/clientnegative/authorization_fail_7.q.out =================================================================== --- ql/src/test/results/clientnegative/authorization_fail_7.q.out (revision 1417762) +++ ql/src/test/results/clientnegative/authorization_fail_7.q.out (working copy) @@ -1,6 +1,10 @@ -PREHOOK: query: create table authorization_fail (key int, value string) +PREHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_fail (key int, value string) PREHOOK: type: CREATETABLE -POSTHOOK: query: create table authorization_fail (key int, value string) +POSTHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_fail (key int, value string) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@authorization_fail PREHOOK: query: create role hive_test_role_fail Index: ql/src/test/results/clientpositive/authorization_2.q.out =================================================================== --- ql/src/test/results/clientpositive/authorization_2.q.out (revision 1417762) +++ ql/src/test/results/clientpositive/authorization_2.q.out (working copy) @@ -1,6 +1,10 @@ -PREHOOK: query: create table authorization_part (key int, value string) partitioned by (ds string) +PREHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_part (key int, value string) partitioned by (ds string) PREHOOK: type: CREATETABLE -POSTHOOK: query: create table authorization_part (key int, value string) partitioned by (ds string) +POSTHOOK: query: -- SORT_BEFORE_DIFF + +create table authorization_part (key int, value string) partitioned by (ds string) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@authorization_part PREHOOK: query: create table src_auth_tmp as select * from src Index: ql/src/test/results/clientpositive/authorization_4.q.out =================================================================== --- ql/src/test/results/clientpositive/authorization_4.q.out (revision 1417762) +++ ql/src/test/results/clientpositive/authorization_4.q.out (working copy) @@ -1,7 +1,11 @@ -PREHOOK: query: create table src_autho_test as select * from src +PREHOOK: query: -- SORT_BEFORE_DIFF + +create table src_autho_test as select * from src PREHOOK: type: CREATETABLE_AS_SELECT PREHOOK: Input: default@src -POSTHOOK: query: create table src_autho_test as select * from src +POSTHOOK: query: -- SORT_BEFORE_DIFF + +create table src_autho_test as select * from src POSTHOOK: type: CREATETABLE_AS_SELECT POSTHOOK: Input: default@src POSTHOOK: Output: default@src_autho_test Index: ql/src/test/results/clientpositive/authorization_6.q.out =================================================================== --- ql/src/test/results/clientpositive/authorization_6.q.out (revision 1417762) +++ ql/src/test/results/clientpositive/authorization_6.q.out (working copy) @@ -1,7 +1,11 @@ -PREHOOK: query: create table src_auth_tmp as select * from src +PREHOOK: query: -- SORT_BEFORE_DIFF + +create table src_auth_tmp as select * from src PREHOOK: type: CREATETABLE_AS_SELECT PREHOOK: Input: default@src -POSTHOOK: query: create table src_auth_tmp as select * from src +POSTHOOK: query: -- SORT_BEFORE_DIFF + +create table src_auth_tmp as select * from src POSTHOOK: type: CREATETABLE_AS_SELECT POSTHOOK: Input: default@src POSTHOOK: Output: default@src_auth_tmp Index: ql/src/test/results/clientpositive/authorization_1.q.out =================================================================== --- ql/src/test/results/clientpositive/authorization_1.q.out (revision 1417762) +++ ql/src/test/results/clientpositive/authorization_1.q.out (working copy) @@ -1,7 +1,11 @@ -PREHOOK: query: create table src_autho_test as select * from src +PREHOOK: query: -- SORT_BEFORE_DIFF + +create table src_autho_test as select * from src PREHOOK: type: CREATETABLE_AS_SELECT PREHOOK: Input: default@src -POSTHOOK: query: create table src_autho_test as select * from src +POSTHOOK: query: -- SORT_BEFORE_DIFF + +create table src_autho_test as select * from src POSTHOOK: type: CREATETABLE_AS_SELECT POSTHOOK: Input: default@src POSTHOOK: Output: default@src_autho_test Index: ql/src/test/results/clientpositive/authorization_3.q.out =================================================================== --- ql/src/test/results/clientpositive/authorization_3.q.out (revision 1417762) +++ ql/src/test/results/clientpositive/authorization_3.q.out (working copy) @@ -1,7 +1,11 @@ -PREHOOK: query: create table src_autho_test as select * from src +PREHOOK: query: -- SORT_BEFORE_DIFF + +create table src_autho_test as select * from src PREHOOK: type: CREATETABLE_AS_SELECT PREHOOK: Input: default@src -POSTHOOK: query: create table src_autho_test as select * from src +POSTHOOK: query: -- SORT_BEFORE_DIFF + +create table src_autho_test as select * from src POSTHOOK: type: CREATETABLE_AS_SELECT POSTHOOK: Input: default@src POSTHOOK: Output: default@src_autho_test Index: ql/src/test/results/clientpositive/keyword_1.q.out =================================================================== --- ql/src/test/results/clientpositive/keyword_1.q.out (revision 1417762) +++ ql/src/test/results/clientpositive/keyword_1.q.out (working copy) @@ -1,6 +1,10 @@ -PREHOOK: query: create table test_user (user string, `group` string) +PREHOOK: query: -- SORT_BEFORE_DIFF + +create table test_user (user string, `group` string) PREHOOK: type: CREATETABLE -POSTHOOK: query: create table test_user (user string, `group` string) +POSTHOOK: query: -- SORT_BEFORE_DIFF + +create table test_user (user string, `group` string) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@test_user PREHOOK: query: grant select on table test_user to user hive_test Index: ql/src/test/results/clientpositive/alter_rename_partition_authorization.q.out =================================================================== --- ql/src/test/results/clientpositive/alter_rename_partition_authorization.q.out (revision 1417762) +++ ql/src/test/results/clientpositive/alter_rename_partition_authorization.q.out (working copy) @@ -1,7 +1,11 @@ -PREHOOK: query: create table src_auth_tmp as select * from src +PREHOOK: query: -- SORT_BEFORE_DIFF + +create table src_auth_tmp as select * from src PREHOOK: type: CREATETABLE_AS_SELECT PREHOOK: Input: default@src -POSTHOOK: query: create table src_auth_tmp as select * from src +POSTHOOK: query: -- SORT_BEFORE_DIFF + +create table src_auth_tmp as select * from src POSTHOOK: type: CREATETABLE_AS_SELECT POSTHOOK: Input: default@src POSTHOOK: Output: default@src_auth_tmp Index: ql/src/test/results/clientpositive/authorization_5.q.out =================================================================== --- ql/src/test/results/clientpositive/authorization_5.q.out (revision 1417762) +++ ql/src/test/results/clientpositive/authorization_5.q.out (working copy) @@ -1,6 +1,10 @@ -PREHOOK: query: CREATE DATABASE IF NOT EXISTS test_db COMMENT 'Hive test database' +PREHOOK: query: -- SORT_BEFORE_DIFF + +CREATE DATABASE IF NOT EXISTS test_db COMMENT 'Hive test database' PREHOOK: type: CREATEDATABASE -POSTHOOK: query: CREATE DATABASE IF NOT EXISTS test_db COMMENT 'Hive test database' +POSTHOOK: query: -- SORT_BEFORE_DIFF + +CREATE DATABASE IF NOT EXISTS test_db COMMENT 'Hive test database' POSTHOOK: type: CREATEDATABASE PREHOOK: query: SHOW DATABASES PREHOOK: type: SHOWDATABASES Index: ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java =================================================================== --- ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java (revision 1417762) +++ ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java (working copy) @@ -35,6 +35,7 @@ import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Deque; import java.util.HashMap; import java.util.HashSet; @@ -100,6 +101,8 @@ protected final String logDir; private final TreeMap qMap; private final Set qSkipSet; + private final Set qSortSet; + private static final String SORT_SUFFIX = ".sorted"; public static final HashSet srcTables = new HashSet (Arrays.asList(new String [] { "src", "src1", "srcbucket", "srcbucket2", "src_json", "src_thrift", @@ -286,6 +289,7 @@ this.hadoopVer = getHadoopMainVersion(hadoopVer); qMap = new TreeMap(); qSkipSet = new HashSet(); + qSortSet = new HashSet(); if (miniMr) { dfs = ShimLoader.getHadoopShims().getMiniDfs(conf, 4, true, null); @@ -347,17 +351,31 @@ while ((line = br.readLine()) != null) { qsb.append(line + "\n"); } + br.close(); + String query = qsb.toString(); - qMap.put(qf.getName(), query); if(checkHadoopVersionExclude(qf.getName(), query) || checkOSExclude(qf.getName(), query)) { qSkipSet.add(qf.getName()); } - br.close(); + + if (checkNeedsSort(qf.getName(), query)) { + qSortSet.add(qf.getName()); + } } + private boolean checkNeedsSort(String fileName, String query) { + Pattern pattern = Pattern.compile("-- SORT_BEFORE_DIFF"); + Matcher matcher = pattern.matcher(query); + + if (matcher.find()) { + return true; + } + return false; + } + private boolean checkHadoopVersionExclude(String fileName, String query){ // Look for a hint to not run a test on some Hadoop versions @@ -394,14 +412,14 @@ String versions = matcher.group(2); for (String s : versions.split("\\,")) { s = s.trim(); - versionSet.add(s); + versionSet.add(s); } } if (matcher.find()) { //2nd match is not supposed to be there String message = "QTestUtil: qfile " + fileName - + " contains more than one reference to (EX|IN)CLUDE_HADOOP_MAJOR_VERSIONS"; + + " contains more than one reference to (EX|IN)CLUDE_HADOOP_MAJOR_VERSIONS"; throw new UnsupportedOperationException(message); } @@ -427,20 +445,20 @@ if (matcher.find()) { String prefix = matcher.group(1); if ("EX".equals(prefix)) { - //windows is to be exluded - if(Shell.WINDOWS){ - System.out.println("Due to the OS being windows " + - "adding the query " + fileName + - " to the set of tests to skip"); - return true; - } + //windows is to be exluded + if(Shell.WINDOWS){ + System.out.println("Due to the OS being windows " + + "adding the query " + fileName + + " to the set of tests to skip"); + return true; + } } else if(!Shell.WINDOWS){ - //non windows to be exluded - System.out.println("Due to the OS not being windows " + - "adding the query " + fileName + - " to the set of tests to skip"); - return true; + //non windows to be exluded + System.out.println("Due to the OS not being windows " + + "adding the query " + fileName + + " to the set of tests to skip"); + return true; } } return false; @@ -817,7 +835,8 @@ outfd.write(e.getMessage()); outfd.close(); - int exitVal = executeDiffCommand(outf.getPath(), expf, false); + int exitVal = executeDiffCommand(outf.getPath(), expf, false, + qSortSet.contains(qf.getName())); if (exitVal != 0 && overWrite) { exitVal = overwriteResults(outf.getPath(), expf); } @@ -839,7 +858,7 @@ outfd.write(tree.toStringTree()); outfd.close(); - int exitVal = executeDiffCommand(outf.getPath(), expf, false); + int exitVal = executeDiffCommand(outf.getPath(), expf, false, false); if (exitVal != 0 && overWrite) { exitVal = overwriteResults(outf.getPath(), expf); @@ -876,7 +895,7 @@ }; maskPatterns(patterns, outf.getPath()); - int exitVal = executeDiffCommand(outf.getPath(), planFile, true); + int exitVal = executeDiffCommand(outf.getPath(), planFile, true, false); if (exitVal != 0 && overWrite) { exitVal = overwriteResults(outf.getPath(), planFile); @@ -1009,7 +1028,8 @@ maskPatterns(patterns, f.getPath()); int exitVal = executeDiffCommand(f.getPath(), - outFileName, false); + outFileName, false, + qSortSet.contains(tname)); if (exitVal != 0 && overWrite) { exitVal = overwriteResults(f.getPath(), outFileName); @@ -1022,18 +1042,42 @@ // This method can be replaced with Files.copy(source, target, REPLACE_EXISTING) // once Hive uses JAVA 7. System.out.println("Overwriting results"); - String[] cmdArray = new String[] { + return executeCmd(new String[] { "cp", - Shell.WINDOWS ? getQuotedString(inFileName) : inFileName, - Shell.WINDOWS ? getQuotedString(outFileName) : outFileName - }; - Process executor = Runtime.getRuntime().exec(cmdArray); - return executor.waitFor(); + getQuotedString(inFileName), + getQuotedString(outFileName) + }); } private static int executeDiffCommand(String inFileName, String outFileName, - boolean ignoreWhiteSpace) throws Exception { + boolean ignoreWhiteSpace, + boolean sortResults + ) throws Exception { + + int result = 0; + + if (sortResults) { + // sort will try to open the output file in write mode on windows. We need to + // close it first. + SessionState ss = SessionState.get(); + if (ss != null && ss.out != null && ss.out != System.out) { + ss.out.close(); + } + + String inSorted = inFileName + SORT_SUFFIX; + String outSorted = outFileName + SORT_SUFFIX; + + result = sortFiles(inFileName, inSorted); + result |= sortFiles(outFileName, outSorted); + if (result != 0) { + System.err.println("ERROR: Could not sort files before comparing"); + return result; + } + inFileName = inSorted; + outFileName = outSorted; + } + ArrayList diffCommandArgs = new ArrayList(); diffCommandArgs.add("diff"); @@ -1055,26 +1099,75 @@ diffCommandArgs.add("-B"); // Ignore changes whose lines are all blank } // Add files to compare to the arguments list - diffCommandArgs.add(Shell.WINDOWS ? getQuotedString(inFileName) : inFileName); - diffCommandArgs.add(Shell.WINDOWS ? getQuotedString(outFileName) : outFileName); - String[] cmdArray =(String [])diffCommandArgs.toArray(new String [diffCommandArgs.size ()]); - System.out.println(org.apache.commons.lang.StringUtils.join(cmdArray, ' ')); + diffCommandArgs.add(getQuotedString(inFileName)); + diffCommandArgs.add(getQuotedString(outFileName)); - Process executor = Runtime.getRuntime().exec(cmdArray); + result = executeCmd(diffCommandArgs); - StreamPrinter outPrinter = new StreamPrinter( - executor.getInputStream(), null, SessionState.getConsole().getChildOutStream()); - StreamPrinter errPrinter = new StreamPrinter( - executor.getErrorStream(), null, SessionState.getConsole().getChildErrStream()); + if (sortResults) { + new File(inFileName).delete(); + new File(outFileName).delete(); + } + return result; + } + + private static int sortFiles(String in, String out) throws Exception { + return executeCmd(new String[] { + "sort", + getQuotedString(in), + }, out, null); + } + + private static int executeCmd(Collection args) throws Exception { + return executeCmd(args, null, null); + } + + private static int executeCmd(String[] args) throws Exception { + return executeCmd(args, null, null); + } + + private static int executeCmd(Collection args, String outFile, String errFile) throws Exception { + String[] cmdArray = (String[]) args.toArray(new String[args.size()]); + return executeCmd(cmdArray, outFile, errFile); + } + + private static int executeCmd(String[] args, String outFile, String errFile) throws Exception { + System.out.println("Running: " + org.apache.commons.lang.StringUtils.join(args, ' ')); + + PrintStream out = outFile == null ? + SessionState.getConsole().getChildOutStream() : + new PrintStream(new FileOutputStream(outFile), true); + PrintStream err = errFile == null ? + SessionState.getConsole().getChildErrStream() : + new PrintStream(new FileOutputStream(errFile), true); + + Process executor = Runtime.getRuntime().exec(args); + + StreamPrinter errPrinter = new StreamPrinter(executor.getErrorStream(), null, err); + StreamPrinter outPrinter = new StreamPrinter(executor.getInputStream(), null, out); + outPrinter.start(); errPrinter.start(); - return executor.waitFor(); + int result = executor.waitFor(); + + outPrinter.join(); + errPrinter.join(); + + if (outFile != null) { + out.close(); + } + + if (errFile != null) { + err.close(); + } + + return result; } private static String getQuotedString(String str){ - return String.format("\"%s\"", str); + return Shell.WINDOWS ? String.format("\"%s\"", str) : str; } public ASTNode parseQuery(String tname) throws Exception { Index: ql/src/test/queries/clientnegative/authorization_part.q =================================================================== --- ql/src/test/queries/clientnegative/authorization_part.q (revision 1417762) +++ ql/src/test/queries/clientnegative/authorization_part.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + create table authorization_part_fail (key int, value string) partitioned by (ds string); ALTER TABLE authorization_part_fail SET TBLPROPERTIES ("PARTITION_LEVEL_PRIVILEGE"="TRUE"); create table src_auth as select * from src; Index: ql/src/test/queries/clientnegative/authorization_fail_3.q =================================================================== --- ql/src/test/queries/clientnegative/authorization_fail_3.q (revision 1417762) +++ ql/src/test/queries/clientnegative/authorization_fail_3.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + create table authorization_fail_3 (key int, value string) partitioned by (ds string); set hive.security.authorization.enabled=true; Index: ql/src/test/queries/clientnegative/authorization_fail_4.q =================================================================== --- ql/src/test/queries/clientnegative/authorization_fail_4.q (revision 1417762) +++ ql/src/test/queries/clientnegative/authorization_fail_4.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + create table authorization_fail_4 (key int, value string) partitioned by (ds string); set hive.security.authorization.enabled=true; Index: ql/src/test/queries/clientnegative/authorization_fail_5.q =================================================================== --- ql/src/test/queries/clientnegative/authorization_fail_5.q (revision 1417762) +++ ql/src/test/queries/clientnegative/authorization_fail_5.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + create table authorization_fail (key int, value string) partitioned by (ds string); set hive.security.authorization.enabled=true; Index: ql/src/test/queries/clientnegative/authorization_fail_6.q =================================================================== --- ql/src/test/queries/clientnegative/authorization_fail_6.q (revision 1417762) +++ ql/src/test/queries/clientnegative/authorization_fail_6.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + create table authorization_part_fail (key int, value string) partitioned by (ds string); set hive.security.authorization.enabled=true; Index: ql/src/test/queries/clientnegative/authorization_fail_7.q =================================================================== --- ql/src/test/queries/clientnegative/authorization_fail_7.q (revision 1417762) +++ ql/src/test/queries/clientnegative/authorization_fail_7.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + create table authorization_fail (key int, value string); set hive.security.authorization.enabled=true; Index: ql/src/test/queries/clientpositive/authorization_6.q =================================================================== --- ql/src/test/queries/clientpositive/authorization_6.q (revision 1417762) +++ ql/src/test/queries/clientpositive/authorization_6.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + create table src_auth_tmp as select * from src; create table authorization_part (key int, value string) partitioned by (ds string); Index: ql/src/test/queries/clientpositive/alter_rename_partition_authorization.q =================================================================== --- ql/src/test/queries/clientpositive/alter_rename_partition_authorization.q (revision 1417762) +++ ql/src/test/queries/clientpositive/alter_rename_partition_authorization.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + create table src_auth_tmp as select * from src; create table authorization_part (key int, value string) partitioned by (ds string); Index: ql/src/test/queries/clientpositive/keyword_1.q =================================================================== --- ql/src/test/queries/clientpositive/keyword_1.q (revision 1417762) +++ ql/src/test/queries/clientpositive/keyword_1.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + create table test_user (user string, `group` string); grant select on table test_user to user hive_test; Index: ql/src/test/queries/clientpositive/authorization_1.q =================================================================== --- ql/src/test/queries/clientpositive/authorization_1.q (revision 1417762) +++ ql/src/test/queries/clientpositive/authorization_1.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + create table src_autho_test as select * from src; set hive.security.authorization.enabled=true; Index: ql/src/test/queries/clientpositive/authorization_3.q =================================================================== --- ql/src/test/queries/clientpositive/authorization_3.q (revision 1417762) +++ ql/src/test/queries/clientpositive/authorization_3.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + create table src_autho_test as select * from src; grant drop on table src_autho_test to user hive_test_user; Index: ql/src/test/queries/clientpositive/authorization_5.q =================================================================== --- ql/src/test/queries/clientpositive/authorization_5.q (revision 1417762) +++ ql/src/test/queries/clientpositive/authorization_5.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + CREATE DATABASE IF NOT EXISTS test_db COMMENT 'Hive test database'; SHOW DATABASES; Index: ql/src/test/queries/clientpositive/authorization_2.q =================================================================== --- ql/src/test/queries/clientpositive/authorization_2.q (revision 1417762) +++ ql/src/test/queries/clientpositive/authorization_2.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + create table authorization_part (key int, value string) partitioned by (ds string); create table src_auth_tmp as select * from src; ALTER TABLE authorization_part SET TBLPROPERTIES ("PARTITION_LEVEL_PRIVILEGE"="TRUE"); Index: ql/src/test/queries/clientpositive/authorization_4.q =================================================================== --- ql/src/test/queries/clientpositive/authorization_4.q (revision 1417762) +++ ql/src/test/queries/clientpositive/authorization_4.q (working copy) @@ -1,3 +1,5 @@ +-- SORT_BEFORE_DIFF + create table src_autho_test as select * from src; grant All on table src_autho_test to user hive_test_user;