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

Allow specifying custom views in queries #659

Open
SanderMertens opened this issue Feb 13, 2018 · 0 comments
Open

Allow specifying custom views in queries #659

SanderMertens opened this issue Feb 13, 2018 · 0 comments

Comments

@SanderMertens
Copy link
Member

SanderMertens commented Feb 13, 2018

Currently when an application queries for an object, all members for the object are serialized (when a serialization format is specified). Often an application will not need all members, and can thus performance could be saved by making a subselection of members.

Additionally, views could offer more sophisticated abstractions, like selecting members by tag, requesting data in a specific unit or converting to another type, which decouples the application from the underlying types of the data, and allows for more evolvable systems.

Examples:

Select members:

select * from data view x, y

Select nested members:

select * from data view start.x, start.y, stop.x, stop.y

Alias members:

select * from data view start.x as bx, start.y as by, stop.x as ex, stop.y as ey

Select members by tag:

select * from data view #latitude, #longitude

Select members, change type

select * from data view x as (string), y as (string)

Same, but shorthand:

select * from data view x as :string, y as :string

Alias members, change type

select * from data view x as cx(string), y as cy(string)

Same, but shorthand:

select * from data view x as cx:string, y as cy:string

Change unit

select * from data view temperature as (unit=celcius)

Select tag, alias member, change type and change unit

select * from data view #temperature as temp(float64, unit=celcius)

The syntax after as is consistent with the new proposal for the corto language, which means the regular string deserializer can be used to parse query strings.

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

No branches or pull requests

1 participant