-
Notifications
You must be signed in to change notification settings - Fork 97
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
fix(go/adbc/driver/snowflake): handle empty result sets #1805
Conversation
} else { | ||
schema, err := rowTypesToArrowSchema(ctx, ld, useHighPrecision) | ||
if err != nil { | ||
return nil, err | ||
} | ||
rdr.schema, _ = getTransformer(schema, ld, useHighPrecision) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this a bit more readable by flipping the condition and then just returning early in this case?
if len(batches) == 0 {
schema, err := rowTypesToArrowSchema(ctx, ld, useHighPrecision)
if err != nil {
return nil, err
}
rdr.schema, _ = getTransformer(schema, ld, useHighPrecision)
return rdr, nil
}
// rest of code for channel management
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could even skip all of the channel creation etc. for this case too most likely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM should we add a pure go test for the same?
Added! |
Fixes #1804.