Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

unable to access data of sqoop imported hbase table from phoenix

unable to access data of sqoop imported hbase table from phoenix

Expert Contributor

We have imported data to a hbase table directly from mysql using sqoop and has created a view for the same in phoenix . but while accessing the data .. From Hbase showing the data as below.

hbase(main):012:0* scan "state" ROW COLUMN+CELL 1 column=info:CountryID, timestamp=1481635320276, value=1 1 column=info:CreatedDate, timestamp=1481635320276, value=2016-11-01 15:44:00.61 1 column=info:CreatedUser, timestamp=1481635320276, value=ssandeep 1 column=info:StateAbrv, timestamp=1481635320276, value=MA 1 column=info:StateDescription, timestamp=1481635320276, value=MASSACHUSETTS 1 column=info:StateMapCode, timestamp=1481635320276, value=US-MA

whereas from phoenix its showing only null values

0: jdbc:phoenix:localhost:2181> select * from "state"; +------------------------------------------+------------------------------------------+ | STATEID | COUNTRYID | +------------------------------------------+------------------------------------------+ | null | null | | null | null | | null | null | | null | null | | null | null | | null | null | | null | null | | null | null | | null | null

3 REPLIES 3
Highlighted

Re: unable to access data of sqoop imported hbase table from phoenix

Expert Contributor

Created hbase table as below . create 'state','info' 0 row(s) in 1.5600 seconds

sqoop import command is : sqoop import --connect jdbc:mysql://XXXXXXXX --username ********** --password ********** --table state --hbase-table state --column-family info --hbase-row-key StateID -m

Created View in phoenix : CREATE VIEW "state" ( StateId bigint PRIMARY KEY , "info".CountryID bigint);

Re: unable to access data of sqoop imported hbase table from phoenix

Phoenix expects a very specific table structure. Your Sqoop import obviously does not conform to this table structure.

It looks like integration with Phoenix in Sqoop is still a work in progress: https://issues.apache.org/jira/browse/SQOOP-2649

Re: unable to access data of sqoop imported hbase table from phoenix

Rising Star

Hi, Hbase tables can be dumped with data from external sources using sqoop, but data cannot be properly accessed by phoenix yet. https://issues.apache.org/jira/browse/SQOOP-2649 issue is still not fully addressed. What you can do is, try other ways of importing

Don't have an account?
Coming from Hortonworks? Activate your account here