Author: khorgath
Date: Thu Sep  6 07:31:48 2012
New Revision: 1381489

URL: http://svn.apache.org/viewvc?rev=1381489&view=rev
Log:
HCATALOG-492 Document CTAS workaround for Hive with JSON serde (lefty via 
khorgath)

Modified:
    incubator/hcatalog/trunk/CHANGES.txt
    
incubator/hcatalog/trunk/src/docs/src/documentation/content/xdocs/supportedformats.xml

Modified: incubator/hcatalog/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/hcatalog/trunk/CHANGES.txt?rev=1381489&r1=1381488&r2=1381489&view=diff
==============================================================================
--- incubator/hcatalog/trunk/CHANGES.txt (original)
+++ incubator/hcatalog/trunk/CHANGES.txt Thu Sep  6 07:31:48 2012
@@ -38,6 +38,8 @@ Trunk (unreleased changes)
   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)

Modified: 
incubator/hcatalog/trunk/src/docs/src/documentation/content/xdocs/supportedformats.xml
URL: 
http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/docs/src/documentation/content/xdocs/supportedformats.xml?rev=1381489&r1=1381488&r2=1381489&view=diff
==============================================================================
--- 
incubator/hcatalog/trunk/src/docs/src/documentation/content/xdocs/supportedformats.xml
 (original)
+++ 
incubator/hcatalog/trunk/src/docs/src/documentation/content/xdocs/supportedformats.xml
 Thu Sep  6 07:31:48 2012
@@ -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>


Reply via email to