일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- matplotlib
- Github
- SQL
- Java
- Python
- google apps script
- array
- numpy
- PostgreSQL
- hive
- django
- 파이썬
- Presto
- list
- Google Excel
- Excel
- Redshift
- dataframe
- string
- PySpark
- Kotlin
- c#
- math
- PANDAS
- Apache
- GIT
- Tkinter
- gas
- Google Spreadsheet
- Today
- Total
목록SQL (132)
달나라 노트
Procedure는 query를 포함에 어떠한 일련의 작업들을 명시해둔 하나의 집합입니다.예를 들면변수를 선언하고if, for loop 등을 사용하여 다양한 프로세스를 구성해두고원하는 query를 적어두고 이를 실행하도록 하는 procedure를 구성해두면이 procedure를 실행함으로서 위 process를 모두 실행할 수 있는 효과를 누릴 수 있습니다. create or replace procedure schema.procedure_name( f1 in bigint, f2 in float, f3 in varchar)language plpgsqlas $$ begin ~~ procedure conetents ~~ end;$$; procedure는 위처..
IllegalArgumentException Size requested for unknown type: java.util.Collection Hive에서 위같은 에러가 발생할 때가 있습니다. 그럴 땐 두 가지 방법으로 해결할 수 있습니다. 첫 번째는 아래처럼 hive.map.aggr 옵션을 false로 지정하는 것입니다.SET hive.map.aggr = false; 두 번째는 COLLECT_SET() 대신 ARRAY_AGG(DISTINCT ~~) function을 사용하는 것입니다.COLLECT_SET()이 중복값을 제거하고 값을 Array로 연결해주는 것이기 때문에ARRAY_AGG()에 DISTINCT를 같이 사용해서 COLLECT_SET()과 동일한 기능을 구현할 수 있습니다. FYI.htt..
Hive에서 partition을 없애는 방법은 alter table을 이용하는 것입니다. alter table test_schema.test_tabledrop if exists partition ( dt >= 20240601, dt 위 query는 dt 컬럼을 partition으로 가지고 있는 test_schema.test_table 테이블에서 특정 값을 가진 partition을 없애는 쿼리입니다. drop if exists partition을 보면if exists를 적을 경우 drop 할 partition이 보이지 않는다면 별도로 drop하지 않고 지나갑니다. dt >= 20240601, dt 조건을 보면 위처럼 되어있기 때문에dt 컬럼의 값이 20240601 이상이고, d..
Hive에서 partition table은 아래와 같이 만들 수 있습니다. SET hive.exec.dynamic.partition = true;SET hive.exec.dynamic.partition.mode = nonstrict;create table test_schema.test_table ( col1 bigint, col2 string, col3 float, col4 string, col5 timestamp)partitioned by ( col6 bigint, col7 bigint);insert into test_schema.test_table partition (col6,..