Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-spark-tag-4.0
Overview
Overview
Details
Activity
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
wangxiaokang
gic-spark-tag-4.0
Commits
3995a26c
Commit
3995a26c
authored
May 12, 2020
by
guos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员标签4.0
parent
43744d0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
DataSourceMongodb.java
...va/com/gic/spark/datasource/entity/DataSourceMongodb.java
+1
-1
DataSourceMysql.java
...java/com/gic/spark/datasource/entity/DataSourceMysql.java
+1
-1
No files found.
src/main/java/com/gic/spark/datasource/entity/DataSourceMongodb.java
View file @
3995a26c
...
...
@@ -53,7 +53,7 @@ public class DataSourceMongodb extends DataSourceEntity {
enterpriseList
.
toArray
(
enterpriseIds
);
Dataset
<
Row
>
dataset
=
MongodbRddManager
.
getInstance
().
getDocumentsByColumn
(
database
,
collection
,
partitionColumn
,
enterpriseIds
).
toDF
();
if
(!
isTableCreated
)
{
SparkHiveUtil
.
createHivePartitionTable
(
dataset
,
partitionColumn
,
getSchema
(),
database
+
"_"
+
collection
);
SparkHiveUtil
.
createHivePartitionTable
(
dataset
,
partitionColumn
,
getSchema
(),
database
+
"_"
+
collection
,
sparkSession
);
isTableCreated
=
true
;
}
HivePartitionUtil
.
saveDatasetToPartitionTable
(
sparkSession
,
dataset
,
getHiveTableName
());
...
...
src/main/java/com/gic/spark/datasource/entity/DataSourceMysql.java
View file @
3995a26c
...
...
@@ -51,7 +51,7 @@ public class DataSourceMysql extends DataSourceEntity {
SparkSession
sparkSession
=
SparkEnvManager
.
getInstance
().
getSparkSession
();
Dataset
<
Row
>
sourceDataset
=
datasource
.
buildRddManager
().
getDatasetByEnterpriseIds
(
targetTable
,
enterpriseList
,
null
,
null
).
repartition
(
new
Column
(
"enterprise_id"
));
SparkHiveUtil
.
createHivePartitionTable
(
sourceDataset
,
"enterprise_id"
,
getSchema
(),
datasource
.
getSchema
().
replaceAll
(
"\\."
,
"_"
)
+
"_"
+
targetTable
);
SparkHiveUtil
.
createHivePartitionTable
(
sourceDataset
,
"enterprise_id"
,
getSchema
(),
datasource
.
getSchema
().
replaceAll
(
"\\."
,
"_"
)
+
"_"
+
targetTable
,
sparkSession
);
HivePartitionUtil
.
saveDatasetToPartitionTable
(
sparkSession
,
sourceDataset
,
getHiveTableName
());
...
...
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