일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Python
- Apache
- string
- google apps script
- Tkinter
- Google Excel
- PostgreSQL
- PySpark
- c#
- gas
- numpy
- GIT
- Github
- Kotlin
- math
- Excel
- list
- dataframe
- Redshift
- SQL
- PANDAS
- Java
- matplotlib
- django
- Mac
- hive
- Google Spreadsheet
- 파이썬
- array
- Today
- Total
목록hive (43)
달나라 노트
current_date를 사용하면 현재 날짜를 출력할 수 있습니다. select current_date, date_format(current_date, 'yyyyMMdd'), unix_timestamp(), from_unixtime(unix_timestamp()), date_format(from_unixtime(unix_timestamp()), 'yyyyMMdd') ; -- Result 2021-08-24 20210824 위처럼 current_date는 오늘 날짜를 반환해줍니다. date_format 함수와 같이 사용해서 날짜 형식도 바꿀 수 있습니다. select date_add(current_date, -1) ; -- Result 2021-08-23 date_add 함수와 동시에 사용할 수도 있습니다..
Hive는 기본적으로 한번에 1개의 row를 처리합니다. Hive에선 vectorized option이 있는데 이 option을 활성화하여 벡터화를 이용하면 한 번에 1024개의 row를 처리하여 table scan, join, aggregate 등의 과정에서 실행 속도를 높일 수 있습니다. set hive.vectorized.execution.enabled = true; set hive.vectorized.execution.reduce.enabled = true; set hive.vectorized.execution.reduce.groupby.enabled=true; vectorization option은 위와 같습니다.
Hive에서는 어떤 engine을 사용할지 설정할 수 있습니다. code template set hive.execution.engine = mr; set hive.execution.engine = tez; set hive.execution.engine = spark; mr -> mapreduce engine 사용 (default engine) tez -> tez engine 사용 (Hive 2.0부터는 tez가 default engine) spark -> spark engine 사용 Hive 문서를 찾아보면 아래와 같은 내용이 있습니다. hive.execution.engine Default Value: mr (deprecated in Hive 2.0.0 – see below) Added In: Hive ..
Hive에서도 partition table을 생성/관리할 수 있습니다. 이 때 아래 2가지의 partitioning 방식이 존재합니다. 정적 파티션 (Static partition) 동적 파티션 (Dynamic partition) 먼저 정적 파티션과 동적 파티션이 뭔지 알아봅시다. 정적 파티션(Static partition) 정적(Static)이라는 말처럼 static partition으로 table을 관리하는 경우에는 해당 partition table에 새로운 data를 insert할 때 어떤 partition에 data를 insert할지를 명시해줘야 합니다. insert into test_table partition (basis_date = '20210325') select * from source_..