Hi, > The write into IoTDB is not implemented yet, but you can write the dataframe into TsFile using spark-tsfile-connector.
And then.... using the load script can help you load the tsfile into an IoTDB instance. @zesong, can we put the minimal version requirement of Spark on our doc or readme? @Fernando please look forward to 0.10.0 version (not released now), which improve the query performance hugely. Best, ----------------------------------- Xiangdong Huang School of Software, Tsinghua University 黄向东 清华大学 软件学院 Jialin Qiao <[email protected]> 于2020年3月26日周四 上午9:30写道: > Hi, > > The write into IoTDB is not implemented yet, but you can write the > dataframe into TsFile using spark-tsfile-connector. > TsFile is the data file format of IoTDB, just like Parquet and ORC. > > Here are some examples: > > > http://iotdb.apache.org/document/V0.9.x/UserGuide/7-Ecosystem%20Integration/3-Spark%20TsFile.html > > Thanks, > -- > Jialin Qiao > School of Software, Tsinghua University > > 乔嘉林 > 清华大学 软件学院 > > > -----原始邮件----- > > 发件人: "Fernando Antunes" <[email protected]> > > 发送时间: 2020-03-26 02:28:36 (星期四) > > 收件人: [email protected] > > 抄送: > > 主题: Re: TsFile-Spark-Connector > > > > Zesong Sun, It works. Thanks. > > > > I have installed IOTDB 0.9.1, Grafana 6.7.1.1, IOTDB-Grafana, and > Spark-IOTDB Connector. > > > > Successfully query IOTBD using Spark using the example into IOTDB web > page. > > > > > > scala> import org.apache.iotdb.spark.db._ > > import org.apache.iotdb.spark.db._ > > > > scala> val df = > spark.read.format("org.apache.iotdb.spark.db").option("url","jdbc:iotdb://xxxxx:6667/").option("sql","select > * from root").load > > df: org.apache.spark.sql.DataFrame = [Time: bigint, > root.ln.wf01.wt01.status: boolean ... 1 more field] > > > > scala> df.printSchema() > > root > > |-- Time: long (nullable = false) > > |-- root.ln.wf01.wt01.status: boolean (nullable = true) > > |-- root.ln.wf01.wt01.temperature: float (nullable = true) > > > > > > scala> df.show() > > +----+------------------------+-----------------------------+ > > > |Time|root.ln.wf01.wt01.status|root.ln.wf01.wt01.temperature| > > +----+------------------------+-----------------------------+ > > | 100| true| null| > > | 200| false| 20.71| > > +----+------------------------+-----------------------------+ > > > > A question. > > > > Can Spark insert data into IOTDB ? > > > > Could you provide same example ? > > > > > > > > > On 29 Feb 2020, at 06:29, Fernando Antunes <[email protected]> > wrote: > > > > > > Very good. I will try and keep in touch. > > > > > > Thanks. Have a ince weekend. > > > > > > > > >> On 28 Feb 2020, at 22:11, 孙泽嵩 <[email protected]> wrote: > > >> > > >> Hi, > > >> > > >> Thanks for your concern very much! > > >> > > >> You could use spark-iotdb / spark-tsfile connector with 2.3.2 > version. (Actually, only < 2.2 version is not supported). > > >> > > >> If you meet any questions, don’t hesitate to ask and I’d like to help > you : ) > > >> > > >> > > >> Best, > > >> ----------------------------------- > > >> Zesong Sun > > >> School of Software, Tsinghua University > > >> > > >> 孙泽嵩 > > >> 清华大学 软件学院 > > >> > > >>> 2020年2月29日 03:50,Fernando Antunes <[email protected]> 写道: > > >>> > > >>> Hi. I’ve seen that Spark 2.4.3 is one of the System Requirements to > use this connector. > > >>> > > >>> I am a user of the HortonWorks/Cloudera software, and the Spark > version is 2.3.2 and Scala 2.11.12. > > >>> > > >>> Give some hope, please ! > > >>> > > >>> Is it possible to use TSFile or IoTDB with 2.3.2 version? Even with > some limitations? > > >>> > > >>> > > >> > > > > > >
