Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge should work with a regex #72

Merged
merged 7 commits into from
Oct 21, 2014
Merged

Merge should work with a regex #72

merged 7 commits into from
Oct 21, 2014

Conversation

jvshahid
Copy link
Contributor

@jvshahid jvshahid commented Sep 2, 2014

Like this example

select * from merge(/stats.*/)

@maxd
Copy link

maxd commented Apr 28, 2014

@pauldix @jvshahid Could you please clarify when are you going to implement this feature?

P.S.
It would be good to remove all unimplemented features from InfluxDB documentation.

Thanks

@jvshahid
Copy link
Contributor

@maxd this is scheduled for 0.6.0 release as the milestone indicates. We use milestones to schedule features and bug fixes. We are focusing on bug fixes to get InfluxDB stable, but will soon start to focus on 0.6.0. Regarding the docs, @pauldix is working on it and will be available very soon.

@jvshahid jvshahid modified the milestones: 0.6.1, 0.6.0 May 2, 2014
@gitboy
Copy link

gitboy commented May 7, 2014

0.6.0 is released but this behaviour persists. Can someone provide any updates on this?

@toddboom toddboom modified the milestone: 0.6.1 May 7, 2014
@jvshahid
Copy link
Contributor

jvshahid commented May 7, 2014

We are still working on making InfluxDB stable and bug free. Once everything is stable we'll start working on new features.

@jvshahid jvshahid modified the milestones: 0.6.2, 0.6.1, Next release May 7, 2014
@freeformz
Copy link

PS: The docs says this works, but it doesn't. Maybe update the docs for now?

@errplane-pilots
Copy link

ah yes, I'll be updated VERY soon

On Thu, May 15, 2014 at 7:01 PM, Edward Muller notifications@github.comwrote:

PS: The docs says this works, but it doesn't. Maybe update the docs for
now?


Reply to this email directly or view it on GitHubhttps://github.com//issues/72#issuecomment-43275328
.

@tisba
Copy link

tisba commented May 29, 2014

Is there any progress on this issue? I actually thought that this already works. If this takes longer, the section in the docs should be removed (or moved to a "Future Features" section maybe).

AFAIK only single merges work, or is there a workaround to merge multiple series right now? Would be very handy for my use case.

@pauldix
Copy link
Member Author

pauldix commented May 29, 2014

ok, removed and put into future features for now.

On Thu, May 29, 2014 at 12:57 PM, Sebastian Cohnen <notifications@github.com

wrote:

Is there any progress on this issue? I actually thought that this already
works. If this takes longer, the section in the docs should be removed (or
moved to a "Future Features" section maybe).


Reply to this email directly or view it on GitHub
#72 (comment).

@blalor
Copy link

blalor commented Jun 7, 2014

Ah, yes, this would be extremely useful.

@pmyjavec
Copy link

👍

@ahamilton55
Copy link

Just figured I'd add a +1 when you guys are feature planning.

@davidblewett
Copy link

+1

@cboggs
Copy link

cboggs commented Aug 15, 2014

Unless I'm misreading the merge code (very possible!), merging two series currently merges all columns in both series. When merge() is available and functions on a regex for series names, this seems like it could be problematic from a performance perspective.

I would propose that the new merge() only merge selected fields to facilitate performant aggregations across many series.

If I did indeed misunderstand the code and the current merge already restricts down to only selected fields, then consider my proposal retracted. :-)

@pauldix
Copy link
Member Author

pauldix commented Aug 15, 2014

that's a good point. The merge would have to be updated to specify which fields to merge. I was just assuming that the series being merged together would share the same fields. I'm inclined to start using named parameters in function calls like this. There are some other functions we'll be adding and it might make things clearer:

-- fields has a default of *
-- can use both series and patterns but must have at least one specified
select * from merge(fields:["value"], series: ["foo"], patterns: ["/^stuff.*"])
  where time > now() - 1d

Although that might make another thing we want to do tricky, which is nesting these function calls. For example, say we have a function called sample that will randomly sample a series on some given interval.

-- randomly samples 10 percent of the series
select * from sample(series: ["foo"], algo: "random", percent: "10")

We'd want to send the output of that to merge. We could have another named parameter called in which would take the place of series and pattern. So we could do this:

select * from merge(in: sample(
    fields:["value"],
    series: ["foo"],
    patterns: ["/^stuff.*"],
    algorithm: "random",
    percent: "10"))
  where time > now() - 1d

The common pattern is that almost all of these transformation functions would support in, fields, patterns, and series as arguments.

Just a thought. Another possibility for some of this is just doing nested queries.

@jvshahid jvshahid removed the 3 - Done label Oct 14, 2014
@ybizeul
Copy link

ybizeul commented Oct 15, 2014

I don't see a commit, is there any change available for test? Thanks!

@jvshahid
Copy link
Contributor

No, I think we will do some more testing as part of the review and hopefully include it in the next release candidate if it looks promising. It may have some rough edges though.

@jvshahid jvshahid force-pushed the master branch 2 times, most recently from 987efd5 to 5e9750f Compare October 20, 2014 22:37
@user32432
Copy link

Is this already working? According to changelog is should however i'm getting:

curl -G 'http://localhost:8086/db/metryki/series?u=root&p=root&pretty=true' --data-urlencode "q=select * from merge /stats./"
syntax error, unexpected REGEX_STRING, expecting '('
select * from merge /stats.
/

Two series merge works as expected:
{code}
curl -G 'http://localhost:8086/db/metryki/series?u=root&p=root' --data-urlencode "q=select * from stats.a merge stats.b"
[{"name":"merged","columns":["time","sequence_number","value","_orig_series"],"points":[[1415026563923,67530001,"6","stats.b"],[1415026555479,67520001,"4","stats.a"]]}]

