Re: [influxdb] alias on aggregation

2016-09-20 Thread Steve Weber
thanks for the help Sean!


On Tue, Sep 20, 2016 at 3:31 PM, Sean Beckett  wrote:

> Yes, that's a feature we intend to support, but "AS" was specifically left
> out of the first wildcard for fields PR, as it complicates things
> significantly.
>
> On Tue, Sep 20, 2016 at 6:59 AM, Steve Weber 
> wrote:
>
>> Ah thanks... so what im looking for is something like
>>
>> ```
>> SELECT last(*) as ""  from vmware_cpu limit 1
>> ```
>>
>> I moved over to the pullrequest/issue to see what the devs think.
>>
>> On Mon, Sep 19, 2016 at 7:52 PM, Sean Beckett  wrote:
>>
>>> The AS aliasing only works if you explicitly declare each field.
>>> Otherwise, the * matcher for fields automatically pre-pends the function
>>> name. We intend to allow AS to operate on * matched fields, but for the
>>> first version it was too complex to implement. (See
>>> https://github.com/influxdata/influxdb/pull/7009)
>>>
>>> Currently, you can use SELECT LAST(*)... or you can have custom field
>>> keys for the output, but not both.
>>>
>>>
>>> On Mon, Sep 19, 2016 at 11:19 AM,  wrote:
>>>
 Moving and downsampling some data between two databases. Need the to
 maintain the names of the values.

 ```
 SELECT last(*)
 INTO "mfcf_vmware"."autogen".:measurement
 FROM /^vmware_.*/
 WHERE time >= '2016-01-01T00:00:00Z'
 GROUP BY time(30m), "host"
 ```

 This almost worked but the copy of the data has "last_" prefixed for
 all the values.

 What's the best way to alias the columns to the original name?
 is there a possible backreference?
 `SELECT last(*) AS .:?origina_name?`

 Also can you point me to the location in the documentation that shows
 this?
 If this information is not in the documents then perhaps an issue
 should be created.

 Thanks

 --
 Remember to include the InfluxDB version number with all issue reports
 ---
 You received this message because you are subscribed to the Google
 Groups "InfluxDB" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to influxdb+unsubscr...@googlegroups.com.
 To post to this group, send email to influxdb@googlegroups.com.
 Visit this group at https://groups.google.com/group/influxdb.
 To view this discussion on the web visit https://groups.google.com/d/ms
 gid/influxdb/5463f361-4501-4210-9354-a144eedb08f1%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>>
>>> --
>>> Sean Beckett
>>> Director of Support and Professional Services
>>> InfluxDB
>>>
>>> --
>>> Remember to include the InfluxDB version number with all issue reports
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "InfluxDB" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/influxdb/hMfAITLnloA/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> influxdb+unsubscr...@googlegroups.com.
>>> To post to this group, send email to influxdb@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/influxdb.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/influxdb/CALGqCvPsvg9u-vaTAmna5EF%2BoOPv-kqnHQLv22EneuXH
>>> n5zbZg%40mail.gmail.com
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> Remember to include the InfluxDB version number with all issue reports
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "InfluxDB" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to influxdb+unsubscr...@googlegroups.com.
>> To post to this group, send email to influxdb@googlegroups.com.
>> Visit this group at https://groups.google.com/group/influxdb.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/influxdb/CAAcLdHM7%2BcEn2C_ywq0DUwbOcAGMFG1Bbt4abpq4WT6c
>> 8TFVTA%40mail.gmail.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Sean Beckett
> Director of Support and Professional Services
> InfluxDB
>
> --
> Remember to include the InfluxDB version number with all issue reports
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "InfluxDB" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/influxdb/hMfAITLnloA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> 

Re: [influxdb] alias on aggregation

2016-09-19 Thread Sean Beckett
The AS aliasing only works if you explicitly declare each field. Otherwise,
the * matcher for fields automatically pre-pends the function name. We
intend to allow AS to operate on * matched fields, but for the first
version it was too complex to implement. (See
https://github.com/influxdata/influxdb/pull/7009)

Currently, you can use SELECT LAST(*)... or you can have custom field keys
for the output, but not both.


On Mon, Sep 19, 2016 at 11:19 AM,  wrote:

> Moving and downsampling some data between two databases. Need the to
> maintain the names of the values.
>
> ```
> SELECT last(*)
> INTO "mfcf_vmware"."autogen".:measurement
> FROM /^vmware_.*/
> WHERE time >= '2016-01-01T00:00:00Z'
> GROUP BY time(30m), "host"
> ```
>
> This almost worked but the copy of the data has "last_" prefixed for all
> the values.
>
> What's the best way to alias the columns to the original name?
> is there a possible backreference?
> `SELECT last(*) AS .:?origina_name?`
>
> Also can you point me to the location in the documentation that shows this?
> If this information is not in the documents then perhaps an issue should
> be created.
>
> Thanks
>
> --
> Remember to include the InfluxDB version number with all issue reports
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to influxdb+unsubscr...@googlegroups.com.
> To post to this group, send email to influxdb@googlegroups.com.
> Visit this group at https://groups.google.com/group/influxdb.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/influxdb/5463f361-4501-4210-9354-a144eedb08f1%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sean Beckett
Director of Support and Professional Services
InfluxDB

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CALGqCvPsvg9u-vaTAmna5EF%2BoOPv-kqnHQLv22EneuXHn5zbZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.