Skip to content

[C++] Sorting dictionary array not implemented #29887

@asfimport

Description

@asfimport

From R, taking the stock mtcars dataset and giving it a dictionary type column:

mtcars %>% 
  mutate(cyl = as.factor(cyl)) %>% 
  Table$create() %>% 
  arrange(cyl) %>% 
  collect()

Error: Type error: Sorting not supported for type dictionary<values=string, indices=int8, ordered=0>
../src/arrow/compute/kernels/vector_array_sort.cc:427  VisitTypeInline(type, this)
../src/arrow/compute/kernels/vector_sort.cc:148  GetArraySorter(*physical_type_)
../src/arrow/compute/kernels/vector_sort.cc:1206  sorter.Sort()
../src/arrow/compute/api_vector.cc:259  CallFunction("sort_indices", {datum}, &options, ctx)
../src/arrow/compute/exec/order_by_impl.cc:53  SortIndices(table, options_, ctx_)
../src/arrow/compute/exec/sink_node.cc:292  impl_->DoFinish()
../src/arrow/compute/exec/exec_plan.cc:297  iterator_.Next()
../src/arrow/record_batch.cc:318  ReadNext(&batch)
../src/arrow/record_batch.cc:329  ReadAll(&batches)

Reporter: Neal Richardson / @nealrichardson
Assignee: Ariana Villegas / @ArianaVillegas

PRs and other links:

Note: This issue was originally created as ARROW-14314. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions