zeroshade commented on code in PR #980:
URL: https://github.com/apache/arrow-adbc/pull/980#discussion_r1301938459


##########
go/adbc/driver/flightsql/flightsql_adbc.go:
##########
@@ -1231,24 +1231,42 @@ func (c *cnxn) GetTableSchema(ctx context.Context, 
catalog *string, dbSchema *st
                return nil, adbcFromFlightStatus(err, "GetTableSchema(DoGet)")
        }
 
-       if rec.NumRows() == 0 {
+       numRows := rec.NumRows()
+       if numRows == 0 {
                return nil, adbc.Error{
                        Code: adbc.StatusNotFound,
                }
        }
+       if numRows > math.MaxInt32 {
+               return nil, adbc.Error{
+                       Msg:  "[Flight SQL] GetTableSchema cannot handle tables 
with number of rows > 2^31 - 1",
+                       Code: adbc.StatusNotImplemented,
+               }
+       }

Review Comment:
   From a stylistic perspective, let's use a switch
   
   ```go
   switch {
   case numRows == 0:
       return.....
   case numRows > math.MaxInt32:
       return.....
   }
   ```



-- 
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]

Reply via email to