| 345 | compute::SortOrder sort_order; |
| 346 | |
| 347 | static Result<SortBehavior> Make(substrait::SortField::SortDirection dir) { |
| 348 | SortBehavior sort_behavior; |
| 349 | switch (dir) { |
| 350 | case substrait::SortField::SortDirection:: |
| 351 | SortField_SortDirection_SORT_DIRECTION_UNSPECIFIED: |
| 352 | return Status::Invalid("The substrait plan does not specify a sort direction"); |
| 353 | case substrait::SortField::SortDirection:: |
| 354 | SortField_SortDirection_SORT_DIRECTION_ASC_NULLS_FIRST: |
| 355 | sort_behavior.null_placement = compute::NullPlacement::AtStart; |
| 356 | sort_behavior.sort_order = compute::SortOrder::Ascending; |
| 357 | break; |
| 358 | case substrait::SortField::SortDirection:: |
| 359 | SortField_SortDirection_SORT_DIRECTION_ASC_NULLS_LAST: |
| 360 | sort_behavior.null_placement = compute::NullPlacement::AtEnd; |
| 361 | sort_behavior.sort_order = compute::SortOrder::Ascending; |
| 362 | break; |
| 363 | case substrait::SortField::SortDirection:: |
| 364 | SortField_SortDirection_SORT_DIRECTION_DESC_NULLS_FIRST: |
| 365 | sort_behavior.null_placement = compute::NullPlacement::AtStart; |
| 366 | sort_behavior.sort_order = compute::SortOrder::Descending; |
| 367 | break; |
| 368 | case substrait::SortField::SortDirection:: |
| 369 | SortField_SortDirection_SORT_DIRECTION_DESC_NULLS_LAST: |
| 370 | sort_behavior.null_placement = compute::NullPlacement::AtEnd; |
| 371 | sort_behavior.sort_order = compute::SortOrder::Descending; |
| 372 | break; |
| 373 | case substrait::SortField::SortDirection:: |
| 374 | SortField_SortDirection_SORT_DIRECTION_CLUSTERED: |
| 375 | default: |
| 376 | return Status::NotImplemented( |
| 377 | "Acero does not support the specified sort direction: ", dir); |
| 378 | } |
| 379 | return sort_behavior; |
| 380 | } |
| 381 | }; |
| 382 | |
| 383 | } // namespace |
nothing calls this directly
no test coverage detected