From 922a08efdc964944d8418ad6d7c24c6f2386bec4 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Sat, 17 Apr 2021 14:41:18 -0700 Subject: [PATCH] Returning to schema inference work --- README.adoc | 5 +++++ src/writer.rs | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.adoc b/README.adoc index 6c53f74..7da36f3 100644 --- a/README.adoc +++ b/README.adoc @@ -7,3 +7,8 @@ and cannot be properly updated to write directly to link:https://delta.io[Delta Lake]. + +== Related work + +link:https://docs.databricks.com/spark/latest/structured-streaming/auto-loader.html[S3 Auto-loader] + diff --git a/src/writer.rs b/src/writer.rs index 396ca22..07ea97b 100644 --- a/src/writer.rs +++ b/src/writer.rs @@ -10,7 +10,7 @@ enum WriterError { Generic, } -fn json_to_batch(json: Vec) { //-> Result { +fn json_to_batch(json: Vec) -> Result { use arrow::json::reader::*; // infer_json_schema_from_iterator is weird in that it expects each value to be wrapped in a @@ -20,17 +20,17 @@ fn json_to_batch(json: Vec) { //-> Result { println!("schema: {:#?}", schema); - //Err(WriterError::Generic) + Err(WriterError::Generic) } #[cfg(test)] mod tests { use super::*; - #[ignore] #[test] fn demo() { - let delta = deltalake::get_backend_for_uri("./data"); + let _delta = deltalake::get_backend_for_uri("./data/simple"); + todo!("Still need ta high level writer test"); } #[test] @@ -50,7 +50,6 @@ mod tests { let result = json_to_batch(value); - assert!(false); - //assert!(result.is_ok()); + assert!(result.is_ok()); } }