You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "kou (via GitHub)" <gi...@apache.org> on 2023/05/09 14:37:38 UTC

[GitHub] [arrow-adbc] kou opened a new issue, #666: c/driver/sqlite: GetObjects with PRIMARY KEY failed

kou opened a new issue, #666:
URL: https://github.com/apache/arrow-adbc/issues/666

   For example, `GetObjects` against the following table failed:
   
   ```sql
   CREATE TABLE a (id INTEGER PRIMARY KEY);
   ```
   
   Error message:
   
   ```text
   ArrowArrayFinishElement(table_constraints_items) failed: (22) Invalid argument (ADBC::Error::Internal)
   Detail: c/driver/sqlite/sqlite.c:740
   ```


-- 
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: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-adbc] kou commented on issue #666: c/driver/sqlite: GetObjects with PRIMARY KEY failed

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on issue #666:
URL: https://github.com/apache/arrow-adbc/issues/666#issuecomment-1540268560

   This may help anyone who wants to work on this...
   
   ```diff
   diff --git a/c/driver/sqlite/sqlite.c b/c/driver/sqlite/sqlite.c
   index 43f9d98..d3ff393 100644
   --- a/c/driver/sqlite/sqlite.c
   +++ b/c/driver/sqlite/sqlite.c
   @@ -695,7 +695,7 @@ AdbcStatusCode SqliteConnectionGetConstraintsImpl(
        sqlite3_stmt* fk_stmt, struct AdbcError* error) {
      struct ArrowArray* table_constraints_items = table_constraints_col->children[0];
      struct ArrowArray* constraint_name_col = table_constraints_items->children[0];
   -  // Constraints type column would be table_constraints_items->children[1];
   +  struct ArrowArray* constraint_type_col = table_constraints_items->children[1];
      struct ArrowArray* constraint_column_names_col = table_constraints_items->children[2];
      struct ArrowArray* constraint_column_names_items =
          constraint_column_names_col->children[0];
   @@ -723,7 +723,7 @@ AdbcStatusCode SqliteConnectionGetConstraintsImpl(
          has_primary_key = 1;
          CHECK_NA(INTERNAL, ArrowArrayAppendNull(constraint_name_col, 1), error);
          CHECK_NA(INTERNAL,
   -               ArrowArrayAppendString(constraint_name_col, ArrowCharView("PRIMARY KEY")),
   +               ArrowArrayAppendString(constraint_type_col, ArrowCharView("PRIMARY KEY")),
                   error);
        }
        CHECK_NA(
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-adbc] lidavidm closed issue #666: c/driver/sqlite: GetObjects with PRIMARY KEY failed

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm closed issue #666: c/driver/sqlite: GetObjects with PRIMARY KEY failed
URL: https://github.com/apache/arrow-adbc/issues/666


-- 
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: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org