deniskuzZ commented on code in PR #6105:
URL: https://github.com/apache/hive/pull/6105#discussion_r2388260193


##########
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/TestLocationQueries.java:
##########
@@ -58,41 +58,32 @@ public TestLocationQueries() {
    */
   public static class CheckResults extends QTestUtil {
     private final String locationSubdir;
+    private final List<String> outputLines = new ArrayList<>();
 
     /**
      * Validate only that the location is correct.
      * @return non-zero if it failed
      */
     @Override
     public QTestProcessExecResult checkCliDriverResults() throws Exception {
-      String tname = getInputFile().getName();
-      File logFile = new File(logDir, tname + ".out");
-
       int failedCount = 0;
       StringBuilder fileNames = new StringBuilder("Files failing the location 
check:");
-      FileReader fr = new FileReader(logFile);
-      BufferedReader in = new BufferedReader(fr);
-      try {
-        String line;
-        int locationCount = 0;
-        Pattern p = Pattern.compile("location:([^,)]+)");
-        while((line = in.readLine()) != null) {
-          Matcher m = p.matcher(line);
-          if (m.find()) {
-            File f = new File(m.group(1));
-            if (!f.getName().equals(locationSubdir)) {
-              failedCount++;
-              fileNames.append(f.getName()).append("\r\n");
-            }
-            locationCount++;
+      int locationCount = 0;
+      Pattern p = Pattern.compile("location:([^,)]+)");
+      for(String line : outputLines) {

Review Comment:
   nit: space



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to