{"id":13707951,"url":"https://github.com/dazheng/SparkETL","last_synced_at":"2025-05-06T07:31:17.813Z","repository":{"id":41020134,"uuid":"204945168","full_name":"dazheng/SparkETL","owner":"dazheng","description":"Implement a complete data warehouse etl using spark SQL","archived":false,"fork":false,"pushed_at":"2022-09-08T01:07:07.000Z","size":135,"stargazers_count":13,"open_issues_count":7,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-13T17:45:21.347Z","etag":null,"topics":["datawarehouse","etl","spark","sparksql"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dazheng.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-28T14:00:13.000Z","updated_at":"2023-01-16T09:28:25.000Z","dependencies_parsed_at":"2023-01-18T00:00:48.311Z","dependency_job_id":null,"html_url":"https://github.com/dazheng/SparkETL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazheng%2FSparkETL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazheng%2FSparkETL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazheng%2FSparkETL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazheng%2FSparkETL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dazheng","download_url":"https://codeload.github.com/dazheng/SparkETL/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252639972,"owners_count":21780849,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datawarehouse","etl","spark","sparksql"],"created_at":"2024-08-02T22:01:50.448Z","updated_at":"2025-05-06T07:31:17.469Z","avatar_url":"https://github.com/dazheng.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# SparkETL\n主要运用spark SQL实现数据仓库etl。从extract、transform到导出到其他数据库，基本是写sql方式实现。\n实现从数据库抽取数据，在spark上实现etl主逻辑，将数据仓库加工后的数据再导入到RdbMS中供后续使用。sql满足不了的再需要调用spark接口实现。\n## 公共约定\n* 数据库、文件、程序数据处理等需要指定字符集的都是UTF-8\n* 事实表以时间分区的,分区键都是time_type,time_id\n\n## 环境\n* CentOS 7.7\n* OpenJDK 1.8.0_242\n* CDH6.3.2\n### DB\n* Oracle 19c\n* MySQL 8.0.19\n* SQLServer 2019 Developer\n* PostgreSQL 12.2  \n* DB2 11.5 # TODO\n* MongoDB 4.2.5  # TODO\n* Elasticsearch 7.6.2 # 用hive表映射方式，参考： https://www.elastic.co/guide/en/elasticsearch/hadoop/current/hive.html\n* Redis 5.0.8 # TODO\n* Apache Kudu 1.10.0 # TODO\n\n## 数据\n* github：https://github.com/wuda0112/mysql-tester\n* 生成数据：java -jar mysql-tester-1.0.1.jar --mysql-username=test --mysql-password=Test123$ --user-count=1000 --max-item-per-user=100 --thread=10 --mysql-url=jdbc:mysql://127.0.0.1:3306/?serverTimezone=UTC\u0026characterEncoding=UTF-8 \n\n## 调用\nspark-submit --master yarn --class etl.App --driver-memory 512m --executor-memory 512m /dp/bin/etl.jar prod 1 2020-03-23\n### idea远程调试\nspark-submit --master yarn --class etl.App --driver-memory 512m --executor-memory 512m --driver-java-options \"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005\" /dp/bin/etl.jar  prod 1 2020-03-23\n\n## 记录应用日志\n/etc/spark/conf/log4j.properties 增加\n```\nlog4j.logger.etl=DEBUG,rollingFile\nlog4j.appender.rollingFile=org.apache.log4j.RollingFileAppender\nlog4j.appender.rollingFile.Threshold=DEBUG\nlog4j.appender.rollingFile.ImmediateFlush=true\nlog4j.appender.rollingFile.Append=true\nlog4j.appender.rollingFile.File=/dp/log/etl.log\nlog4j.appender.rollingFile.MaxFileSize=50MB\nlog4j.appender.rollingFile.MaxBackupIndex=5\nlog4j.appender.rollingFile.layout=org.apache.log4j.PatternLayout\nlog4j.appender.rollingFile.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} [%p] %m%n\n```\n## 具体使用方式见\n[SparkETL 用Spark SQL实现ETL](https://blog.csdn.net/dazheng/article/details/105370358)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdazheng%2FSparkETL","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdazheng%2FSparkETL","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdazheng%2FSparkETL/lists"}