-
Notifications
You must be signed in to change notification settings - Fork 847
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
Add write method to Json Writer #1383
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1383 +/- ##
==========================================
+ Coverage 83.00% 83.02% +0.01%
==========================================
Files 181 181
Lines 52994 53016 +22
==========================================
+ Hits 43990 44015 +25
+ Misses 9004 9001 -3
Continue to review full report at Codecov.
|
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.
LGTM -- thanks @matthewmturner
Hello @alamb and @matthewmturner, Any comments on how the work in these 2 projects overlaps with work on JSON/Arrow that happens here (in https://github.com/chmp/serde_arrow |
Sure happy to sum up The basic idea is to allow record batches to be used as a "file format" for serde. A typical way of using serde is to take some Rust structs, to implement serialize, and then to generate JSON from these structs. For eaxmple: #[derive(Serialize)]
struct Example {
a: f32,
b: i32,
}
let examples = vec![
Example { a: 1.0, b: 1 },
Example { a: 2.0, b: 2 },
];
let schema = serde_arrow::Schema::from_records(&examples)?;
let batch = serde_arrow::to_record_batch(&examples, schema)?; |
That is interesting -- @chmp -- I tried to do something similar with IOx (to create RecordBatches from vec's of objects we already had and then expose them as SQL queryable tables) |
That sound's awesome could you point me to the impl for some inspiration? In case you're interested, I typed up an explanation for how |
@chmp this is as far as I got: https://github.com/influxdata/influxdb_iox/issues/1013#issuecomment-806741682 We eventually went with manual conversion to Arrow : |
Thanks for the link. The code looks actually quite similar. Def. gonna borrow the idea to support iterables directly :) |
Yeah, I would love a way to support automatically creating arrow arrays from something that implemented |
Which issue does this PR close?
Closes #1340
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?