Skip to content

at-querify interprets variables as fields/tags #7

@MarcMush

Description

@MarcMush
using InfluxDB 

server = InfluxServer("http://localhost:8086") # empty
db = "data"

create_database(server, db)

write(server, db, [
    Measurement("measure",
        Dict("a" => "b"),
        Dict("id" => "b"),
        time()),
    Measurement("measure",
        Dict("a" => "c"),
        Dict("id" => "d"),
        time()),
])

a = "d"
q1 = query(server, db, SELECT(measurements=["measure"], condition=@querify(:id == a)))
q2 = query(server, db, SELECT(measurements=["measure"], condition=InfluxDB.querify(:(:id == $a))))

I would expect the first query to work like the second one
I might try to fix it but macros are a pain so I'll stick with the second option for now

q1[1] = 1×3 DataFrame
│ Row │ time                         │ a      │ id     │
│     │ String                       │ String │ String │
├─────┼──────────────────────────────┼────────┼────────┤
│ 1   │ 2020-08-14T08:49:58.5606848Z │ b      │ b      │
q2[1] = 1×3 DataFrame
│ Row │ time                           │ a      │ id     │
│     │ String                         │ String │ String │
├─────┼────────────────────────────────┼────────┼────────┤
│ 1   │ 2020-08-14T08:49:58.560722944Z │ c      │ d      │

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions