pub struct ReadJson;Expand description
READ_JSON(path [, json_path]) - Read a whole JSON document and emit one row per object.
Accepts either a JSON array of objects ([{...}, {...}], possibly
pretty-printed across many lines) or newline-delimited JSON (JSONL); the
format is auto-detected. This is the multi-line counterpart to READ_JSONL,
which requires exactly one object per line. Pass - as the path to read
from stdin (shares the same cached-once buffer as the other stdin readers).
The optional json_path drills into a nested document to locate the rows
before tabularizing — the same dotted/[] syntax as the WEB CTE JSON_PATH
clause (see navigate_json_path). This handles the common API shape of an
object wrapping the array you want, e.g. TeamCity’s
{ "projects": { "project": [...] } } via READ_JSON('-', 'projects.project'),
or Elasticsearch’s READ_JSON('-', 'hits.hits[]._source'). The path only
finds the row set; use a normal SELECT/WHERE to pick columns and filter —
anything more (predicates, scalar plucking) is a job for a jq pre-process.
Trait Implementations§
Source§impl TableGenerator for ReadJson
impl TableGenerator for ReadJson
Source§fn columns(&self) -> Vec<DataColumn>
fn columns(&self) -> Vec<DataColumn>
Source§fn generate(&self, args: Vec<DataValue>) -> Result<Arc<DataTable>>
fn generate(&self, args: Vec<DataValue>) -> Result<Arc<DataTable>>
Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for ReadJson
impl RefUnwindSafe for ReadJson
impl Send for ReadJson
impl Sync for ReadJson
impl Unpin for ReadJson
impl UnsafeUnpin for ReadJson
impl UnwindSafe for ReadJson
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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