Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for data management and analysis, deployable on the edge and the cloud. Due to its light-weight architecture, high performance and rich feature set together with its deep integration with Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, high-speed data ingestion and complex data analysis in the IoT industrial fields.
This is the GoLang client of Apache IoTDB.
Apache IoTDB website: https://iotdb.apache.org Apache IoTDB Github: https://github.com/apache/iotdb
golang >= 1.13
With go mod
export GO111MODULE=on
export GOPROXY=https://goproxy.io
mkdir session_example && cd session_example
curl -o session_example.go -L https://github.com/apache/iotdb-client-go/raw/main/example/session_example.go
go mod init session_example
go run session_example.go
Without go mod
# get thrift 0.15.0
go get github.com/apache/thrift
cd $GOPATH/src/github.com/apache/thrift
git checkout 0.15.0
mkdir -p $GOPATH/src/iotdb-client-go-example/session_example
cd $GOPATH/src/iotdb-client-go-example/session_example
curl -o session_example.go -L https://github.com/apache/iotdb-client-go/raw/main/example/session_example.go
go run session_example.go
- Linux, Macos or other unix-like OS
- Windows+bash(WSL, cygwin, Git Bash)
- golang >= 1.13
- make >= 3.0
- curl >= 7.1.1
- thrift 0.15.0
In the branch rel/0.13
and earlier versions, the version of apache/thrift is v0.14.1
.
In the latest version, apache/thrift has been upgraded to v0.15.0
.
The two versions are not compatible on some interfaces. Using mismatched version will cause compilation errors.
The interfaces changed in the two versions are as follows:
NewTSocketConf
. This function returns two values in the versionv0.14.1
and only one value in the versionv0.15.0
.NewTFramedTransport
has been deprecated, useNewTFramedTransportConf
instead.
For more details, please take a look at this PR: update thrift to 0.15.0 to fit IoTDB 0.13.0
The implementation of the function client/session.go/Open()
is mismatched with the description.
The parameter connectionTimeoutInMs
represents connection timeout in milliseconds.
However, in the older version, this function did not implement correctly, regarding it as nanosecond instead.
The bug is now fixed.
Positive value of this parameter means connection timeout in milliseconds.
Set 0 for no timeout.