miklosgergely commented on a change in pull request #1756:
URL: https://github.com/apache/hive/pull/1756#discussion_r550804246



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/info/show/status/formatter/TextShowTableStatusFormatter.java
##########
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql.ddl.table.info.show.status.formatter;
+
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.metastore.utils.MetaStoreUtils;
+import org.apache.hadoop.hive.ql.exec.Utilities;
+import org.apache.hadoop.hive.ql.metadata.Hive;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.metadata.Partition;
+import org.apache.hadoop.hive.ql.metadata.Table;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.List;
+
+/**
+ * Formats SHOW TABLE STATUS commands to text format.
+ */
+public class TextShowTableStatusFormatter extends ShowTableStatusFormatter {
+  @Override
+  public void showTableStatus(DataOutputStream out, Hive db, HiveConf conf, 
List<Table> tables, Partition partition)
+      throws HiveException {
+    try {
+      for (Table table : tables) {
+        writeBasicInfo(out, table);
+        writeStorageInfo(out, partition, table);
+        writeColumnsInfo(out, table);
+        writeFileSystemInfo(out, db, conf, partition, table);
+      }
+    } catch (IOException e) {
+      throw new HiveException(e);
+    }
+  }
+
+  private void writeBasicInfo(DataOutputStream out, Table table) throws 
IOException, UnsupportedEncodingException {
+    out.write(("tableName:" + table.getTableName()).getBytes("UTF-8"));
+    out.write(Utilities.newLineCode);
+    out.write(("owner:" + table.getOwner()).getBytes("UTF-8"));
+    out.write(Utilities.newLineCode);

Review comment:
       Fixed.




----------------------------------------------------------------
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.

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