MCPcopy Create free account
hub / github.com/apache/datafusion / query_json_array

Function query_json_array

datafusion/core/src/datasource/file_format/json.rs:82–88  ·  view source on GitHub ↗

Register a JSON array table and run a query

(content: &str, query: &str)

Source from the content-addressed store, hash-verified

80
81 /// Register a JSON array table and run a query
82 async fn query_json_array(content: &str, query: &str) -> Result<Vec<RecordBatch>> {
83 let (_tmp_dir, path) = create_temp_json(content);
84 let ctx = SessionContext::new();
85 let options = JsonReadOptions::default().newline_delimited(false);
86 ctx.register_json("test_table", &path, options).await?;
87 ctx.sql(query).await?.collect().await
88 }
89
90 /// Register a JSON array table and run a query, return formatted string
91 async fn query_json_array_str(content: &str, query: &str) -> Result<String> {

Callers 2

query_json_array_strFunction · 0.85

Calls 6

create_temp_jsonFunction · 0.85
newFunction · 0.85
newline_delimitedMethod · 0.80
collectMethod · 0.80
sqlMethod · 0.80
register_jsonMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…