Created
December 1, 2015 22:33
-
-
Save gbraccialli/a707dbe62fbc461aed9a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo -u hdfs hadoop fs -mkdir /user/root | |
| sudo -u hdfs hadoop fs -chmod -R 777 /user/root | |
| mkdir /usr/hdp/current/hive-client/auxlib | |
| cp /usr/hdp/current/phoenix-client/phoenix-server.jar /usr/hdp/current/hive-client/auxlib | |
| chmod -R +x /usr/hdp/current/hive-client/auxlib/ | |
| echo "drop table if exists phoenix_test; | |
| CREATE TABLE PHOENIX_TEST( | |
| ID VARCHAR not null, | |
| TEXT VARCHAR | |
| CONSTRAINT PK PRIMARY KEY (ID) | |
| ) ; | |
| upsert into phoenix_test values ('1', 'test1'); | |
| upsert into phoenix_test values ('2', 'test2'); | |
| " > /root/sample_phoenix_hive_p.sql | |
| /root/phoenix.sh /root/sample_phoenix_hive_p.sql | |
| echo "CREATE EXTERNAL TABLE PHOENIX_TEST(ID int, TEXT string) | |
| STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' | |
| WITH SERDEPROPERTIES ('hbase.columns.mapping' = ':key,0:TEXT') | |
| TBLPROPERTIES ('hbase.table.name' = 'PHOENIX_TEST');" > /root/sample_phoenix_hive_h.sql | |
| hive -f /root/sample_phoenix_hive_h.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment