Skip to content

Commit

Permalink
Upgrade Thrift to 0.14.1 and Hive to v3.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyroussel committed Jul 22, 2022
1 parent bf1c180 commit d01a794
Show file tree
Hide file tree
Showing 8 changed files with 11,806 additions and 5,531 deletions.
9 changes: 5 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ module sqlflow.org/gohive
go 1.18

require (
github.com/apache/thrift v0.12.0
github.com/beltran/gohive v1.3.0
github.com/apache/thrift v0.14.1
github.com/beltran/gohive v1.5.3
github.com/stretchr/testify v1.7.1
)

require (
github.com/beltran/gosasl v0.0.0-20200715011608-d5475aebb293 // indirect
github.com/beltran/gosasl v0.0.0-20220331024818-65cde6a69a35 // indirect
github.com/beltran/gssapi v0.0.0-20200324152954-d86554db4bab // indirect
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/go-zookeeper/zk v1.0.1 // indirect
github.com/go-zookeeper/zk v1.0.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
16 changes: 10 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
github.com/apache/thrift v0.12.0 h1:pODnxUFNcjP9UTLZGTdeh+j16A8lJbRvD3rOtrk/7bs=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/beltran/gohive v1.3.0 h1:7e1TGJ/F/mMpoZ1JLevHkoqc0iQnxwEN9y8gn9uKoqU=
github.com/beltran/gohive v1.3.0/go.mod h1:TcPLlZLQbom57zWZpiG25iG9DFbyJgl/W4NbYlqMD5E=
github.com/beltran/gosasl v0.0.0-20200715011608-d5475aebb293 h1:1wRvU44e78w7zJoynLqrXLKSI+VEFEaWmzyq5JdUx7I=
github.com/apache/thrift v0.14.1 h1:Yh8v0hpCj63p5edXOLaqTJW0IJ1p+eMW6+YSOqw1d6s=
github.com/apache/thrift v0.14.1/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/beltran/gohive v1.5.3 h1:fGvLt4IoVbXMbg4B14igkwCd435ODug95C9tQcbKCmg=
github.com/beltran/gohive v1.5.3/go.mod h1:BJbXAhof7gWk5+kl0y6Ox8TFDJ1xv6gwDksF7l15LFI=
github.com/beltran/gosasl v0.0.0-20200715011608-d5475aebb293/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes=
github.com/beltran/gosasl v0.0.0-20220331024818-65cde6a69a35 h1:iQwgRNFGmoKDj0bCxzMOxaT7EHFVFArnm20WqHHvuKE=
github.com/beltran/gosasl v0.0.0-20220331024818-65cde6a69a35/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes=
github.com/beltran/gssapi v0.0.0-20200324152954-d86554db4bab h1:ayfcn60tXOSYy5zUN1AMSTQo4nJCf7hrdzAVchpPst4=
github.com/beltran/gssapi v0.0.0-20200324152954-d86554db4bab/go.mod h1:GLe4UoSyvJ3cVG+DVtKen5eAiaD8mAJFuV5PT3Eeg9Q=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-zookeeper/zk v1.0.1 h1:LmXNmSnkNsNKai+aDu6sHRr8ZJzIrHJo8z8Z4sm8cT8=
github.com/go-zookeeper/zk v1.0.1/go.mod h1:gpJdHazfkmlg4V0rt0vYeHYJHSL8hHFwV0qOd+HRTJE=
github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg=
github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
12 changes: 9 additions & 3 deletions hiveserver2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

For the convenience to access Hive from clients in various languages, the Hive developers created Hive Server, which is a Thrift service. The currently well-used version is known as Hive Server 2.

To write a Hive Server 2 client in Go, we need to use the `thrift` command to compile the Thrift service definition file [`TCLIService.thrift`](https://github.com/apache/hive/blob/master/service-rpc/if/TCLIService.thrift) from Hive Server 2 codebase, into Go source code.
To write a Hive Server 2 client in Go, we need to use the `thrift` command to compile the Thrift service definition file [`TCLIService.thrift`](https://github.com/apache/hive/blob/master/service-rpc/if/TCLIService.thrift) from Hive Server 2 codebase, into Go source code:

According to their [blog post](https://cwiki.apache.org/confluence/display/Hive/HowToContribute), the Hive developers for some reasons locks the Thrift version to 0.9.3, which is pretty old that you might not want to install it on your computer. Thanks to the Thrift team, who releases Thrift in Docker images and we can use the 0.9.3 version of Docker image for the compilation:
```bash
curl -sS https://raw.githubusercontent.com/apache/hive/rel/release-3.1.3/service-rpc/if/TCLIService.thrift > TCLIService.thrift
```

According to their [blog post](https://cwiki.apache.org/confluence/display/Hive/HowToContribute#HowToContribute-GeneratingThriftCode), the Hive developers recommends to use Thrift v0.14.1 to generate the Hive's auto-generated Thrift code:

```bash
docker run --rm -it -v $PWD:/work -w /work thrift:0.9.3 thrift -r --gen go TCLIService.thrift
docker run --rm -it -v $PWD:/work -w /work \
anthonyroussel/thrift:0.14.1 \
thrift -r --gen go TCLIService.thrift
```

The above command generates Go source code in the subdirectory `./gen-go/tcliservice`.
Expand Down
Loading

0 comments on commit d01a794

Please sign in to comment.