hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Grover <>
Subject Re: Data are not displayed correctly on hive tables
Date Mon, 07 May 2012 03:06:36 GMT
Could you share the output of the following command in Hive:
describe formatted messagetemplate

My hunch is that your Hive table is using a delimiter (e.g. '\t') that appears in the content
of your XML.

Mark Grover, Business Intelligence Analyst
OANDA Corporation 

www: www: 

----- Original Message -----
From: "mperformer" <>
Sent: Sunday, May 6, 2012 8:34:27 PM
Subject: Data are not displayed correctly on hive tables


I am using 

    • Hadoop 0.20.2 
    • Hive 0.8.1 
    • Sqoop 1.4.1-incubating 

in my sample project. Currently I am importing data from PostgreSQL to Hive table using Sqoop.
My database table in PostgreSQL has 4 columns and one column stores a bit large XML file as
TEXT data type. The same column defined in HIVE as string, but after that column data is not
importing and shows as null; 

Table structure in PostgreSQL 

CREATE TABLE public.messagetemplate ( 
messagetemplateid BIGSERIAL, 
messagetemplatename TEXT, 
data TEXT, 
messagetemplatetype TEXT, 
CONSTRAINT pk_messagetemplate PRIMARY KEY(messagetemplateid) 

Table structure in Hive 

hive> desc messagetemplate; 
messagetemplateid bigint 
messagetemplatename string 
data string 
messagetemplatetype string 

The data column store the XML file as text, but during the import to hive, all data are imported
properly (checked the files in HDFS). But using HIVE select statement, it only shows small
part from the XML text and the rest column (last column) is null. 

Could someone please help me to sort this out. Thanks. 

View raw message