Created
July 14, 2016 13:38
-
-
Save developer-sdk/e7c8e7aeaec56f00aa5bbe519aae7221 to your computer and use it in GitHub Desktop.
hive를 이용한 CRUD
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
| -- 테이블 생성 | |
| CREATE TABLE STUDENT | |
| ( | |
| STD_ID INT, | |
| STD_NAME STRING, | |
| AGE INT, | |
| ADDRESS STRING | |
| ) | |
| CLUSTERED BY (ADDRESS) into 3 buckets | |
| ROW FORMAT DELIMITED | |
| FIELDS TERMINATED BY ',' | |
| STORED as orc tblproperties('transactional'='true'); | |
| -- 테이블에 입력 | |
| INSERT INTO TABLE STUDENT VALUES (101,'JAVACHAIN',30,'PAUL REVERE RD'), | |
| (102,'ANTO',18,'29 NATHAN HALE'), | |
| (103,'PRABU',23,'34 henry road'), | |
| (104,'KUMAR',24,'gandhi road'), | |
| (105,'jack',35,'Modi street'); | |
| -- 테이블 수정 | |
| update STUDENT | |
| SET std_id = 110 | |
| WHERE std_id = 105; | |
| -- 테이블 삭제 | |
| DELETE FROM STUDENT | |
| where std_id=105; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment