일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Google Excel
- PANDAS
- Python
- string
- Apache
- math
- Github
- matplotlib
- Java
- dataframe
- hive
- SQL
- 파이썬
- Redshift
- list
- Google Spreadsheet
- django
- array
- Mac
- Tkinter
- c#
- PySpark
- gas
- GIT
- Kotlin
- numpy
- google apps script
- Excel
- PostgreSQL
- Today
- Total
목록SQL/Apache Hive (35)
달나라 노트
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_..
Hive에서는 기본적으로 partition이 있는 table은 partition 조건을 명시해야합니다. (data full scan은 성능에 영향을 미칠 수 있기 때문이죠.) 만약 partition 조건을 명시하지 않으면 Error가 발생합니다. 그런데 사용하다보면 partition 조건 없이 table full scan을 해야하는 경우가 있죠. set hive.mapred.mode = nonstrict; 이 경우 위처럼 hive.mapred.mode를 nonstrict 모드로 설정해주면 partition table에 대해서도 table full scan이 가능해집니다. 참고 위같은 option은 그냥 쿼리돌리듯이 돌리면 설정됩니다. Apache Hive document = https://cwiki.ap..
Hive에서 큰 데이터를 다루다보면 reducer가 더 많은 메모리를 필요로 하는 경우가 있습니다. Reducer memory set hive.exec.reducers.bytes.per.reducer = 256000000; hive에서 위 setting은 하나의 reducer당 할당되는 메모리의 크기를 의미합니다. reducer 하나에 할당되는 메모리 기본값은 256MB(256,000,000B)입니다. 위 예시는 기본값인 256MB를 할당하도록 되어있지만 이걸 바꾸면 원하는 크기의 메모리를 할당할 수 있습니다. Reducer max set hive.exec.reducers.max = 128; reducer max option은 hive job마다 사용할 수 있는 최대 reducer의 개수를 정해줍니다. ..