I am also facing thr similar issue. I am trying to run  below query
                                                 SELECT mean(Used_Memory) 
FROM memory 
and get this error-

ERR: unsupported mean iterator type: *influxql.stringInterruptIterator

where DB name is aerdog and measurement is 'memory'. Below is my DB 
structure

> name: memory
>
> time                    Free_Memory     Hostname                           
>>      Total_Memory    Used_Memory
>
> ----                    -----------     --------                           
>>      ------------    -----------
>
> 1482304344763000000     3084           
>>  prod-4g-aercore-pcrf-3.aeriscloud.com   3768            1076
>
>
>  
I have created the sample DB as a  part of POC so I am not sure whether 
Ineed to put column type along with the colun name

On Thursday, December 8, 2016 at 4:15:59 AM UTC+5:30, Ross McDonald wrote:
>
> It is not currently possible to cast the function (mean) result. You can 
> cast the field prior to having the function called on it, though. For 
> example:
>
> private void createDB(Snapshot snapshot) {
//logger.info("Creating DB...");
InfluxDB influxDB = DBResponseProcessor.connect(url, username, password);
//influxDB.query(arg0)createDatabase(dbName);
//influxDB.query("CREATE DATABASE IF NOT EXISTS metrics");
//influxDB.query(new Query("CREATE DATABASE IF NOT EXISTS " + dbName + , 
dbName));
influxDB.createDatabase(dbName);
logger.info("DB version is " +influxDB.version());
BatchPoints batchPoints = BatchPoints
                .database(dbName)
                .tag("Hostname", snapshot.getHostname())
                .retentionPolicy("autogen")
                .consistency(ConsistencyLevel.ALL)
                .build();
Point point1 = Point.measurement("memory")
                .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
                .addField("Used_Memory", snapshot.getUsedMemory())
                .addField("Free_Memory", snapshot.getFreeMemory())
                .addField("Total_Memory", snapshot.getTotalMemory())
                .build();
batchPoints.point(point1);
influxDB.write(batchPoints);
influxDB.close(); 

> ```
> SELECT mean("value"::integer) AS value FROM "measurement" WHERE "Host" = 
> 'XYZ'
> ```
>
> Will work, but probably isn't what you want. Kapacitor has the ability to 
> cast 
> results 
> <https://docs.influxdata.com/kapacitor/v1.1/tick/expr/#type-conversion-functions>,
>  
> however it may be overkill if you are not already using it in your stack. 
> I'd recommend opening a feature request 
> <https://github.com/influxdata/influxdb/issues/new> if you'd like to see 
> this functionality added.
>
> On Tue, Dec 6, 2016 at 7:15 AM, <[email protected] <javascript:>> wrote:
>
>> Hi !
>>
>> Following query does not work ...
>>
>> SELECT mean("value")::integer AS value FROM "measurement" WHERE "Host" = 
>> 'XYZ'
>>
>> The documentation only has following examples:
>> SELECT "water_level"::integer FROM "h2o_feet"
>>
>>
>> greets
>> claus
>>
>> --
>> Remember to include the version number!
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "InfluxData" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> 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/b349dc4f-d74d-4060-952e-e524b44d6a9e%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
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/5d51bb2f-6b4e-416e-8c3e-475a2c062eaa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to