hamilton-earthscope commented on issue #66:
URL: https://github.com/apache/arrow-go/issues/66#issuecomment-3643643998

   Hi @zeroshade I like your guidance above: `Take(table, sort_indices(table)) 
== sorted table`. That overarching design makes sense to me.
   
   I'm interested in your thoughts on the public interface and the 
implementation of the kernel.
   
   What I'm thinking for the kernel is:
   - a single actual sort implementation that handles multi-column sorting (for 
records, tables) that also handles chunked arrays.
   - run all sort requests through that single implementation:
     - input: array -> calls sortindices with (single chunk, single column) -> 
output: array of indices
     - input: chunked array -> calls sortindices with (multi chunks, single 
column) -> output: array of indices
     - input: record -> calls sortindices with (single chunk, multi column) -> 
output: array of indices
     - input: table -> calls sortindices with (multi chunk, multi column) -> 
output: array of indices
   
   For the public interface, I'm trying to mimic the Take* public methods. 
Here's what I'm thinking (pseudocode):
   - SortIndices(Datum) -> Array (the indices)
     - this method just maps the varius datum shapes into the sort kernel as 
described above.
   - Sort(Datum) -> Datum (the sorted result)
     - this is where the `Take(table, sort_indices(table)) == sorted table` 
occurs
   
   which are registered with `FunctionRegistry.AddFunction()` with names 
`sort_indices` and `sort`, respectively.
   
   Do we also want public methods like the following?
   - SortIndices*:
     - SortIndicesArray(Array) -> Array of indices
     - SortIndicesChunk(Chunked) -> Array of indices
     - SortIndicesRecord(Record) -> Array of indices
     - SortIndicesTable(Table) -> Array of indices
   - Sort*:
     - SortArray(Array) -> sorted Array
     - SortChunked(Chunked) -> sorted Chunked
     - SortRecord(Record) -> sorted Record
     - SortTable(Table) -> sorted Table


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to