-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] 데이터 전처리 및 맛집(운영테이블) 데이터 저장 #16
Conversation
…yellow-ribbon into feat/data_pipeline # Conflicts: # build.gradle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
|
||
public class RawDataRowMapper implements RowMapper<RawData> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
찾아봤는데 이해가 안돼서요! RowMapper를 쓴 이유는 JdbcTemplate
를 사용해야 해서인가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
찾아봤는데 이해가 안돼서요! RowMapper를 쓴 이유는
JdbcTemplate
를 사용해야 해서인가요?
네! JdbcTemplate
의 활용해 SQL 쿼리 결과를 RawData
의 객체로 변환해주기 위해 사용했습니다.
DataPipeTasklet
의 처리 과정:JdbcTemplate
이 직접 DB에서 SQL 쿼리를 실행하고 그 결과를ResultSet
로 받아옵니다.RowMapper
는ResultSet
에서 각 행의 데이터를 추출한 후, 추출된 데이터를RawData
객체로 변환하여 리스트로 담아 반환합니다.- 이후에는
RawData
의 담긴 데이터를 바탕으로Store
객체를 생성하고,stores
테이블에 저장되게 됩니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
Issue
PR 타입(하나 이상의 PR 타입을 선택해주세요)
반영 브랜치
ex) feat/data_pipeline -> dev
변경 사항
genrestrts
테이블의 raw data를 내부에서 사용될 형태로 변경genrestrts
에 데이터 배치 처리 여부를 나타내는 필드private Boolean processed = false;
추가genrestrt
(rawData 테이블)에서 현재 영업상태이고, processed가 falserawData
리스트에 담기rawData
를stores
테이블(운영 테이블) 형식에 맞게 변환stores
(운영 테이블)에 저장genrestrts
테이블 조회processed=true
로 변경해서 데이터 배치 처리됐음을 알 수 있도록 함테스트 결과
Job 성공시
Job 실패시