From 9c6eb42d313126f7e74dbecffc9220c37fe697d5 Mon Sep 17 00:00:00 2001 From: Joel Lubinitsky Date: Wed, 15 Nov 2023 09:47:26 -0500 Subject: [PATCH 1/9] Implement GetTableSchema --- go/adbc/drivermgr/wrapper.go | 40 +++++++++++++++++++++++- go/adbc/drivermgr/wrapper_sqlite_test.go | 31 ++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/go/adbc/drivermgr/wrapper.go b/go/adbc/drivermgr/wrapper.go index 1e131e51c7..aa33beb7a5 100644 --- a/go/adbc/drivermgr/wrapper.go +++ b/go/adbc/drivermgr/wrapper.go @@ -186,6 +186,19 @@ func getRdr(out *C.struct_ArrowArrayStream) (array.RecordReader, error) { return rdr.(array.RecordReader), nil } +func getSchema(out *C.struct_ArrowSchema) (*arrow.Schema, error) { + // Maybe: ImportCArrowSchema should perform this check? + if out.format == nil { + return nil, nil + } + + schema, err := cdata.ImportCArrowSchema((*cdata.CArrowSchema)(unsafe.Pointer(out))) + if err != nil { + return nil, err + } + return schema, nil +} + type cnxn struct { conn *C.struct_AdbcConnection } @@ -255,7 +268,32 @@ func (c *cnxn) GetObjects(_ context.Context, depth adbc.ObjectDepth, catalog, db } func (c *cnxn) GetTableSchema(_ context.Context, catalog, dbSchema *string, tableName string) (*arrow.Schema, error) { - return nil, &adbc.Error{Code: adbc.StatusNotImplemented} + var ( + schema C.struct_ArrowSchema + err C.struct_AdbcError + catalog_ *C.char + dbSchema_ *C.char + tableName_ *C.char + ) + + if catalog != nil { + catalog_ = C.CString(*catalog) + defer C.free(unsafe.Pointer(catalog_)) + } + + if dbSchema != nil { + dbSchema_ = C.CString(*dbSchema) + defer C.free(unsafe.Pointer(dbSchema_)) + } + + tableName_ = C.CString(tableName) + defer C.free(unsafe.Pointer(tableName_)) + + if code := adbc.Status(C.AdbcConnectionGetTableSchema(c.conn, catalog_, dbSchema_, tableName_, &schema, &err)); code != adbc.StatusOK { + return nil, toAdbcError(code, &err) + } + + return getSchema(&schema) } func (c *cnxn) GetTableTypes(context.Context) (array.RecordReader, error) { diff --git a/go/adbc/drivermgr/wrapper_sqlite_test.go b/go/adbc/drivermgr/wrapper_sqlite_test.go index 580b046731..d139d8dc3d 100644 --- a/go/adbc/drivermgr/wrapper_sqlite_test.go +++ b/go/adbc/drivermgr/wrapper_sqlite_test.go @@ -334,6 +334,37 @@ func (dm *DriverMgrSuite) TestGetObjectsTableType() { dm.False(rdr.Next()) } +func (dm *DriverMgrSuite) TestGetTableSchema() { + schema, err := dm.conn.GetTableSchema(dm.ctx, nil, nil, "test_table") + dm.NoError(err) + + expSchema := arrow.NewSchema( + []arrow.Field{ + {Name: "id", Type: arrow.PrimitiveTypes.Int64, Nullable: true}, + {Name: "name", Type: arrow.PrimitiveTypes.Int64, Nullable: true}, // Should be arrow.BinaryTypes.String + }, nil) + dm.True(expSchema.Equal(schema)) +} + +func (dm *DriverMgrSuite) TestGetTableSchemaInvalidTable() { + _, err := dm.conn.GetTableSchema(dm.ctx, nil, nil, "unknown_table") + dm.Error(err) +} + +func (dm *DriverMgrSuite) TestGetTableSchemaCatalog() { + catalog := "does_not_exist" + schema, err := dm.conn.GetTableSchema(dm.ctx, &catalog, nil, "test_table") + dm.NoError(err) + dm.Nil(schema) +} + +func (dm *DriverMgrSuite) TestGetTableSchemaDBSchema() { + dbSchema := "does_not_exist" + schema, err := dm.conn.GetTableSchema(dm.ctx, nil, &dbSchema, "test_table") + dm.NoError(err) + dm.Nil(schema) +} + func (dm *DriverMgrSuite) TestSqlExecute() { query := "SELECT 1" st, err := dm.conn.NewStatement() From 74ec62d50b5c4e52d7d12e62fbc588ccef1da751 Mon Sep 17 00:00:00 2001 From: Joel Lubinitsky Date: Wed, 15 Nov 2023 10:21:24 -0500 Subject: [PATCH 2/9] Implement GetTableTypes --- go/adbc/drivermgr/wrapper.go | 10 +++++++++- go/adbc/drivermgr/wrapper_sqlite_test.go | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/go/adbc/drivermgr/wrapper.go b/go/adbc/drivermgr/wrapper.go index aa33beb7a5..cdc0683275 100644 --- a/go/adbc/drivermgr/wrapper.go +++ b/go/adbc/drivermgr/wrapper.go @@ -297,7 +297,15 @@ func (c *cnxn) GetTableSchema(_ context.Context, catalog, dbSchema *string, tabl } func (c *cnxn) GetTableTypes(context.Context) (array.RecordReader, error) { - return nil, &adbc.Error{Code: adbc.StatusNotImplemented} + var ( + out C.struct_ArrowArrayStream + err C.struct_AdbcError + ) + + if code := adbc.Status(C.AdbcConnectionGetTableTypes(c.conn, &out, &err)); code != adbc.StatusOK { + return nil, toAdbcError(code, &err) + } + return getRdr(&out) } func (c *cnxn) Commit(context.Context) error { diff --git a/go/adbc/drivermgr/wrapper_sqlite_test.go b/go/adbc/drivermgr/wrapper_sqlite_test.go index d139d8dc3d..98acd9399b 100644 --- a/go/adbc/drivermgr/wrapper_sqlite_test.go +++ b/go/adbc/drivermgr/wrapper_sqlite_test.go @@ -365,6 +365,24 @@ func (dm *DriverMgrSuite) TestGetTableSchemaDBSchema() { dm.Nil(schema) } +func (dm *DriverMgrSuite) TestGetTableTypes() { + rdr, err := dm.conn.GetTableTypes(dm.ctx) + dm.NoError(err) + defer rdr.Release() + + expSchema := adbc.TableTypesSchema + dm.True(expSchema.Equal(rdr.Schema())) + dm.True(rdr.Next()) + + rec := rdr.Record() + dm.Equal(int64(2), rec.NumRows()) + + expTableTypes := []string{"table", "view"} + dm.Contains(expTableTypes, rec.Column(0).ValueStr(0)) + dm.Contains(expTableTypes, rec.Column(0).ValueStr(1)) + dm.False(rdr.Next()) +} + func (dm *DriverMgrSuite) TestSqlExecute() { query := "SELECT 1" st, err := dm.conn.NewStatement() From c6b2c39dc4dfc142b95fe881a9b19453caefd69b Mon Sep 17 00:00:00 2001 From: Joel Lubinitsky Date: Wed, 15 Nov 2023 13:23:21 -0500 Subject: [PATCH 3/9] Implement Commit --- go/adbc/drivermgr/wrapper.go | 10 +++++++++- go/adbc/drivermgr/wrapper_sqlite_test.go | 21 ++++++++++++++++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/go/adbc/drivermgr/wrapper.go b/go/adbc/drivermgr/wrapper.go index cdc0683275..2a9ed89dce 100644 --- a/go/adbc/drivermgr/wrapper.go +++ b/go/adbc/drivermgr/wrapper.go @@ -309,7 +309,15 @@ func (c *cnxn) GetTableTypes(context.Context) (array.RecordReader, error) { } func (c *cnxn) Commit(context.Context) error { - return &adbc.Error{Code: adbc.StatusNotImplemented} + var ( + err C.struct_AdbcError + ) + + if code := adbc.Status(C.AdbcConnectionCommit(c.conn, &err)); code != adbc.StatusOK { + return toAdbcError(code, &err) + } + + return nil } func (c *cnxn) Rollback(context.Context) error { diff --git a/go/adbc/drivermgr/wrapper_sqlite_test.go b/go/adbc/drivermgr/wrapper_sqlite_test.go index 98acd9399b..057b24b8f8 100644 --- a/go/adbc/drivermgr/wrapper_sqlite_test.go +++ b/go/adbc/drivermgr/wrapper_sqlite_test.go @@ -53,11 +53,11 @@ func (dm *DriverMgrSuite) SetupSuite() { }) dm.NoError(err) - db, err := dm.db.Open(dm.ctx) + cnxn, err := dm.db.Open(dm.ctx) dm.NoError(err) - defer db.Close() + defer cnxn.Close() - stmt, err := db.NewStatement() + stmt, err := cnxn.NewStatement() dm.NoError(err) defer stmt.Close() @@ -383,6 +383,21 @@ func (dm *DriverMgrSuite) TestGetTableTypes() { dm.False(rdr.Next()) } +func (dm *DriverMgrSuite) TestCommit() { + err := dm.conn.Commit(dm.ctx) + dm.Error(err) + dm.ErrorContains(err, "No active transaction, cannot commit") +} + +func (dm *DriverMgrSuite) TestCommitAutocommitDisabled() { + cnxnopt, ok := dm.conn.(adbc.PostInitOptions) + dm.True(ok) + + cnxnopt.SetOption(adbc.OptionKeyAutoCommit, adbc.OptionValueDisabled) + err := dm.conn.Commit(dm.ctx) + dm.NoError(err) +} + func (dm *DriverMgrSuite) TestSqlExecute() { query := "SELECT 1" st, err := dm.conn.NewStatement() From 1a9703863782a60742611f64c81b5807911d1ec5 Mon Sep 17 00:00:00 2001 From: Joel Lubinitsky Date: Wed, 15 Nov 2023 13:25:40 -0500 Subject: [PATCH 4/9] Implement Rollback --- go/adbc/drivermgr/wrapper.go | 10 +++++++++- go/adbc/drivermgr/wrapper_sqlite_test.go | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/go/adbc/drivermgr/wrapper.go b/go/adbc/drivermgr/wrapper.go index 2a9ed89dce..f1b13984f4 100644 --- a/go/adbc/drivermgr/wrapper.go +++ b/go/adbc/drivermgr/wrapper.go @@ -321,7 +321,15 @@ func (c *cnxn) Commit(context.Context) error { } func (c *cnxn) Rollback(context.Context) error { - return &adbc.Error{Code: adbc.StatusNotImplemented} + var ( + err C.struct_AdbcError + ) + + if code := adbc.Status(C.AdbcConnectionRollback(c.conn, &err)); code != adbc.StatusOK { + return toAdbcError(code, &err) + } + + return nil } func (c *cnxn) NewStatement() (adbc.Statement, error) { diff --git a/go/adbc/drivermgr/wrapper_sqlite_test.go b/go/adbc/drivermgr/wrapper_sqlite_test.go index 057b24b8f8..207941cb72 100644 --- a/go/adbc/drivermgr/wrapper_sqlite_test.go +++ b/go/adbc/drivermgr/wrapper_sqlite_test.go @@ -398,6 +398,21 @@ func (dm *DriverMgrSuite) TestCommitAutocommitDisabled() { dm.NoError(err) } +func (dm *DriverMgrSuite) TestRollback() { + err := dm.conn.Rollback(dm.ctx) + dm.Error(err) + dm.ErrorContains(err, "No active transaction, cannot rollback") +} + +func (dm *DriverMgrSuite) TestRollbackAutocommitDisabled() { + cnxnopt, ok := dm.conn.(adbc.PostInitOptions) + dm.True(ok) + + cnxnopt.SetOption(adbc.OptionKeyAutoCommit, adbc.OptionValueDisabled) + err := dm.conn.Rollback(dm.ctx) + dm.NoError(err) +} + func (dm *DriverMgrSuite) TestSqlExecute() { query := "SELECT 1" st, err := dm.conn.NewStatement() From 8a91b1ab4d3201821af677cc13cfb2fb02d22d8f Mon Sep 17 00:00:00 2001 From: Joel Lubinitsky Date: Wed, 15 Nov 2023 18:54:18 -0500 Subject: [PATCH 5/9] Implement GetParameterSchema --- go/adbc/drivermgr/wrapper.go | 11 ++++++++++- go/adbc/drivermgr/wrapper_sqlite_test.go | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/go/adbc/drivermgr/wrapper.go b/go/adbc/drivermgr/wrapper.go index f1b13984f4..fc95f11cf0 100644 --- a/go/adbc/drivermgr/wrapper.go +++ b/go/adbc/drivermgr/wrapper.go @@ -471,7 +471,16 @@ func (s *stmt) BindStream(_ context.Context, stream array.RecordReader) error { } func (s *stmt) GetParameterSchema() (*arrow.Schema, error) { - return nil, &adbc.Error{Code: adbc.StatusNotImplemented} + var ( + schema C.struct_ArrowSchema + err C.struct_AdbcError + ) + + if code := adbc.Status(C.AdbcStatementGetParameterSchema(s.st, &schema, &err)); code != adbc.StatusOK { + return nil, toAdbcError(code, &err) + } + + return getSchema(&schema) } func (s *stmt) ExecutePartitions(context.Context) (*arrow.Schema, adbc.Partitions, int64, error) { diff --git a/go/adbc/drivermgr/wrapper_sqlite_test.go b/go/adbc/drivermgr/wrapper_sqlite_test.go index 207941cb72..f5459069e2 100644 --- a/go/adbc/drivermgr/wrapper_sqlite_test.go +++ b/go/adbc/drivermgr/wrapper_sqlite_test.go @@ -508,6 +508,24 @@ func (dm *DriverMgrSuite) TestSqlPrepareMultipleParams() { dm.False(rdr.Next()) } +func (dm *DriverMgrSuite) TestGetParameterSchema() { + query := "SELECT ?1, ?2" + st, err := dm.conn.NewStatement() + dm.Require().NoError(err) + dm.Require().NoError(st.SetSqlQuery(query)) + defer st.Close() + + expSchema := arrow.NewSchema([]arrow.Field{ + {Name: "?1", Type: arrow.Null, Nullable: true}, + {Name: "?2", Type: arrow.Null, Nullable: true}, + }, nil) + + schema, err := st.GetParameterSchema() + dm.NoError(err) + + dm.True(expSchema.Equal(schema)) +} + func TestDriverMgr(t *testing.T) { suite.Run(t, new(DriverMgrSuite)) } From f45262bac61b68597443cd86a420a9026db1406c Mon Sep 17 00:00:00 2001 From: Joel Lubinitsky Date: Wed, 15 Nov 2023 19:50:59 -0500 Subject: [PATCH 6/9] Implement BindStream --- go/adbc/drivermgr/wrapper.go | 15 ++++++- go/adbc/drivermgr/wrapper_sqlite_test.go | 53 ++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/go/adbc/drivermgr/wrapper.go b/go/adbc/drivermgr/wrapper.go index fc95f11cf0..9f6795397d 100644 --- a/go/adbc/drivermgr/wrapper.go +++ b/go/adbc/drivermgr/wrapper.go @@ -32,6 +32,10 @@ package drivermgr // return (struct ArrowArray*)malloc(sizeof(struct ArrowArray)); // } // +// struct ArrowArrayStream* allocArrStream() { +// return (struct ArrowArrayStream*)malloc(sizeof(struct ArrowArrayStream)); +// } +// import "C" import ( "context" @@ -467,7 +471,16 @@ func (s *stmt) Bind(_ context.Context, values arrow.Record) error { } func (s *stmt) BindStream(_ context.Context, stream array.RecordReader) error { - return &adbc.Error{Code: adbc.StatusNotImplemented} + var ( + arrStream = C.allocArrStream() + cdArrStream = (*cdata.CArrowArrayStream)(unsafe.Pointer(arrStream)) + err C.struct_AdbcError + ) + cdata.ExportRecordReader(stream, cdArrStream) + if code := adbc.Status(C.AdbcStatementBindStream(s.st, arrStream, &err)); code != adbc.StatusOK { + return toAdbcError(code, &err) + } + return nil } func (s *stmt) GetParameterSchema() (*arrow.Schema, error) { diff --git a/go/adbc/drivermgr/wrapper_sqlite_test.go b/go/adbc/drivermgr/wrapper_sqlite_test.go index f5459069e2..9cf7b4567b 100644 --- a/go/adbc/drivermgr/wrapper_sqlite_test.go +++ b/go/adbc/drivermgr/wrapper_sqlite_test.go @@ -526,6 +526,59 @@ func (dm *DriverMgrSuite) TestGetParameterSchema() { dm.True(expSchema.Equal(schema)) } +func (dm *DriverMgrSuite) TestBindStream() { + query := "SELECT ?1, ?2" + st, err := dm.conn.NewStatement() + dm.Require().NoError(err) + dm.Require().NoError(st.SetSqlQuery(query)) + defer st.Close() + + schema := arrow.NewSchema([]arrow.Field{ + {Name: "1", Type: arrow.PrimitiveTypes.Int64, Nullable: true}, + {Name: "2", Type: arrow.BinaryTypes.String, Nullable: true}, + }, nil) + + bldr := array.NewRecordBuilder(memory.DefaultAllocator, schema) + defer bldr.Release() + + bldr.Field(0).(*array.Int64Builder).AppendValues([]int64{1, 2, 3}, nil) + bldr.Field(1).(*array.StringBuilder).AppendValues([]string{"one", "two", "three"}, nil) + + rec1 := bldr.NewRecord() + defer rec1.Release() + + bldr.Field(0).(*array.Int64Builder).AppendValues([]int64{4, 5, 6}, nil) + bldr.Field(1).(*array.StringBuilder).AppendValues([]string{"four", "five", "six"}, nil) + + rec2 := bldr.NewRecord() + defer rec2.Release() + + recsIn := []arrow.Record{rec1, rec2} + rdrIn, err := array.NewRecordReader(schema, recsIn) + + err = st.BindStream(dm.ctx, rdrIn) + dm.NoError(err) + + rdrOut, _, err := st.ExecuteQuery(dm.ctx) + dm.NoError(err) + defer rdrOut.Release() + + recsOut := make([]arrow.Record, 0, 0) + for rdrOut.Next() { + rec := rdrOut.Record() + rec.Retain() + defer rec.Release() + recsOut = append(recsOut, rec) + } + + tableIn := array.NewTableFromRecords(schema, recsIn) + defer tableIn.Release() + tableOut := array.NewTableFromRecords(schema, recsOut) + defer tableOut.Release() + + dm.Truef(array.TableEqual(tableIn, tableOut), "expected: %s\ngot: %s", tableIn, tableOut) +} + func TestDriverMgr(t *testing.T) { suite.Run(t, new(DriverMgrSuite)) } From cb1b193674e28a5bf0f9218b549490a0948833d5 Mon Sep 17 00:00:00 2001 From: Joel Lubinitsky Date: Thu, 16 Nov 2023 06:33:04 -0500 Subject: [PATCH 7/9] Cleanup tests --- go/adbc/drivermgr/wrapper_sqlite_test.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/go/adbc/drivermgr/wrapper_sqlite_test.go b/go/adbc/drivermgr/wrapper_sqlite_test.go index 9cf7b4567b..ed3a870d41 100644 --- a/go/adbc/drivermgr/wrapper_sqlite_test.go +++ b/go/adbc/drivermgr/wrapper_sqlite_test.go @@ -393,9 +393,8 @@ func (dm *DriverMgrSuite) TestCommitAutocommitDisabled() { cnxnopt, ok := dm.conn.(adbc.PostInitOptions) dm.True(ok) - cnxnopt.SetOption(adbc.OptionKeyAutoCommit, adbc.OptionValueDisabled) - err := dm.conn.Commit(dm.ctx) - dm.NoError(err) + dm.NoError(cnxnopt.SetOption(adbc.OptionKeyAutoCommit, adbc.OptionValueDisabled)) + dm.NoError(dm.conn.Commit(dm.ctx)) } func (dm *DriverMgrSuite) TestRollback() { @@ -408,9 +407,8 @@ func (dm *DriverMgrSuite) TestRollbackAutocommitDisabled() { cnxnopt, ok := dm.conn.(adbc.PostInitOptions) dm.True(ok) - cnxnopt.SetOption(adbc.OptionKeyAutoCommit, adbc.OptionValueDisabled) - err := dm.conn.Rollback(dm.ctx) - dm.NoError(err) + dm.NoError(cnxnopt.SetOption(adbc.OptionKeyAutoCommit, adbc.OptionValueDisabled)) + dm.NoError(dm.conn.Rollback(dm.ctx)) } func (dm *DriverMgrSuite) TestSqlExecute() { @@ -555,15 +553,15 @@ func (dm *DriverMgrSuite) TestBindStream() { recsIn := []arrow.Record{rec1, rec2} rdrIn, err := array.NewRecordReader(schema, recsIn) - - err = st.BindStream(dm.ctx, rdrIn) dm.NoError(err) + dm.NoError(st.BindStream(dm.ctx, rdrIn)) + rdrOut, _, err := st.ExecuteQuery(dm.ctx) dm.NoError(err) defer rdrOut.Release() - recsOut := make([]arrow.Record, 0, 0) + recsOut := make([]arrow.Record, 0) for rdrOut.Next() { rec := rdrOut.Record() rec.Retain() From 58d11f317fc868793200b7ef4f4299ca0a465d1e Mon Sep 17 00:00:00 2001 From: Joel Lubinitsky Date: Thu, 16 Nov 2023 08:16:45 -0500 Subject: [PATCH 8/9] Add data to sqlite table to fix type --- go/adbc/drivermgr/wrapper_sqlite_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/go/adbc/drivermgr/wrapper_sqlite_test.go b/go/adbc/drivermgr/wrapper_sqlite_test.go index ed3a870d41..c33adf2792 100644 --- a/go/adbc/drivermgr/wrapper_sqlite_test.go +++ b/go/adbc/drivermgr/wrapper_sqlite_test.go @@ -61,12 +61,17 @@ func (dm *DriverMgrSuite) SetupSuite() { dm.NoError(err) defer stmt.Close() - err = stmt.SetSqlQuery("CREATE TABLE test_table (id INTEGER PRIMARY KEY, name TEXT)") - dm.NoError(err) + dm.NoError(stmt.SetSqlQuery("CREATE TABLE test_table (id INTEGER PRIMARY KEY, name TEXT)")) nrows, err := stmt.ExecuteUpdate(dm.ctx) dm.NoError(err) dm.Equal(int64(0), nrows) + + dm.NoError(stmt.SetSqlQuery("INSERT INTO test_table (id, name) VALUES (1, 'test')")) + + nrows, err = stmt.ExecuteUpdate(dm.ctx) + dm.NoError(err) + dm.Equal(int64(1), nrows) } func (dm *DriverMgrSuite) SetupTest() { @@ -341,7 +346,7 @@ func (dm *DriverMgrSuite) TestGetTableSchema() { expSchema := arrow.NewSchema( []arrow.Field{ {Name: "id", Type: arrow.PrimitiveTypes.Int64, Nullable: true}, - {Name: "name", Type: arrow.PrimitiveTypes.Int64, Nullable: true}, // Should be arrow.BinaryTypes.String + {Name: "name", Type: arrow.BinaryTypes.String, Nullable: true}, }, nil) dm.True(expSchema.Equal(schema)) } From 0ad1fdc107813fd1eefe2ae943036a255af60fad Mon Sep 17 00:00:00 2001 From: Joel Lubinitsky Date: Fri, 17 Nov 2023 17:18:29 -0500 Subject: [PATCH 9/9] Simplify getSchema return --- go/adbc/drivermgr/wrapper.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/go/adbc/drivermgr/wrapper.go b/go/adbc/drivermgr/wrapper.go index 9f6795397d..07bb94b814 100644 --- a/go/adbc/drivermgr/wrapper.go +++ b/go/adbc/drivermgr/wrapper.go @@ -196,11 +196,7 @@ func getSchema(out *C.struct_ArrowSchema) (*arrow.Schema, error) { return nil, nil } - schema, err := cdata.ImportCArrowSchema((*cdata.CArrowSchema)(unsafe.Pointer(out))) - if err != nil { - return nil, err - } - return schema, nil + return cdata.ImportCArrowSchema((*cdata.CArrowSchema)(unsafe.Pointer(out))) } type cnxn struct {