pub struct JsonParserConfig {
pub update_format: JsonUpdateFormat,
pub json_flavor: JsonFlavor,
pub array: bool,
pub lines: JsonLines,
}Expand description
JSON parser configuration.
Describes the shape of an input JSON stream.
§Examples
A configuration with update_format="raw" and array=false
is used to parse a stream of JSON objects without any envelope
that get inserted in the input table.
{"b": false, "i": 100, "s": "foo"}
{"b": true, "i": 5, "s": "bar"}A configuration with update_format="insert_delete" and
array=false is used to parse a stream of JSON data change events
in the insert/delete format:
{"delete": {"b": false, "i": 15, "s": ""}}
{"insert": {"b": false, "i": 100, "s": "foo"}}A configuration with update_format="insert_delete" and
array=true is used to parse a stream of JSON arrays
where each array contains multiple data change events in
the insert/delete format.
[{"insert": {"b": true, "i": 0}}, {"delete": {"b": false, "i": 100, "s": "foo"}}]Fields§
§update_format: JsonUpdateFormatJSON update format.
json_flavor: JsonFlavorSpecifies JSON encoding used for individual table records.
array: boolSet to true if updates in this stream are packaged into JSON arrays.
§Example
[{"b": true, "i": 0},{"b": false, "i": 100, "s": "foo"}]lines: JsonLinesWhether JSON elements can span multiple lines.
This only affects JSON input.
Trait Implementations§
Source§impl Clone for JsonParserConfig
impl Clone for JsonParserConfig
Source§impl Debug for JsonParserConfig
impl Debug for JsonParserConfig
Source§impl Default for JsonParserConfig
impl Default for JsonParserConfig
Source§impl<'de> Deserialize<'de> for JsonParserConfigwhere
JsonParserConfig: Default,
impl<'de> Deserialize<'de> for JsonParserConfigwhere
JsonParserConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for JsonParserConfig
impl Serialize for JsonParserConfig
Auto Trait Implementations§
impl Forget for JsonParserConfig
impl Freeze for JsonParserConfig
impl RefUnwindSafe for JsonParserConfig
impl Send for JsonParserConfig
impl Sync for JsonParserConfig
impl Unpin for JsonParserConfig
impl UnsafeUnpin for JsonParserConfig
impl UnwindSafe for JsonParserConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more