Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/f-lab-edu/commerce-sessionization
사용자 행동 데이터 세션화를 위한 Spark-Airflow 파이프라인 구축
https://github.com/f-lab-edu/commerce-sessionization
airflow scala spark
Last synced: 15 days ago
JSON representation
사용자 행동 데이터 세션화를 위한 Spark-Airflow 파이프라인 구축
- Host: GitHub
- URL: https://github.com/f-lab-edu/commerce-sessionization
- Owner: f-lab-edu
- Created: 2024-10-23T01:20:00.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-12-04T02:46:48.000Z (2 months ago)
- Last Synced: 2024-12-04T03:26:20.407Z (2 months ago)
- Topics: airflow, scala, spark
- Language: Scala
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# commerce-sessionization
### Environment
- Airflow
- DataProc본인의 경우 `Airflow`, `DataProc` GCE 환경에서 진행하였습니다.
### Data Source / Load
- https://www.kaggle.com/datasets/mkechinov/ecommerce-behavior-data-from-multi-category-store
`DailyFileDivider.scala` 파일 내 코드를 다음과 같이 변경해 데이터 적재
예시는 +1877일 데이터, 2019년 10월 01일 -> 2024년 11월 20일 데이터 변환 후 적재
```scala
val hourlyDf = df
.withColumn(
"event_time",
from_unixtime(
unix_timestamp(
$"event_time",
"yyyy-MM-dd HH:mm:ss 'UTC'"
) + (1877L * 24 * 60 * 60),
"yyyy-MM-dd HH:mm:ss 'UTC'"
)
)
```### Jar Compile
`build.sbt` 파일 내 다음과 같이 추가하여 mainClass 명시, `sbt assembly` 실행
```sbt
mainClass := Some("SessionizationBuiltIn")
assembly / assemblyJarName := "SessionizationBuiltIn.jar"
```