https://github.com/yale8848/doris-stream-loader
Apache Doris Stream Loader Golang API
https://github.com/yale8848/doris-stream-loader
apache api doris golang golang-library loader stream
Last synced: over 1 year ago
JSON representation
Apache Doris Stream Loader Golang API
- Host: GitHub
- URL: https://github.com/yale8848/doris-stream-loader
- Owner: yale8848
- Created: 2019-07-30T10:07:03.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-31T06:26:14.000Z (almost 7 years ago)
- Last Synced: 2025-02-28T03:40:00.691Z (over 1 year ago)
- Topics: apache, api, doris, golang, golang-library, loader, stream
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 5
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## [Apache Doris](https://github.com/apache/incubator-doris) Stream Loader Golang API
[Stream-Load-Manual](https://github.com/apache/incubator-doris/wiki/Stream-Load-Manual) user curl command to load data, [doris-stream-loader](https://github.com/yale8848/doris-stream-loader.git) with Golang API code.
### Install
```bash
go get github.com/yale8848/doris-stream-loader@v0.1.4
```
### API
- Init
```go
ld:= doris.New(doris.LoadConfig{Host:"172.16.1.244:8030",DBName:"db_dxh",TableName:"dxh_log2",User:"root",Password:"123456"})
```
- Stream Load
```go
res,err:=ld.LoadByFile("data.txt",doris.WithLabel("001"),
doris.WithColumnSeparator(","))
CheckErr(err)
fmt.Printf("%+v\r\n",res)
```
- GET LABEL STATE
```go
res,err:=ld.LabelState("001")
CheckErr(err)
fmt.Printf("%+v\r\n",res)
```
- CANCEL LABEL
```go
res,err:=ld.LabelCancel("001")
CheckErr(err)
fmt.Printf("%+v\r\n",res)
```