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
Arrow: Add tstype to arrow metadata #580
Conversation
data/field.go
Outdated
@@ -38,15 +39,24 @@ type Fields []*Field | |||
// NewField returns a instance of *Field. Supported types for values are: | |||
// | |||
// Integers: | |||
// []int8, []*int8, []int16, []*int16, []int32, []*int32, []int64, []*int64 | |||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In an effort to keep the "real" PR smaller and more legible, this is batching all the auto-formatting updates into this PR 😬
I really like this idea to move forward with new field types. Would feel better if there is an additional Go Field type so we know the end to end typing mapping isn't going to hit some snag (perhaps another PR based off this one?). |
😄 #581 -- WIP, but wanted to keep this basic infra change independent |
@@ -86,11 +93,13 @@ func buildArrowFields(f *Frame) ([]arrow.Field, error) { | |||
if err != nil { | |||
return nil, err | |||
} | |||
|
|||
fieldMeta := map[string]string{"name": field.Name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^ the "name" field was redundant, and never used!
@@ -74,8 +74,8 @@ | |||
{ "name": "timestamps", "type": "time", "typeInfo": { "frame": "time.Time" }, "config": { "interval": 1000 } }, | |||
{ "name": "timestamps", "type": "time", "typeInfo": { "frame": "time.Time" } }, | |||
{ "name": "nullable_timestamps", "type": "time", "typeInfo": { "frame": "time.Time", "nullable": true } }, | |||
{ "name": "json", "type":"other", "typeInfo": { "frame": "json.RawMessage" } }, | |||
{ "name": "nullable_json", "type":"other", "typeInfo": { "frame": "json.RawMessage", "nullable": true } } | |||
{ "name": "json", "type": "other", "typeInfo": { "frame": "json.RawMessage" } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty printed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Off at the moment, so might be good if todd or Sriram approve as well with a bit more eye to detail..., but perhaps they are off as well.
I'm very excited about being able to add some sort of url field type (title + link) - ( not sure offhand if the go url type would be appropriate). And perhaps a variation that is more grafana specific for linking between tables and traces etc! All of which I believe this unlocks if I not mistaken.
+100 for finding a way forward without an arrow removal dependency!
We are looking for ways to support some new field types -- specifically an "enum" type that has a native mapping from number<>string+metadata.
With the existing approach of 1:1, arrow type <-> go type, this is not possible, we would require additional metadata to make the shift.
This PR introduces an additional metadata property to arrow that matches the typescript type used in the frontend. We can then use that type help pick which type to create