* garrow_array_builder_append_nulls: * @builder: A #GArrowArrayBuilder. * @n: The number of null values to be appended. * @error: (nullable): Return location for a #GError or %NULL. * * Append multiple nulls at once. It's more efficient than multiple * garrow_array_builder_append_null() calls. * * Returns: %TRUE on success, %FALSE if there was an error. * * Since: 3.0.0 */
| 801 | * Since: 3.0.0 |
| 802 | */ |
| 803 | gboolean |
| 804 | garrow_array_builder_append_nulls(GArrowArrayBuilder *builder, gint64 n, GError **error) |
| 805 | { |
| 806 | const gchar *context = "[array-builder][append-nulls]"; |
| 807 | if (n < 0) { |
| 808 | g_set_error(error, |
| 809 | GARROW_ERROR, |
| 810 | GARROW_ERROR_INVALID, |
| 811 | "%s: the number of nulls must be 0 or larger: " |
| 812 | "<%" G_GINT64_FORMAT ">", |
| 813 | context, |
| 814 | n); |
| 815 | return FALSE; |
| 816 | } |
| 817 | if (n == 0) { |
| 818 | return TRUE; |
| 819 | } |
| 820 | |
| 821 | auto arrow_builder = garrow_array_builder_get_raw(builder); |
| 822 | auto status = arrow_builder->AppendNulls(n); |
| 823 | return garrow_error_check(error, status, context); |
| 824 | } |
| 825 | |
| 826 | /** |
| 827 | * garrow_array_builder_append_empty_value: |
no test coverage detected