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

Function infer_schema

datafusion/core/src/datasource/file_format/json.rs:145–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143
144 #[tokio::test]
145 async fn infer_schema() -> Result<()> {
146 let projection = None;
147 let session_ctx = SessionContext::new();
148 let state = session_ctx.state();
149 let exec = get_exec(&state, projection, None).await?;
150
151 let x: Vec<String> = exec
152 .schema()
153 .fields()
154 .iter()
155 .map(|f| format!("{}: {:?}", f.name(), f.data_type()))
156 .collect();
157 assert_eq!(vec!["a: Int64", "b: Float64", "c: Boolean", "d: Utf8",], x);
158
159 Ok(())
160 }
161
162 #[tokio::test]
163 async fn read_int_column() -> Result<()> {

Callers

nothing calls this directly

Calls 8

newFunction · 0.85
collectMethod · 0.80
get_execFunction · 0.70
stateMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
fieldsMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…