@@ -52,6 +52,8 @@ struct index_read_view_iterator;
5252struct index_def ;
5353struct key_def ;
5454struct info_handler ;
55+ struct arrow_options ;
56+ struct ArrowArrayStream ;
5557
5658typedef struct tuple box_tuple_t ;
5759typedef struct key_def box_key_def_t ;
@@ -657,6 +659,12 @@ struct index_vtab {
657659 uint32_t part_count,
658660 const char *pos,
659661 uint32_t offset);
662+ /* * Create an index Arrow stream. */
663+ int (*create_arrow_stream)(struct index *index,
664+ uint32_t field_count, const uint32_t *fields,
665+ const char *key, uint32_t part_count,
666+ const struct arrow_options *options,
667+ struct ArrowArrayStream *stream);
660668 /* * Create an index read view. */
661669 struct index_read_view *(*create_read_view)(struct index *index);
662670 /* * Introspection (index:stat()) */
@@ -777,6 +785,13 @@ struct index_read_view_vtab {
777785 const char *key, uint32_t part_count,
778786 const char *pos, uint32_t offset,
779787 struct index_read_view_iterator *it);
788+ /* * Create an index read view Arrow stream. */
789+ int
790+ (*create_arrow_stream)(struct index_read_view *rv,
791+ uint32_t field_count, const uint32_t *fields,
792+ const char *key, uint32_t part_count,
793+ const struct arrow_options *options,
794+ struct ArrowArrayStream *stream);
780795};
781796
782797/* *
@@ -1046,6 +1061,18 @@ index_create_iterator(struct index *index, enum iterator_type type,
10461061 return index->vtab ->create_iterator (index, type, key, part_count, NULL );
10471062}
10481063
1064+ static inline int
1065+ index_create_arrow_stream (struct index *index,
1066+ uint32_t field_count, const uint32_t *fields,
1067+ const char *key, uint32_t part_count,
1068+ const struct arrow_options *options,
1069+ struct ArrowArrayStream *stream)
1070+ {
1071+ return index->vtab ->create_arrow_stream (index, field_count, fields,
1072+ key, part_count, options,
1073+ stream);
1074+ }
1075+
10491076static inline struct index_read_view *
10501077index_create_read_view (struct index *index)
10511078{
@@ -1174,6 +1201,19 @@ index_read_view_iterator_position(struct index_read_view_iterator *iterator,
11741201 return iterator->base .position (iterator, pos, size);
11751202}
11761203
1204+ static inline int
1205+ index_read_view_create_arrow_stream (
1206+ struct index_read_view *rv,
1207+ uint32_t field_count, const uint32_t *fields,
1208+ const char *key, uint32_t part_count,
1209+ const struct arrow_options *options,
1210+ struct ArrowArrayStream *stream)
1211+ {
1212+ return rv->vtab ->create_arrow_stream (rv, field_count, fields,
1213+ key, part_count, options,
1214+ stream);
1215+ }
1216+
11771217/*
11781218 * Virtual method stubs.
11791219 */
@@ -1227,6 +1267,19 @@ generic_index_read_view_create_iterator_with_offset(
12271267 const char *key, uint32_t part_count,
12281268 const char *pos, uint32_t offset,
12291269 struct index_read_view_iterator *it);
1270+ int
1271+ generic_index_create_arrow_stream (struct index *index,
1272+ uint32_t field_count, const uint32_t *fields,
1273+ const char *key, uint32_t part_count,
1274+ const struct arrow_options *options,
1275+ struct ArrowArrayStream *stream);
1276+ int
1277+ generic_index_read_view_create_arrow_stream (
1278+ struct index_read_view *rv,
1279+ uint32_t field_count, const uint32_t *fields,
1280+ const char *key, uint32_t part_count,
1281+ const struct arrow_options *options,
1282+ struct ArrowArrayStream *stream);
12301283int generic_index_build_next (struct index *, struct tuple *);
12311284void generic_index_end_build (struct index *);
12321285int
0 commit comments