* garrow_sort_key_new: * @target: A name or dot path for sort target. * @order: How to order by this sort key. * @null_placement: Whether nulls and NaNs are placed at the start or at the end. * * Returns: A newly created #GArrowSortKey. * * Since: 3.0.0 */
| 3424 | * Since: 3.0.0 |
| 3425 | */ |
| 3426 | GArrowSortKey * |
| 3427 | garrow_sort_key_new(const gchar *target, |
| 3428 | GArrowSortOrder order, |
| 3429 | GArrowNullPlacement null_placement, |
| 3430 | GError **error) |
| 3431 | { |
| 3432 | auto arrow_reference_result = garrow_field_reference_resolve_raw(target); |
| 3433 | if (!garrow::check(error, arrow_reference_result, "[sort-key][new]")) { |
| 3434 | return NULL; |
| 3435 | } |
| 3436 | auto sort_key = g_object_new(GARROW_TYPE_SORT_KEY, |
| 3437 | "order", |
| 3438 | order, |
| 3439 | "null-placement", |
| 3440 | null_placement, |
| 3441 | NULL); |
| 3442 | auto priv = GARROW_SORT_KEY_GET_PRIVATE(sort_key); |
| 3443 | priv->sort_key.target = *arrow_reference_result; |
| 3444 | return GARROW_SORT_KEY(sort_key); |
| 3445 | } |
| 3446 | |
| 3447 | /** |
| 3448 | * garrow_sort_key_equal: |