mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-06 19:07:50 +00:00
Merge pull request #1930 from jaffee/1843-range-bug
add parser rule to catch old-style Range query
This commit is contained in:
commit
9f8d6f6b76
4 changed files with 1407 additions and 1231 deletions
|
|
@ -1720,6 +1720,17 @@ func TestExecutor_Execute_Range_Deprecated(t *testing.T) {
|
|||
t.Fatalf("unexpected columns: %+v", columns)
|
||||
}
|
||||
})
|
||||
|
||||
rq2 := []string{
|
||||
`Range(f=1, 1999-12-31T00:00, 2002-01-01T03:00)`,
|
||||
}
|
||||
responses = runCallTest(t, writeQuery, rq2,
|
||||
nil, pilosa.OptFieldTypeTime(pilosa.TimeQuantum("YMDH")))
|
||||
t.Run("OldRange", func(t *testing.T) {
|
||||
if columns := responses[0].Results[0].(*pilosa.Row).Columns(); !reflect.DeepEqual(columns, []uint64{2, 3, 4, 5, 6, 7}) {
|
||||
t.Fatalf("unexpected columns: %+v", columns)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
t.Run("RowIDColumnKey", func(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ Call <- 'Set' {p.startCall("Set")} open col comma args (comma timestamp)? close
|
|||
/ 'Store' {p.startCall("Store")} open Call comma arg close {p.endCall()}
|
||||
/ 'TopN' {p.startCall("TopN")} open posfield (comma allargs)? close {p.endCall()}
|
||||
/ 'Rows' {p.startCall("Rows")} open posfield (comma allargs)? close {p.endCall()}
|
||||
/ 'Range' {p.startCall("Range")} open field sp '=' sp value comma 'from='? {p.addField("from")} timestampfmt {p.addVal(buffer[begin:end])} comma 'to='? sp {p.addField("to")} timestampfmt {p.addVal(buffer[begin:end])} close {p.endCall()}
|
||||
/ < IDENT > { p.startCall(buffer[begin:end] ) } open allargs comma? close { p.endCall() }
|
||||
allargs <- Call (comma Call)* (comma args)? / args / sp
|
||||
args <- arg (comma args)? sp
|
||||
|
|
|
|||
2622
pql/pql.peg.go
2622
pql/pql.peg.go
File diff suppressed because it is too large
Load diff
|
|
@ -267,6 +267,10 @@ func TestPEGWorking(t *testing.T) {
|
|||
my-frame
|
||||
=9)`,
|
||||
ncalls: 1},
|
||||
{
|
||||
name: "OldRange",
|
||||
input: "Range(blah=1, 2019-04-07T00:00, 2019-08-07T00:00)",
|
||||
ncalls: 1},
|
||||
}
|
||||
|
||||
for i, test := range tests {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue