일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- Google Excel
- Python
- numpy
- Mac
- matplotlib
- Apache
- 파이썬
- Tkinter
- dataframe
- django
- gas
- PySpark
- PANDAS
- Github
- math
- list
- PostgreSQL
- Excel
- array
- SQL
- Google Spreadsheet
- Java
- GIT
- c#
- google apps script
- Kotlin
- Redshift
- hive
- string
- Today
- Total
목록SQL/Apache Hive (40)
달나라 노트
일반적으로 drop table (if exists) 위처럼 drop table 구문을 사용하면 table이 drop되긴 하지만 휴지통 directory에 해당 table이 이동되며 drop된 table을 복구할 수 있습니다. drop table (if exists) purge 그런데 위처럼 drop table 구문의 가장 끝에 purge를 적어주면 table drop 시에 휴지통 directory로 이동하지 않고 완전히 table이 삭제되며 이 경우 table 복구가 불가능합니다.
Hive에서 s3 서버를 다룰 수 있는 방법을 알아봅시다. ----- Hive database -> S3 server ----- drop table if exists test_schema.test_table; create external table test_schema.test_table ( col_1 bigint, col_2 string ) row format serde 'org.apache.hadoop.hive.serde2.OpenCSVSerde' -- row format delimited fields terminated by ',' -- lines terminated by '\n' stored as textfile location 's3://root_dir/test_dir/' ; ----- Inse..
Hive에선 collect_list, collect_set이라는 함수를 제공합니다. 이는 여러 행의 데이터를 합칠 때 사용합니다. 마치 Redshift의 listagg와 비슷한 함수라고 생각하면 되겠네요. Table name = employees department_no join_dt name 10 2020-02-01 Bero 10 2020-02-02 Alice 10 2020-02-03 Alice 20 2020-02-03 Dave 20 2020-02-02 Hella 20 2020-02-04 Alice 30 2020-02-06 Grace 30 2020-02-04 Irene 30 2020-02-05 Hella 위와 같은 table이 있다고 가정해봅시다. selectdepartment_no , collect_..