You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "wjones127 (via GitHub)" <gi...@apache.org> on 2023/02/13 15:58:20 UTC

[GitHub] [arrow-adbc] wjones127 commented on issue #453: [C][Sqlite] bug: entries field in get_info result is nullable

wjones127 commented on issue #453:
URL: https://github.com/apache/arrow-adbc/issues/453#issuecomment-1428190261

   > Doesn't that make it non-nullable?
   
   I was pointing at where we set the keys to be non-nullable. The entries are one level up (the struct field inside of the map).
   
   So I'm saying we should also be setting:
   
   ```c
   info_value->children[5]->children[0]->flags &= ~ARROW_FLAG_NULLABLE; 
   ```
   
   > Did you observe a different schema?
   
   Yes. Basically I'm not able to write a schema that passes both integration tests with Sqlite *and* with a Rust-based test driver. There are a few other differences with field names, but this is the one difference were it seems like the Sqlite driver was producing the wrong schema.
   
   It's annoying to parse, but here is the output I saw if you are curious:
   ```
   from sqlite: `Schema { fields: [Field { name: "info_name", data_type: UInt32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "info_value", data_type: Union([Field { name: "string_value", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "bool_value", data_type: Boolean, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "int64_value", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "int32_bitmask", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "string_list", data_type: List(Field { name: "item", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "int32_to_int32_list_map", data_type: Map(Field { name: "entries", data_type: Struct([Field { name: "key
 ", data_type: Int32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "value", data_type: List(Field { name: "item", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, false), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }], [0, 1, 2, 3, 4, 5], Dense), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }], metadata: {} }`,
   expected   : `Schema { fields: [Field { name: "info_name", data_type: UInt32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "info_value", data_type: Union([Field { name: "string_value", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "bool_value", data_type: Boolean, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "int64_value", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "int32_bitmask", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "string_list", data_type: List(Field { name: "item", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "int32_to_int32_list_map", data_type: Map(Field { name: "entries", data_type: Struct([Field { name: "key
 s", data_type: Int32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "values", data_type: List(Field { name: "item", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]), nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, false), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }], [0, 1, 2, 3, 4, 5], Dense), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }], metadata: {} }`'
   ```


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