Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wanjia
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kino
wanjia
Commits
fea442f1
Commit
fea442f1
authored
Nov 06, 2020
by
kinomin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kino update
parent
68b11dd1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
Sinks.py
spark/sources/Sinks.py
+3
-0
Sources.py
spark/sources/Sources.py
+0
-1
No files found.
spark/sources/Sinks.py
View file @
fea442f1
...
@@ -2,6 +2,9 @@ from common import Constants
...
@@ -2,6 +2,9 @@ from common import Constants
import
os
import
os
# 写出到 MySQL
# 写出到 MySQL
from
sources
import
Sources
def
sinkMySql
(
sinkDF
,
driver
,
url
,
user
,
password
,
table
,
mode
=
Constants
.
SAVE_MODE_OVERWRITE
):
def
sinkMySql
(
sinkDF
,
driver
,
url
,
user
,
password
,
table
,
mode
=
Constants
.
SAVE_MODE_OVERWRITE
):
sinkDF
.
write
.
mode
(
mode
)
\
sinkDF
.
write
.
mode
(
mode
)
\
.
format
(
"jdbc"
)
\
.
format
(
"jdbc"
)
\
...
...
spark/sources/Sources.py
View file @
fea442f1
import
pymysql
import
pymysql
import
exception.MyErrorException
as
ex
from
pyspark
import
SparkContext
from
pyspark
import
SparkContext
from
sources
import
Sinks
from
sources
import
Sinks
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment