Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format hive.go and hive_test.go #165

Merged
merged 1 commit into from
Oct 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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