mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 02:44:59 +00:00
Fixes #2009
This commit is contained in:
parent
c2cbaddba8
commit
d6bb5c65de
1 changed files with 20 additions and 4 deletions
24
executor.go
24
executor.go
|
|
@ -253,6 +253,13 @@ 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
|
||||
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 +1413,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 +2852,19 @@ func (e *executor) translateResult(index string, idx *Index, call *pql.Call, res
|
|||
return result, nil
|
||||
}
|
||||
|
||||
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