728x90

Hive 4

No lease on .. File does not exist. Holder DFSClient_NONMAPREDUCE_-690256595_53 does not have any open files. 에러 발생 시

sprark 배치 수행 중 아래와 같은 에러가 발생했다. 대략적인 원인은 병렬 처리로 인해서 임시 데이터가 삭제된 것이다. Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hdfs.server.namenode.LeaseExpiredException): No lease on .c000.snappy.parquet (inode 4027045532): File does not exist. Holder DFSClient_NONMAPREDUCE_-690256595_53 does not have any open files. hive 테이블에 데이터를 입력하기 전에 alter table truncate partition 하는 부분이 있었는데 그 부..

hive에서 선택한 일자의 월요일 일자 가져오기

어떤 데이터를 추출할 때에는 월요일~일요일 사이의 데이터를 가져와야 할 경우가 있다. 예를들어 주간 실적같은 것을 보여줄 때가 그렇다. 이럴 때는 월요일~일요일의 일자를 알아야 한다. 월요일만 알면 6일을 더하면 일요일이 되기 때문에 월요일 날짜를 찾는게 집중하면 된다. hive에서는 아래와 같이 쿼리를 실행하면 월요일의 일자를 알 수 있다. select next_day(date_sub('2019-01-01', 7), 'MON') hive 1.2 버전 이상에서만 될 수 있으니 hive의 버전을 확인하자. 참고 stackoverflow.com/questions/33196651/how-to-get-the-date-of-the-first-day-of-a-week-given-a-time-stamp-in-hado..

728x90