분류 전체보기

PYTHON

[Python] Pandas vs Dask

작업 시에, dask 키워드와 pandas 키워드가 다른 경우,다른 동작하는 경우로 인해 메모리에 미리 올리던지 나중에 올리던지 오류가 참 많았음. dask를 적용할지 안할지 아직도 잘 모르지만. 헷갈리거나 다른 동작, 오류들은 정리해야 할 필요가 있음.  결론부터 원한다면 : https://www.shiksha.com/online-courses/articles/pandas-vs-dask/#dask 에서 참고 할 것.  Pandasinstall Python version supportOfficially Python 3.9, 3.10, 3.11 and 3.12.Installing from PyPIpandas can be installed via pip from PyPI.$ pip install pandas..

DB

[DB] Decode vs Case when

Decode decode(target_col,null,null,0,0,coalesce(target_col2 / target_col, 0)) Case whencase when target_col1 IS NULL then null when target_col1 = 0 then 0 when (target_col1 is null and target_col1 != 0) then coalesce(target_col2 / target_col1,0) ELSE ....  1. 대규모 데이터 및 복잡한 쿼리인 경우 Case when의 속도가 더 빠름.2. Case 문은 statement 이고 decode 는 func에 해당한다. 3. Case 는 sql / pl/sql 모두 쓰이나, deco..

SERVER

linux Screen 사용법

Screen? ?linux 터미널 상에서 독립적으로 동작하는 가상 터미널이 필요한경우가 있다. 백그라운드에서 돌리고 다른 화면을 보고 싶을 경우 스크린 기능을 쓴다. Install$ yum install screen  $ apt-get install screen 명령어스크린 진입 $ screen -S $ Ctrl+a, d : 현재 스크린으로부터 탈출(Deattach). (스크린은 꺼지지 않고 여전히 동작 중)$ Ctrl+a, c : 스크린에서 새창 띄우기$ Ctrl+a, 숫자 : 해당 번호의 스크린으로 이동$ Ctrl+a, n : 다음 창으로 이동 (Ctrl+a, space와 동일)$ Ctrl+a, p : 이전 창으로 이동 (Ctrl+a, Backspace와 동일) 스크린 재진입$ screen -R [n..

TIPS

MAC ssh 연결 끊길 때

로컬 설정 수정 방법 $ vi ~/.ssh/config ServerAliveInterval 60 ServerAliveCountMax 60 와 같이 작성한다 ( 60초 간격으로 60번 수행한다는 설정)

DB

[DB] SELECT Query VS VIEW

https://stackoverflow.com/questions/22038570/select-query-vs-view Select Query VS View Generally we are aggregating transaction data to one table using SQL Job periodically. Now the customer needs live data so 1 hour or hour is too high. Instead of running job in minutes, team sugges... stackoverflow.com SELECT VIEW 와 SELECT TABLE 의 속도 차이 때문에. 회사에서 개발할 때에 처음에 view에 대한 정확한 이해 없이 접근 - 왜 뷰는 속도가 안날까..

DB

[DB] VERTICA ifnull coalesce

https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/Functions/Null/IFNULL.htm IFNULL www.vertica.com if null 을 통한 Null처리보다 coalesce 가 더 일반적인 표준이라고 한다. 회사에서 쓰는 쿼리로 테스트 했을 때 1분 50초가 걸리던 쿼리를 40초로 앞당겼으므로, 약 1분 정도 당겼다. 사용법 : 1. IFNULL ifnull(x.temp,0) as TEMP 2. COALESCE COALESCE(x.temp, x.temp2, x.temp3, x.temp4 ... ) as TEMP2, IFNULL은 되도록 사용 자제 할 것.

TIPS

[MAC] HOME / END 키 윈도우 처럼 사용 / 프로그램 설치 X

1. terminal 실행 $ cd ~/Library $ mkdir KeyBindings $ cd KeyBindings $ vi DefaultKeyBindings.dict 문자 입력 { /* Remap Home / End keys to be correct */ "\UF729" = "moveToBeginningOfLine:"; /* Home */ "\UF72B" = "moveToEndOfLine:"; /* End */ "$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */ "$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */ "^\UF729" = "moveToB..

카테고리 없음

[ERROR] Can't start redis server. Check logs for details. / Mac M1 Embedded Redis 설정

M1 mac + SpringBoot + Embedded Redis + redisServer.start(); 시 에러 발생 에러 발생 코드 package com.express.freight.config; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.co..

ERROR

[ERROR] No tests found for given includes: [com.express.freight.common.UserRedisRepositoryTest.test]

그 외 에러 @ID 문제 @Id 어노테이션을 org.springframework.data.annotation.Id 로 임포트 해야 한다 그렇지 않을 경우, Error creating bean with name '?? repository' defined in ?? repository defined in @EnableRedisRepositories declared on RedisRepositoriesRegistrar.EnableRedisRepositoriesConfiguration: Invocation of init method failed; Bean 등록이 안될 수 있다. ( 프로젝트 실행이 안된다! ) 무슨 에러? Spring Boot Test시 test를 찾지 못해서 발생하는 에러. 언제 발생? Jun..

ALGORITHM

[SQL 연습] 프로그래머스 즐겨찾기가 가장 많은 식당 정보 출력하기

출처 : 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 쿼리 (ORACLE) : SELECT FOOD_TYPE, REST_ID, REST_NAME, FAVORITES FROM REST_INFO WHERE (FOOD_TYPE, FAVORITES) IN ( SELECT FOOD_TYPE, MAX(FAVORITES) as FAVORITES FROM REST_INFO GROUP BY FOOD_TYPE ) ORDER BY FOOD_TYPE DESC;

girin_dev
'분류 전체보기' 카테고리의 글 목록