diff --git hcatalog/src/test/e2e/templeton/tests/ddl.conf hcatalog/src/test/e2e/templeton/tests/ddl.conf index 8b0b1bf..3c19404 100644 --- hcatalog/src/test/e2e/templeton/tests/ddl.conf +++ hcatalog/src/test/e2e/templeton/tests/ddl.conf @@ -392,8 +392,15 @@ $cfg = 'outputFormat' => "org.apache.hadoop.hive.ql.io.RCFileOutputFormat", 'partitioned' => "true", 'table' => "templetontest_tabe", - - + 'totalNumberFiles' => 0, + 'totalFileSize' => 0, + 'database' => "default", + 'retention' => 0, + 'parametersSize' => 5, + 'tableType' => "MANAGED_TABLE", + 'parameters' => 'comment.*This is the page view table.*prop1.*val1.*prop2.*val2.*SORTBUCKETCOLSPREFIX.*TRUE', + #since 'sd' filed has multiple levels and indeterminate field value, only check "field.delim" and "line.delim" + 'sd' => 'field.delim.*1.*line.delim.*n', }, 'json_field_match_object' => {'columns' => '[ diff --git hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java index f3164e4..cd9128e 100644 --- hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java +++ hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java @@ -294,8 +294,8 @@ public Response listTables(String user, String db, String tablePattern) } /** - * Return a json "show table extended like". This will return - * only the first single table. + * Return a json "show table extended like" with extra info from "desc exteded" + * This will return table with exact name match. */ public Response descExtendedTable(String user, String db, String table) throws HcatException, NotAuthorizedException, BusyException, @@ -303,11 +303,23 @@ public Response descExtendedTable(String user, String db, String table) String exec = String.format("use %s; show table extended like %s;", db, table); try { + //get detailed "tableInfo" from query "desc extended tablename;" + Response res0 = descTable(user, db, table, true); + if (res0.getStatus() != HttpStatus.OK_200) + return res0; + Map m = (Map) res0.getEntity(); + Map tableInfo = (Map) m.get("tableInfo"); + String res = jsonRun(user, exec); JsonBuilder jb = JsonBuilder.create(singleTable(res, table)) .remove("tableName") .put("database", db) - .put("table", table); + .put("table", table) + .put("retention", tableInfo.get("retention")) + .put("sd", tableInfo.get("sd")) + .put("parameters", tableInfo.get("parameters")) + .put("parametersSize", tableInfo.get("parametersSize")) + .put("tableType", tableInfo.get("tableType")); // If we can get them from HDFS, add group and permission String loc = (String) jb.getMap().get("location");