I'm using v.0.8.5 downloaded from http://s3.amazonaws.com/influxdb/influxdb_latest_amd64.deb

@jvshahid
Copy link
Contributor

jvshahid commented Nov 3, 2014

you need to enclose the regex in parentheses, e.g. select * from merge(/.*/)
On Nov 3, 2014 10:09 AM, "user32432" notifications@github.com wrote:

Is this already working? According to changelog is should however i'm
getting:

curl -G 'http://localhost:8086/db/metryki/series?u=root&p=root&pretty=true'
--data-urlencode "q=select * from merge /stats.

/" syntax error, unexpected REGEX_STRING, expecting '(' select * from
merge /stats.
/

Two series merge works as expected:
{code}
curl -G 'http://localhost:8086/db/metryki/series?u=root&p=root'
--data-urlencode "q=select * from stats.a merge stats.b"

[{"name":"merged","columns":["time","sequence_number","value","_orig_series"],"points":[[1415026563923,67530001,"6","stats.b"],[1415026555479,67520001,"4","stats.a"]]}]

I'm using v.0.8.5 downloaded from
http://s3.amazonaws.com/influxdb/influxdb_latest_amd64.deb


Reply to this email directly or view it on GitHub
#72 (comment).

@user32432
Copy link

Thanks! 😄
Please update documentation then as it says nothing about parentheses in merge statement.

@jvshahid
Copy link
Contributor

jvshahid commented Nov 4, 2014

will do.

On Tue, Nov 4, 2014 at 3:35 AM, user32432 notifications@github.com wrote:

Thanks! [image: 😄]
Please update documentation then as it says nothing about parentheses in
merge statement.


Reply to this email directly or view it on GitHub
#72 (comment).

@YaronWittenstein
Copy link

doing:

select * from merge(/stats.*/) into merged_stats

doesn't seem to work, it should have?
thanks!

@pauldix
Copy link
Member Author

pauldix commented Nov 6, 2014

@YaronWittenstein merge queries currently don't work with continuous queries. See #1062 to track progress.

@dgnorton dgnorton deleted the fix-72 branch January 12, 2015 17:28
@yee379
Copy link

yee379 commented Jan 17, 2015

i'm not sure this is related, but i can't get the merge to work on 0.8.8 using a 5 node cluster (no replication, 3 split):

$ curl -G 'http://localhost:8086/db/ptolemy/series?u=root&p=root' --data-urlencode "q=list series /com.blah.ap-b050.*.user_stats.neighbour.\d+/"
[{"name":"list_series_result","columns":["time","name"],"points":[[0,"com.blah.ap-b050-roof-ne.user_stats.neighbour.0"],[0,"com.blah.ap-b050-roof-ne.user_stats.neighbour.1"],[0,"com.blah.ap-b050f2-2ar29.user_stats.neighbour.0"],[0,"com.blah.ap-b050f2-2ar29.user_stats.neighbour.1"],[0,"com.blah.ap-b050r100.user_stats.neighbour.0"],[0,"com.blah.ap-b050r100.user_stats.neighbour.1"],[0,"com.blah.ap-b050r113.user_stats.neighbour.0"],[0,"com.blah.ap-b050r113.user_stats.neighbour.1"],[0,"com.blah.ap-b050r318.user_stats.neighbour.0"],[0,"com.blah.ap-b050r318.user_stats.neighbour.1"],[0,"com.blah.ap-b050r347.user_stats.neighbour.0"],[0,"com.blah.ap-b050r347.user_stats.neighbour.1"],[0,"com.blah.ap-b050r362-test2.user_stats.neighbour.0"],[0,"com.blah.ap-b050r362-test2.user_stats.neighbour.1"],[0,"com.blah.ap-b050r362-test2.user_stats.neighbour.2"],[0,"com.blah.ap-b050r367.user_stats.neighbour.0"],[0,"com.blah.ap-b050r367.user_stats.neighbour.1"],[0,"com.blah.ap-b050r375.user_stats.neighbour.0"],[0,"com.blah.ap-b050r375.user_stats.neighbour.1"],[0,"com.blah.ap-b050s.user_stats.neighbour.0"],[0,"com.blah.ap-b050s.user_stats.neighbour.1"]]}]

so the regex is okay... but then i try:

curl -G 'http://localhost:8086/db/ptolemy/series?u=root&p=root' --data-urlencode "q=select number from merge(/com.blah.ap-b050.*.user_stats.neighbour.\d+/)"
Cannot find user root

@genofire
Copy link
Contributor

genofire commented Jan 3, 2016

Me too :(
What i am doing wrong?

/query?db=test&epoch=ms&p=[REDACTED]&q=SELECT+sum("value")+FROM+MERGE/httpjson_nodes_.*_statistics_clients/

Result:

{"error":"error parsing query: found /, expected SELECT, DELETE, SHOW, CREATE, DROP, GRANT, REVOKE, ALTER, SET at line 1, char 31"}

/query?db=test&epoch=ms&p=[REDACTED]&q=SELECT+sum("value")+FROM+MERGE(/httpjson_nodes_.*_statistics_clients/)

Result:

{"error":"error parsing query: found (, expected regex at line 1, char 31"}

@beckettsean
Copy link
Contributor

@genofire your comment is on a PR that hasn't been updated in a year. Please open a new issue with all your relevant details so this PR can rest in peace.

@bechampion
Copy link

Im on nighly build and merge don't seem to work... as im collecting network stats it'd be nice to display a grafana text with the total SUM() of all the series , i hope this comes in soon

@genofire
Copy link
Contributor

@bechampion check out the version and documentation to this version.
(The team of influxdb does not write explicit down, which features are not supported any more - influxdb is not backward compatible :( )

PS: this branch was merged, it mean that in version 0.8.4 this function are implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.