Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
8e7da259
Commit
8e7da259
authored
May 07, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改时间
parent
ae599471
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
19 deletions
+6
-19
data_feed_exposure_precise.scala
.../src/main/scala/com/gmei/data_feed_exposure_precise.scala
+6
-19
No files found.
eda/feededa/src/main/scala/com/gmei/data_feed_exposure_precise.scala
View file @
8e7da259
...
...
@@ -710,32 +710,19 @@ object tag_value {
val
level_index_temp
=
sc
.
sql
(
s
"""
|select a.tag_id,b.level1_id,b.level2_id,b.level3_id
|from online.tl_hdfs_diary_tags_view a
|left join online.bl_tag_hierarchy_detail b
|on a.tag_id = b.id
|where a.partition_date = '${partition_date}'
|and b.partition_date = '${partition_date}'
|select id as tag_id
|from online.bl_tag_hierarchy_detail
|where partition_date = '${partition_date}'
|and id !=0
"""
.
stripMargin
)
level_index_temp
.
createOrReplaceTempView
(
"level_index_temp"
)
val
temp1
=
sc
.
sql
(
s
"""
|select tag_id,level1_id as level_id
|from level_index_temp
|union all
|select tag_id,level2_id as level_id
|from level_index_temp
|union all
|select tag_id,level3_id as level_id
|from level_index_temp
"""
.
stripMargin
)
// temp1.createOrReplaceTempView("temp1")
// import implicit_
val
result
=
temp1
.
select
(
"tag_id"
).
distinct
().
rdd
.
map
{
x
=>
x
.
toString
().
substring
(
1
,
x
.
toString
().
length
-
1
)}.
zipWithIndex
().
toDF
(
"level_id"
,
"index"
)
val
result
=
level_index_temp
.
select
(
"tag_id"
).
distinct
().
rdd
.
map
{
x
=>
x
.
toString
().
substring
(
1
,
x
.
toString
().
length
-
1
)}.
zipWithIndex
().
toDF
(
"level_id"
,
"index"
)
val
test
=
result
.
select
(
result
.
col
(
"level_id"
).
cast
(
DoubleType
).
as
(
"level_id"
),
result
.
col
(
"index"
).
cast
(
DoubleType
).
as
(
"index"
))
// val resDf = spark.createDataFrame(rowRdd)
...
...
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