lidavidm commented on code in PR #2825:
URL: https://github.com/apache/arrow-adbc/pull/2825#discussion_r2110614725
##########
go/adbc/driver/snowflake/statement.go:
##########
@@ -83,30 +83,39 @@ func (st *statement) setQueryContext(ctx context.Context)
context.Context {
//
// A statement instance should not be used after Close is called.
func (st *statement) Close() error {
- if st.cnxn == nil {
- return adbc.Error{
- Msg: "statement already closed",
- Code: adbc.StatusInvalidState}
- }
+ err := internal.TraceSpan(context.Background(), st, "Close", func(ctx
context.Context, span trace.Span) error {
+ if st.cnxn == nil {
+ return adbc.Error{
+ Msg: "statement already closed",
+ Code: adbc.StatusInvalidState}
+ }
- if st.bound != nil {
- st.bound.Release()
- st.bound = nil
- } else if st.streamBind != nil {
- st.streamBind.Release()
- st.streamBind = nil
- }
- st.cnxn = nil
- return nil
+ if st.bound != nil {
+ st.bound.Release()
+ st.bound = nil
+ } else if st.streamBind != nil {
+ st.streamBind.Release()
+ st.streamBind = nil
+ }
+ st.cnxn = nil
+ return nil
+ })
+ return err
}
-func (st *statement) GetOption(key string) (string, error) {
- switch key {
- case OptionStatementQueryTag:
- return st.queryTag, nil
- default:
- return st.Base().GetOption(key)
- }
+func (st *statement) GetOption(key string) (value string, err error) {
+ err = internal.TraceSpan(context.Background(), st, "GetOption",
func(ctx context.Context, span trace.Span) error {
Review Comment:
Do we actually want to trace all these operations?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]