Commit graph

50 commits

Author SHA1 Message Date
Travis Turner
aa17b8d725
Enable linter: stylecheck (#2317)
* Enable linter: stylecheck

This enabled the stylecheck linter, but excludes some staticchecks for
now. The following are ignored because they will take a bit of time to
address, but the intention is to address them and remove them from the
exclusion list.

ST1000: at least one file in a package should have a package comment
ST1003: golang naming standards
ST1008: error should be returned as the last argument
ST1016: methods on the same type should have the same receiver name
ST1020: comment on exported function

* Address ST1015

For some reason this failed in CI but not locally. I can't figure out
why that check isn't happening locally. This just moves the switch
statements around so that the `default` is the first (or last) item.

* Adjust error string in test to match case-adjusted error

* Remove TestCloseTimeout
2023-03-14 08:45:18 -05:00
tgruben
2fc7abd72e Dataframe (#2241)
* Dataframe

(cherry picked from commit 2f1beaf119)
2022-12-12 09:01:20 -08:00
Fletcher Haynes
eb06bb50ae Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
Shaquille Wyan Que
6ba6218ae4 changed out of range error message name and fixed formatting 2019-05-15 11:22:04 -05:00
Shaquille Wyan Que
98a864634e fixed out of bounds panic to show error 2019-05-14 16:58:03 -05:00
Travis Turner
bdc4f3b07e
recover the duplicate arg panic from parser, treat as error 2019-04-10 23:48:17 -05:00
Travis Turner
5f079163cb
validate (and panic) on duplicate PQL arguments 2019-04-10 16:34:30 -05:00
Matt Jaffee
daa87d8e12
fix staticcheck warnings 2019-01-21 14:24:11 -06:00
Travis Turner
f7e3296f62
fixes a bug on upper end of bsi range queries 2019-01-11 17:05:29 -06:00
Ben Johnson
9d1e5ca8ce
Merge Range() into Row() call.
This commit refactors the `Range()` call and merges its functionality
into the `Row()` call.
2019-01-09 15:10:49 -07:00
Matt Jaffee
81d08be044
fix PQL, Rows and Group By problems
make sure that args which are Uints are positive and return an error if not.

improve group by error messages if field for Rows query is invalid
2018-12-21 14:16:55 -06:00
Ben Johnson
727659644b
Add GroupBy filter. 2018-12-07 10:35:57 -07:00
Travis Turner
4f17dbdbf1
add support for Bool fields
prevent import of non-boolean row values to bool fields
2018-09-21 09:25:41 -05:00
Cody Soyland
f01d850b17 Fix linter issues: gosimple 2018-07-20 09:06:43 -05:00
Cody Soyland
fb7de28557 Unexport pql.TimeFormat 2018-07-05 23:11:56 -05:00
Cody Soyland
aa7f6fca75 Unexport pql.FormatValue 2018-07-05 23:11:56 -05:00
Cody Soyland
3a47638580 Unexport pql.Call.Keys 2018-07-05 23:11:56 -05:00
Matt Jaffee
d032c8941f
Merge branch 'develop' into dead-code-removal 2018-07-05 18:02:39 -05:00
Travis Turner
5717e32310
fix comment for IntArg 2018-07-05 16:36:37 -05:00
Travis Turner
b7a583d6a8
use Set() instead of SetValue() for integer fields 2018-07-05 16:24:40 -05:00
Cody Soyland
da4cd84820 Remove some dead code 2018-07-05 15:31:07 -05:00
Alan Bernstein
5bf9af4df3 Parser and test updates 2018-06-22 08:07:31 -05:00
Matt Jaffee
1a2fa51b63
Merge branch 'develop' into newpql 2018-06-20 09:31:42 -05:00
Matt Jaffee
5c081d1518
more tests, fix bug where Condition wasn't pointer 2018-06-18 11:59:39 -05:00
Matt Jaffee
a6b6442ef4
more tests and fix range 2018-06-18 11:32:21 -05:00
Ben Johnson
060254e0d6
Key-to-ID Translation
This commit adds id-to-key translation to make it easier for users
to provide non-integer identifiers for rows & columns.
2018-06-15 16:45:05 -06:00
Matt Jaffee
4b856bea55
change parser for new PQL 2018-06-15 12:22:16 -05:00
Matt Jaffee
1e05920742
fuzz testing and bug fixes 2018-06-15 08:34:14 -05:00
Matt Jaffee
47233c8bee
replace PQL parser with one created by PEG parser generator 2018-06-15 08:34:12 -05:00
Matt Jaffee
47f7beaecc
WIP removing inverse 2018-05-25 17:18:38 -05:00
Travis Turner
1fb540f40b Merge pull request #844 from travisturner/bug-fix-condition-string
Don't include an equal sign in the string representation of a Condition
2017-09-27 11:14:56 -05:00
Travis
2b88d278bc
Implements BETWEEN for Range queries.
The PQL looks like:
```
Range(frame=f, field0 >< [200,610])
```

One thing I noticed while implementing this is that it doesn't seem
like `FieldRange()` is used in either `Frame` or `View`; the Executor
calls `Fragment.FieldRange()` directly. The problem with this is that
the offset logic is calculated in the Frame, but since the Executor
doesn't go through Frame, then the Executor also has to calculate
the offset before calling `Fragment.FieldRange`. We should unify this
logic somewhere. Note, this applies to both `FieldRange` and
`FieldRangeBetween`.
2017-09-25 15:11:04 -05:00
Travis
51ca778d77
Don't include an equal sign in the string representation of a Condition 2017-09-25 14:51:15 -05:00
Ben Johnson
ad847f2c8a
Add field Range() support to Executor. 2017-08-24 13:34:57 -06:00
Ben Johnson
c36fdbfacb
Support PQL Range() queries for fields. 2017-08-12 11:39:25 -06:00
Alan Bernstein
64a12c939c Fix typo in error message 2017-05-16 17:56:16 -05:00
Ben Johnson
0b8d935f1c
Add inverse TopN() support.
The TopN() call now supports an `inverse` boolean argument to
specify if the call should operate on the standard view or the
inverse view.
2017-05-15 10:35:48 -06:00
Ben Johnson
e3d6f96657
Add max-writes-per-requests limit.
A configurable limit has been added to restrict the number of
mutating calls in a `pql.Query`. This is to prevents requests from
timing out from large queries.

The default is set to 5000 writes per request and is configurable
through the configuration file and the command line flags.
2017-05-03 08:53:20 -06:00
Cody Soyland
3996b56b88 Apply Apache License 2.0 2017-04-28 14:22:03 -05:00
Travis
7dc06f918b
Determine if a Call is inverse or not so that the map to slices is correct. 2017-04-24 16:19:17 -05:00
Matt Jaffee
e6309d45e1 make sure exported functions are godoc'd 2017-04-18 15:10:59 -05:00
Matt Jaffee
6f443f447a add signed int support
this affects the scanner/parser and makes it produce signed ints rather than
uints, and so it affects all code that is expecting unsighed ints to come out of
the parser.
2017-04-18 12:50:26 -05:00
Yuce Tekol
6f645b9db5 SetBit uses TimeFormat. Implements 315 2017-02-24 16:35:41 +03:00
Yuce Tekol
1eff86f78b Moved timestamp from HTTP query to PQL 2017-02-08 16:04:19 +03:00
Ben Johnson
f39768b49b Refactor parser & AST to remove compile-time field names.
Consolidates all the pql.Call implementations into a single
pql.Call struct. This is needed to support user-defined schemas
on frames.

This also has the added benefit that a lot of redundant parsing
code has been consolidated.
2017-02-02 14:27:18 -07:00
Ben Johnson
569bafdc7d add bulk call support to the query endpoint
This commit changes the `pql.Query` so that it can accept one or more
top-level calls instead of only one.

The query request format change because a query with a single call is
still valid. However, the result format now returns a `results` field
that has one result for each top-level call. The `profiles` field is
still the same, however, it combines all profiles from all bitmap
responses into one return so that there's not duplicate attributes.

Fixes #59
2016-03-08 14:34:37 -07:00
Ben Johnson
5a63a14742 refetch full counts for TopN()
This commits adds refetching to get the actual TopN() count
after the top bitmaps are determined.

Fixes #57
2016-03-03 13:03:20 -07:00
Ben Johnson
d3500c64f7 TopN()
This commit adds TopN() functionality to the fragment, executor
and handler.
2016-02-09 14:43:49 -07:00
Ben Johnson
e0937b79c0 add bitmap and profile attribute support
This commit adds the ability to set string, integer, and boolean
values on bitmaps and profiles within Pilosa. Bitmap attributes
are automatically returned when making a `Bitmap()` call. Profile
attributes must be requested by setting `profile=true` in the
URL.

The function names have also been renamed to initial caps so that
the PQL query language can support math operations in the future.
2016-02-01 08:44:33 -07:00
Ben Johnson
a632d08629 refactor
This commit refactors the pilosa codebase. It makes several major
changes:

* Removes bitmap handles
* Removes dispatch/hold/transport
* Removes etcd dependency
* Adds consistent hash ring for slice placement
* Refactors parser/lexer
* Adds strong typing to PQL AST
* Flattens package hierarchy
2015-12-02 15:34:49 -07:00