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
361846fb
Commit
361846fb
authored
Apr 18, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.wanmeizhensuo.com/ML/ffm-baseline
parents
70dab241
725a21a8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
multi.py
tensnsorflow/multi.py
+19
-0
test.py
tensnsorflow/test.py
+4
-3
No files found.
tensnsorflow/multi.py
0 → 100644
View file @
361846fb
# -*- coding: utf-8 -*-
from
pyspark.sql
import
HiveContext
from
pyspark.context
import
SparkContext
from
pyspark.conf
import
SparkConf
import
pytispark.pytispark
as
pti
from
pyspark.sql
import
SQLContext
from
pyspark.sql
import
SparkSession
def
test
():
spark
=
SparkSession
.
builder
.
enableHiveSupport
()
.
getOrCreate
()
ti
=
pti
.
TiContext
(
spark
)
ti
.
tidbMapDatabase
(
"jerry_test"
)
spark
.
sql
(
"select device_id from esmm_pre_data limit 6"
)
.
show
(
6
)
if
__name__
==
'__main__'
:
test
()
\ No newline at end of file
tensnsorflow/test.py
View file @
361846fb
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
from
pyspark.sql
import
HiveContext
from
pyspark.sql
import
HiveContext
from
pyspark.context
import
SparkContext
from
pyspark.context
import
SparkContext
from
pyspark.conf
import
SparkConf
from
pyspark.conf
import
SparkConf
import
pytispark.pytispark
as
pti
from
pyspark.sql
import
SQLContext
from
pyspark.sql
import
SQLContext
from
pyspark.sql
import
SparkSession
from
pyspark.sql
import
SparkSession
# from py4j.java_gateway import java_import
# from py4j.java_gateway import java_import
...
@@ -25,10 +26,10 @@ from pyspark.sql import SparkSession
...
@@ -25,10 +26,10 @@ from pyspark.sql import SparkSession
def
test
():
def
test
():
conf
=
SparkConf
()
.
setAppName
(
"My App"
)
.
set
(
"spark.io.compression.codec"
,
"lzf"
)
conf
=
SparkConf
()
.
setAppName
(
"My App"
)
.
set
(
"spark.io.compression.codec"
,
"lzf"
)
sc
=
SparkContext
(
conf
=
conf
)
sc
=
SparkContext
(
conf
=
conf
)
hive_context
=
HiveContext
(
sc
)
hive_context
=
HiveContext
(
sc
)
spark
=
SparkSession
.
builder
.
enableHiveSupport
()
.
getOrCreate
()
from
pyspark.sql
import
SparkSession
ti
=
pti
.
TiContext
(
spark
)
ti
.
tidbMapDatabase
(
"jerry_test"
)
spark
=
SparkSession
.
builder
.
appName
(
"BinarizerExample"
)
.
enableHiveSupport
()
.
getOrCreate
()
spark
=
SparkSession
.
builder
.
appName
(
"BinarizerExample"
)
.
enableHiveSupport
()
.
getOrCreate
()
...
...
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