* garrow_feather_file_reader_read_indices: * @reader: A #GArrowFeatherFileReader. * @indices: (array length=n_indices): The indices of column to be read. * @n_indices: The number of indices. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (transfer full): The table in the file that has only the * specified columns. * * Since: 0.12.0 */
| 839 | * Since: 0.12.0 |
| 840 | */ |
| 841 | GArrowTable * |
| 842 | garrow_feather_file_reader_read_indices(GArrowFeatherFileReader *reader, |
| 843 | const gint *indices, |
| 844 | guint n_indices, |
| 845 | GError **error) |
| 846 | { |
| 847 | auto arrow_reader = garrow_feather_file_reader_get_raw(reader); |
| 848 | std::vector<int> cpp_indices(n_indices); |
| 849 | for (guint i = 0; i < n_indices; ++i) { |
| 850 | cpp_indices.push_back(indices[i]); |
| 851 | } |
| 852 | std::shared_ptr<arrow::Table> arrow_table; |
| 853 | auto status = arrow_reader->Read(cpp_indices, &arrow_table); |
| 854 | if (garrow_error_check(error, status, "[feather-file-reader][read-indices]")) { |
| 855 | return garrow_table_new_raw(&arrow_table); |
| 856 | } else { |
| 857 | return NULL; |
| 858 | } |
| 859 | } |
| 860 | |
| 861 | /** |
| 862 | * garrow_feather_file_reader_read_names: |
nothing calls this directly
no test coverage detected