Skip to content

Commit 3fb634f

Browse files
committed
update readme
1 parent ff3380d commit 3fb634f

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

README.md

+2-22
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ mvn clean scala:compile compile package
121121

122122
```scala
123123
import cn.edu.thu.tsfile._
124-
import org.apache.spark.sql.SparkSession
125-
126-
val spark = SparkSession.builder().master("local").getOrCreate()
127124

128125
//read data in TsFile and create a table
129126
val df = spark.read.tsfile("test.tsfile")
@@ -140,9 +137,6 @@ mvn clean scala:compile compile package
140137

141138
```scala
142139
import cn.edu.thu.tsfile._
143-
import org.apache.spark.sql.SparkSession
144-
145-
val spark = SparkSession.builder().master("local").getOrCreate()
146140
val df = spark.read
147141
.format("cn.edu.thu.tsfile")
148142
.load("test.tsfile")
@@ -154,9 +148,6 @@ mvn clean scala:compile compile package
154148

155149
```scala
156150
import cn.edu.thu.tsfile._
157-
import org.apache.spark.sql.SparkSession
158-
159-
val spark = SparkSession.builder().master("local").getOrCreate()
160151

161152
//create a table in SparkSQL and build relation with a TsFile
162153
spark.sql("create temporary view TsFile using cn.edu.thu.tsfile options(path = \"test.tsfile\")")
@@ -169,10 +160,6 @@ mvn clean scala:compile compile package
169160

170161
```scala
171162
import cn.edu.thu.tsfile._
172-
import org.apache.spark.sql.SparkSession
173-
import scala.collection.mutable
174-
175-
val spark = SparkSession.builder().master("local").getOrCreate()
176163
177164
val df = spark.read.option("delta_object_name", "root.device.turbine").tsfile("test.tsfile")
178165
@@ -186,9 +173,6 @@ mvn clean scala:compile compile package
186173

187174
```scala
188175
import cn.edu.thu.tsfile._
189-
import org.apache.spark.sql.SparkSession
190-
191-
val spark = SparkSession.builder().master("local").getOrCreate()
192176

193177
val df = spark.read.tsfile("test.tsfile").write.tsfile("out")
194178

@@ -198,10 +182,6 @@ mvn clean scala:compile compile package
198182

199183
```scala
200184
import cn.edu.thu.tsfile._
201-
import org.apache.spark.sql.SparkSession
202-
import scala.collection.mutable
203-
204-
val spark = SparkSession.builder().master("local").getOrCreate()
205185
206186
val df = spark.read.option("delta_object_name", "root.device.turbine").tsfile("test.tsfile")
207187
@@ -212,9 +192,9 @@ mvn clean scala:compile compile package
212192
### 6.2 spark-shell
213193

214194
```
215-
$ bin/spark-shell --jars tsfile-spark-connector-0.1.0.jar,tsfile-0.1.0.jar
195+
$ bin/spark-shell --jars tsfile-spark-connector-0.4.0.jar,tsfile-0.4.0.jar
216196
217-
scala> sql("CREATE TEMPORARY TABLE TsFile_table USING cn.edu.thu.tsfile OPTIONS (path \"hdfs://localhost:9000/test1.tsfile\")")
197+
scala> sql("CREATE TEMPORARY TABLE TsFile_table USING cn.edu.thu.tsfile OPTIONS (path \"hdfs://localhost:9000/test.tsfile\")")
218198
219199
scala> val df = sql("select * from TsFile_table")
220200

0 commit comments

Comments
 (0)