influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

[0.9.5.1] database seems to be storing null values with `INTO` queries

Open rkuchan opened this issue 10 years ago • 3 comments

An INTO query with a single function doesn't report null values:

> select min(source) into mins from mymeas where time >= '2015-12-15T00:11:54.354492928Z' and time <= '2015-12-15T00:13:40.956464882Z' group by time(1m)
> select * from mins
{
    "results": [
        {
            "series": [
                {
                    "name": "mins",
                    "columns": [
                        "time",
                        "min"
                    ],
                    "values": [
                        [
                            "2015-12-15T00:11:00Z",
                            1
                        ],
                        [
                            "2015-12-15T00:13:00Z",
                            8
                        ]
                    ]
                }
            ]
        }
    ]
}

An INTO query with more than one function does report null values:

> select min(source), max(source) into minmax from mymeas where time >= '2015-12-15T00:11:54.354492928Z' and time <= '2015-12-15T00:13:40.956464882Z' group by time(1m)
> select * from minmax
{
    "results": [
        {
            "series": [
                {
                    "name": "minmax",
                    "columns": [
                        "time",
                        "max",
                        "min"
                    ],
                    "values": [
                        [
                            "2015-12-15T00:11:00Z",
                            2,
                            1
                        ],
                        [
                            "2015-12-15T00:12:00Z",
                            null,
                            null
                        ],
                        [
                            "2015-12-15T00:13:00Z",
                            89,
                            8
                        ]
                    ]
                }
            ]
        }
    ]
}

rkuchan avatar Dec 15 '15 00:12 rkuchan

@rkuchan can you test this against TSM? If there's no issue there I'm going to close this out since the other engines will be going away in 0.10.0

pauldix avatar Dec 16 '15 14:12 pauldix

@pauldix, there's no issue with tsm1.

rkuchan avatar Dec 16 '15 17:12 rkuchan

It looks like this works correctly now with tsm1, but I'm also going to include something to automatically switch any fill(null) calls to fill(none) since fill(null) is the default. I don't think there's any time where a fill(null) call makes sense in the context of an INTO query.

jsternberg avatar Mar 16 '16 14:03 jsternberg