Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다.
문의사항은 gooper@gooper.com로 메일을
보내주세요.
use hue;
select user.username as account, query.last_modified as last_modified, user.first_name as user_name, query.search as query, query.type as search_type, ip.ip_address as ip_address, DATE_FORMAT(query.last_modified, "%Y-%m") from desktop_document2 as query join auth_user as user on user.id=query.owner_id join ( select orition.ip_address, origin.username, origin.attempt_time, case when origin.logout_time is null then case when origin.username != lead_log.username then from_unixtimestamp()) else lead_log.logout_time_cust end else origin.logout_time end as logout_time from (( select ($rownum_origin := $rownum_origin+1) as rownum_origin, ip_adress, username, attempt_time, logout_time, case when logout_time is null then attempt_time else logout_time end as logout_time_cust from axes_accesslog, (select $rownum_origin:=1) tmp order by username, attempt_time) as origin, ( select ($rownum_lead_log:=@rownum_lead_log+1) as rownum_lead_log, username, case when logout_time is null then attempt_time else logout_time end as logout_time_cust from axes_accesslog, (select rownum_lead_log:=0) tmp order by username, attempt_time) as lead_log ) where origin.rownum_origin = lead_log.rownum_lead_log) as ip on ip.username = user.username and ip.attempt_time < query.last_modified and query.last_modified <= ip.logout_time where query.last_modified > '2020-02-03 17:10:43.0' order by query.ast_modified;
결과 예시
account last_modified user_name query search_type ip_address DATE_FORMAT(query.last_modified, "%Y-%m")
hadoop 2020-02-03 17:18:46 hadoop select * from db.tb_test; query-impala xx.xx.xx.xx 2020-02
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
399 | insert hbase by hive ... error occured after 5 hours..HMaster가 뜨지 않는 장애에 대한 복구 방법 | 총관리자 | 2014.04.29 | 7129 |
398 | oozie가 말하는 start시간은..서버에서 확인되는 시간이 아닙니다. | 총관리자 | 2014.05.14 | 699 |
397 | sqoop export/import등을 할때 driver를 못찾는 오류가 발생하면... | 총관리자 | 2014.05.15 | 865 |
396 | sqoop에서 oracle관련 작업할때 테이블명, 사용자명, DB명은 모두 대문자로 사용할것 | 총관리자 | 2014.05.15 | 1528 |
395 | dual table만들기 | 총관리자 | 2014.05.16 | 824 |
394 | 특정파일이 생성되어야 action이 실행되는 oozie job만들기(coordinator.xml) | 총관리자 | 2014.05.20 | 984 |
393 | source의 type을 spooldir로 하는 경우 해당 경로에 파일이 들어오면 파일단위로 전송함 | 총관리자 | 2014.05.20 | 687 |
392 | hive에서 insert overwrite directory.. 로 하면 default column구분자는 'SOH'혹은 't'가 됨 | 총관리자 | 2014.05.20 | 999 |
391 | import 혹은 export할때 hive파일의 default 구분자는 --input-fields-terminated-by " |