Skip to content

Commit

Permalink
format hive.go and hive_test.go (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
beltran committed Oct 9, 2021
1 parent 21bdcb2 commit 1289375
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
15 changes: 7 additions & 8 deletions hive.go
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ func newCookieJar() inMemoryCookieJar {
}

func safeStatus(status *hiveserver.TStatus) *hiveserver.TStatus {
if (status == nil) {
if status == nil {
return &DEFAULT_STATUS
}
return status
Expand All @@ -1189,11 +1189,10 @@ func safeStatus(status *hiveserver.TStatus) *hiveserver.TStatus {
var DEFAULT_SQL_STATE = ""
var DEFAULT_ERROR_CODE = int32(-1)
var DEFAULT_ERROR_MESSAGE = "unknown error"
var DEFAULT_STATUS = hiveserver.TStatus {
StatusCode: hiveserver.TStatusCode_ERROR_STATUS,
InfoMessages: nil,
SqlState: &DEFAULT_SQL_STATE,
ErrorCode: &DEFAULT_ERROR_CODE,
ErrorMessage: &DEFAULT_ERROR_MESSAGE,
var DEFAULT_STATUS = hiveserver.TStatus{
StatusCode: hiveserver.TStatusCode_ERROR_STATUS,
InfoMessages: nil,
SqlState: &DEFAULT_SQL_STATE,
ErrorCode: &DEFAULT_ERROR_CODE,
ErrorMessage: &DEFAULT_ERROR_MESSAGE,
}

5 changes: 2 additions & 3 deletions hive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func TestConnectDefault(t *testing.T) {
connection.Close()
}


func TestConnectZookeeper(t *testing.T) {
configuration := NewConnectConfiguration()
configuration.Service = "hive"
Expand Down Expand Up @@ -681,10 +680,10 @@ func TestFetchLogs(t *testing.T) {
func TestFetchLogsDuringExecution(t *testing.T) {
connection, cursor := prepareTable(t, 2, 1000)
// Buffered so we only have to read at end

logs := make(chan []string, 30)
defer close(logs)

cursor.Logs = logs
cursor.Execute(context.Background(), "SELECT * FROM pokes", false)
if cursor.Error() != nil {
Expand Down

0 comments on commit 1289375

Please sign in to comment.