Phoenix Example
About this task
SQLLine must be running to complete the steps in this example. To try out Phoenix, complete the following steps:
Procedure
-
At the
0: jdbc:phoenix:<hostname>:<port>
prompt, issue the following SQL statement to drop the table STOCK_SYMBOL:DROP TABLE STOCK_SYMBOL;
-
Create a table named STOCK_SYMBOL with two columns, SYMBOL and COMPANY.
CREATE TABLE STOCK_SYMBOL (SYMBOL VARCHAR NOT NULL PRIMARY KEY, COMPANY VARCHAR);
-
Insert data into the STOCK_SYMBOL table.
UPSERT INTO STOCK_SYMBOL VALUES ('Hadoop','MapR');
-
Query the STOCK_SYMBOL table.
SELECT * FROM STOCK_SYMBOL; +------------+------------+ | SYMBOL | COMPANY | +------------+------------+ | Hadoop | MapR | +------------+------------+ 1 row selected (0.098 seconds)