mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
commit
430b8a6118
1 changed files with 23 additions and 4 deletions
27
executor.go
27
executor.go
|
|
@ -253,6 +253,14 @@ func (e *executor) executeCall(ctx context.Context, index string, c *pql.Call, s
|
|||
return nil, errors.Wrap(err, "validating args")
|
||||
}
|
||||
indexTag := fmt.Sprintf("index:%s", index)
|
||||
|
||||
// Fixes #2009
|
||||
// See: https://github.com/pilosa/pilosa/issues/2009
|
||||
// TODO: Remove at version 2.0
|
||||
if e.detectRangeCall(c) {
|
||||
e.Holder.Logger.Printf("DEPRECATED: Range() is deprecated, please use Row() instead.")
|
||||
}
|
||||
|
||||
// Special handling for mutation and top-n calls.
|
||||
switch c.Name {
|
||||
case "Sum":
|
||||
|
|
@ -1406,10 +1414,6 @@ func (e *executor) executeRowShard(ctx context.Context, index string, c *pql.Cal
|
|||
span, _ := tracing.StartSpanFromContext(ctx, "Executor.executeRowShard")
|
||||
defer span.Finish()
|
||||
|
||||
if c.Name == "Range" {
|
||||
e.Holder.Logger.Printf("DEPRECATED: Range() is deprecated, please use Row() instead.")
|
||||
}
|
||||
|
||||
// Handle bsiGroup ranges differently.
|
||||
if c.HasConditionArg() {
|
||||
return e.executeRowBSIGroupShard(ctx, index, c, shard)
|
||||
|
|
@ -2849,6 +2853,21 @@ func (e *executor) translateResult(index string, idx *Index, call *pql.Call, res
|
|||
return result, nil
|
||||
}
|
||||
|
||||
// detectRangeCall returns true if the call or one of its children contains a Range call
|
||||
// TODO: Remove at version 2.0
|
||||
func (e *executor) detectRangeCall(c *pql.Call) bool {
|
||||
// detect whether there is a Range call
|
||||
if c.Name == "Range" {
|
||||
return true
|
||||
}
|
||||
for _, c := range c.Children {
|
||||
if e.detectRangeCall(c) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// validateQueryContext returns a query-appropriate error if the context is done.
|
||||
func validateQueryContext(ctx context.Context) error {
|
||||
select {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue