HCATALOG-492 Document CTAS workaround for Hive with JSON serde (lefty via khorgath)


git-svn-id: https://svn.apache.org/repos/asf/incubator/hcatalog/trunk@1381489 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CHANGES.txt b/CHANGES.txt
index 0db81b8..6adba21 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -38,6 +38,8 @@
   HCAT-427 Document storage-based authorization (lefty via gates)
 
   IMPROVEMENTS
+  HCAT-492 Document CTAS workaround for Hive with JSON serde (lefty via khorgath)
+
   HCAT-487 HCatalog should tolerate a user-defined amount of bad records (traviscrawford)
 
   HCAT-488 TestHCatStorer should extend HCatBaseTest so it uses junit4 and runs inside an IDE (traviscrawford)
diff --git a/src/docs/src/documentation/content/xdocs/supportedformats.xml b/src/docs/src/documentation/content/xdocs/supportedformats.xml
index cdc72d0..f8e61d9 100644
--- a/src/docs/src/documentation/content/xdocs/supportedformats.xml
+++ b/src/docs/src/documentation/content/xdocs/supportedformats.xml
@@ -26,6 +26,26 @@
 
   <p>Users can write SerDes for custom formats using the instructions at <a href="https://cwiki.apache.org/confluence/display/Hive/SerDe/">https://cwiki.apache.org/confluence/display/Hive/SerDe</a>.</p>
 
+  <p><strong>Usage from Hive</strong></p>
+
+  <p> As of 0.4, Hive and HCatalog share the same storage abstractions, and thus, you can read from and write to HCatalog tables from within Hive, and vice versa.</p>
+
+  <p>However, Hive does not know where to find the HCatalog jar by default, so if you use any features that have been introduced by HCatalog, such as a table using the JSON SerDe, you might get a "class not found" exception.
+In this situation, before you run Hive, set environment variable <code>HIVE_AUX_JARS_PATH</code> to the directory with your HCatalog jar.
+(If the examples in the <a href="install.html">Installation</a> document were followed, that should be <code>/usr/local/hcat/share/hcatalog/</code>).</p>
+
+  <p><strong>CTAS Issue with JSON SerDe</strong></p>
+
+  <p>Using the Hive CREATE TABLE ... AS SELECT command with a JSON SerDe
+results in a table that has column headers such as "<code>_col0</code>",
+which can be read by HCatalog or Hive but cannot be easily read by external users.
+To avoid this issue, create the table in two steps instead of using CTAS:</p>
+  <ol>
+    <li>CREATE TABLE ...</li>
+    <li>INSERT OVERWRITE TABLE ... SELECT ...</li>
+  </ol>
+  
+  <p>See <a href="https://issues.apache.org/jira/browse/HCATALOG-436">HCATALOG-436</a> for details.</p>
 
  </body>
 </document>