| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 31 |
- c#
- django
- matplotlib
- Presto
- GIT
- Github
- array
- Excel
- string
- Google Excel
- numpy
- PySpark
- Tkinter
- SQL
- google apps script
- PANDAS
- Apache
- Kotlin
- PostgreSQL
- hive
- Redshift
- 파이썬
- Python
- list
- math
- gas
- Google Spreadsheet
- dataframe
- Java
- Today
- Total
목록SQL (132)
달나라 노트
date_part 함수를 사용하면 날짜 데이터에서 특정 부분을 추출해낼 수 있습니다. date_part 함수의 syntax는 아래와 같습니다. date_part(part, date/timestamp) date/teimstamp 데이터에서 part에 명시된 부분을 return합니다. -- 현재 sysdate = 2021-06-07 20:35:59.461359 select date_part('year', sysdate); --> 2021 select date_part('month', sysdate); --> 6 select date_part('day', sysdate); --> 7 select date_part('week', sysdate); --> 23 select date_part('hour', sysd..
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_..