Browse Source

AMBARI-14827. HiveViews: Value in cell coming up as null for select query. (Gaurav Nagar via dipayanb)

Dipayan Bhowmick 9 years ago
parent
commit
9dfe929ee3

+ 6 - 1
contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ResultsPaginationController.java

@@ -190,7 +190,12 @@ public class ResultsPaginationController {
       for(Object[] row : rows ){
         String[] strs = new String[row.length];
         for( int colNum = 0 ; colNum < row.length ; colNum++ ){
-          strs[colNum] = String.valueOf(row[colNum]);
+          String value = String.valueOf(row[colNum]);
+          if(row[colNum] != null && (value.isEmpty() || value.equalsIgnoreCase("null"))){
+            strs[colNum] = String.format("\"%s\"",value);
+          }else{
+            strs[colNum] = value;
+          }
         }
         this.rows.add(strs);
       }