summaryrefslogtreecommitdiff
path: root/internal/mapr/query.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2023-09-05 16:38:23 +0300
committerPaul Buetow <pbuetow@mimecast.com>2023-09-07 15:32:29 +0300
commit9c77304550d65b8e7c2b724b991eef0dbc13694a (patch)
treeb0401269acf383760e2b2f962e71d11fd55147d2 /internal/mapr/query.go
parent360f67bf536372cb6a78fe35c15ba6128fda290b (diff)
Can quote fields in select conditions, e.g. select `count($foo)`, ..
Diffstat (limited to 'internal/mapr/query.go')
-rw-r--r--internal/mapr/query.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/mapr/query.go b/internal/mapr/query.go
index 247cdaf..ddcbc90 100644
--- a/internal/mapr/query.go
+++ b/internal/mapr/query.go
@@ -73,6 +73,13 @@ func NewQuery(queryStr string) (*Query, error) {
Interval: time.Second * 5,
Limit: -1,
}
+
+ // If log format is CSV, then use "." as the table. It means, that
+ // we don't do any file filtering, we process all lines of the CSV.
+ if q.LogFormat == "csv" {
+ q.Table = "."
+ }
+
return &q, q.parse(tokens)
}
@@ -87,8 +94,7 @@ func (q *Query) Has(what string) bool {
}
func (q *Query) parse(tokens []token) error {
- tokens, err := q.parseTokens(tokens)
- if err != nil {
+ if _, err := q.parseTokens(tokens); err != nil {
return err
}