MCPcopy Create free account
hub / github.com/brimdata/super / ImportComparator

Function ImportComparator

db/writer.go:311–323  ·  view source on GitHub ↗
(sctx *super.Context, pool *Pool)

Source from the content-addressed store, hash-verified

309}
310
311func ImportComparator(sctx *super.Context, pool *Pool) *expr.Comparator {
312 var exprs []expr.SortExpr
313 for _, s := range pool.SortKeys {
314 exprs = append(exprs, expr.NewSortExpr(expr.NewDottedExpr(sctx, s.Key), s.Order, s.Order.NullsMax(true)))
315 }
316 var o order.Which
317 if !pool.SortKeys.IsNil() {
318 o = pool.SortKeys.Primary().Order
319 }
320 // valueAsBytes establishes a total order.
321 exprs = append(exprs, expr.NewSortExpr(&valueAsBytes{}, o, o.NullsMax(true)))
322 return expr.NewComparator(exprs...).WithMissingAsNull()
323}
324
325type valueAsBytes struct{}
326

Callers 3

newObjectsScannerFunction · 0.92
NewWriterFunction · 0.85
NewSortedWriterFunction · 0.85

Calls 7

NullsMaxMethod · 0.95
NewSortExprFunction · 0.92
NewDottedExprFunction · 0.92
NewComparatorFunction · 0.92
IsNilMethod · 0.80
PrimaryMethod · 0.80
WithMissingAsNullMethod · 0.80

Tested by

no test coverage detected