Created 11-08-2017 06:21 PM
Hi,
I am using HDP 2.5.3.0 version.
I have created schema in phoenix and under that schema I have created table.
After creating table in phoenix, I have tried to created external table on hive. But while creating table I am getting following error.
Failed with exception java.io.IOException:java.lang.RuntimeException: org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=ACCOUNT1
DDL:-
CREATE EXTERNAL TABLE account1 ( acct_no Int , acct_descr string ) ROW FORMAT SERDE 'org.apache.phoenix.hive.PhoenixSerDe' STORED BY 'org.apache.phoenix.hive.PhoenixStorageHandler' TBLPROPERTIES ( "phoenix.table.name" = "account1", "phoenix.zookeeper.quorum"="<ZKNODE>", "phoenix.zookeeper.znode.parent" = "/hbase-unsecure", "phoenix.zookeeper.client.port" = "2181", "phoenix.rowkeys" = "acct_no", "phoenix.column.mapping" = "acct_no:acct_no, acct_descr:acct_descr");
Tried following steps also to resolve the issue.
1)jar uf /usr/hdp/current/hive-server2/auxlib/phoenix-4.7.0.2.5.6.0-40-client.jar /etc/hive/conf/hive-site.xml
2) jar uf /usr/hdp/current/hive-server2/auxlib/phoenix-4.7.0.2.5.6.0-40-client.jar /etc/hbase/conf/hbase-site.xml
3) jar uf /usr/hdp/current/hive-server2/auxlib/phoenix-hive-4.7.0.2.5.3.0-37.jar /etc/hbase/conf/hbase-site.xml
4) jar uf /usr/hdp/current/hive-server2/auxlib/phoenix-hive-4.7.0.2.5.3.0-37.jar /etc/hive/conf/hive-site.xml
5) jar -uf /usr/hdp/2.5.6.0-40/phoenix/phoenix-4.7.0.2.5.6.0-40-client.jar /etc/hive/conf/hive-site.xml
6) jar -uf /usr/hdp/2.5.6.0-40/phoenix/phoenix-4.7.0.2.5.6.0-40-client.jar /etc/hbase/conf/hbase-site.xml
7) Edit Ambari->Hive->Configs->Advanced->Custom hive-site->Add Property..., add the following properties based on your HBase configurations(you can search in Ambari->HBase->Configs): custom hive-site.xml hbase.zookeeper.quorum= ZKNODEt zookeeper.znode.parent=/hbase-unsecure
phoenix.schema.mapSystemTablesToNamespace=true
phoenix.schema.isNamespaceMappingEnabled=true
😎 Restart Hive via Ambari
9) Copy jar to /usr/hdp/current/hive-server2/auxlib from /usr/hdp/2.5.6.0-40/phoenix/phoenix-4.7.0.2.5.6.0-40-hive.jar /usr/hdp/2.5.6.0-40/phoenix/phoenix-hive-4.7.0.2.5.6.0-40-sources.jar download jar phoenix-hive-4.7.0.2.5.3.0-37.jar HIVE_AUX_JARS_PATH=/usr/hdp/current/hive-server2/auxlib
10)phoenix.schema.mapSystemTablesToNamespace=true
phoenix.schema.isNamespaceMappingEnabled=true
Please help on this. Need urgent help.
Created 11-27-2017 07:46 AM
The issue could be due to mismatch in the column cases of the Hive table columns being mapped to Phoenix table.
Match the case of columns under phoenix.column.mapping for example,
CREATE external db.test(
teste_hive decimal(38,10)
,teste1_hive decimal(38,10)
)
STORED BY 'org.apache.phoenix.hive.PhoenixStorageHandler'
WITH SERDEPROPERTIES ( 'serialization.format'='1')
TBLPROPERTIES ( 'COLUMN_STATS_ACCURATE'='{\"BASIC_STATS\":\"true\"}',
'phoenix.column.mapping’=“teste_hive:TESTE,teste1_hive:TESTE1”,
'phoenix.rowkeys’=’TESTE1’,
'phoenix.table.name'='TEST_PHOENIX_TABLE’,
'phoenix.zookeeper.client.port'='2181',
'phoenix.zookeeper.quorum'='x.com',
'phoenix.zookeeper.znode.parent'='/hbase-unsecure' );
Created 11-09-2017 05:34 AM
Hive Phoenix handler is not a supported feature in HDP 2.5.x versions. This feature is available as Tech Preview feature starting HDP 2.6.2. Below is the document with list of TP features in HDP 2.6.2:
https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.6.2/bk_release-notes/content/tech_previews.html
Created 11-09-2017 06:35 AM
@Sindhu
Thanks for the info.
when production release is coming for the same?
Created 11-09-2017 06:37 AM
Usually, it should be GA in next major release, but cannot confirm on that.
Created 11-09-2017 10:11 AM
@Sindhu
After deploying HDP 2.6.2 I am getting follwoing error whicle doing select * from statemnet.
Failed with exception java.io.IOException:java.lang.RuntimeException: org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703): Undefined column. columnName=acct_no
Please suggest any configuration needed.
Created 11-22-2017 04:47 AM
@Sindhu
Please guide me. Needed urgent help.
Created 11-27-2017 07:46 AM
The issue could be due to mismatch in the column cases of the Hive table columns being mapped to Phoenix table.
Match the case of columns under phoenix.column.mapping for example,
CREATE external db.test(
teste_hive decimal(38,10)
,teste1_hive decimal(38,10)
)
STORED BY 'org.apache.phoenix.hive.PhoenixStorageHandler'
WITH SERDEPROPERTIES ( 'serialization.format'='1')
TBLPROPERTIES ( 'COLUMN_STATS_ACCURATE'='{\"BASIC_STATS\":\"true\"}',
'phoenix.column.mapping’=“teste_hive:TESTE,teste1_hive:TESTE1”,
'phoenix.rowkeys’=’TESTE1’,
'phoenix.table.name'='TEST_PHOENIX_TABLE’,
'phoenix.zookeeper.client.port'='2181',
'phoenix.zookeeper.quorum'='x.com',
'phoenix.zookeeper.znode.parent'='/hbase-unsecure' );
Created 11-28-2017 09:37 AM
@Sindhu
The issue is resolved. We were trying to create table in phoenix then trying to create in hive. Now we are creating tables directly into the hive and also able to see tables in phoenix.
Just need to know am I doing right method?
Created 11-28-2017 09:43 AM
For EXTERNAL tables, Hive works with an existing Phoenix table and manages only Hive metadata. Dropping an EXTERNAL table from Hive deletes only Hive metadata but does not delete the Phoenix table.
Created 12-15-2017 04:31 PM
@Sindhu
Thanks for the information.