shbhmrzd
01/16/2024, 6:48 AMthread 'main' panicked at src/main.rs:19:35:
called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: Unexpected (permanent) at Writer::close => deserialize json
Context:
service: webhdfs
path: webhdfs_test1/sink_file.txt
Source:
EOF while parsing a value at line 1 column 0
On checking hdfs I see files are created in atomic_write_dir but the final concat to the target file seems to be failing. It could be something trivial on my end.
Could you please help point out the issue? Thank you!
Sharing sample code
#[tokio::main]
async fn main() -> opendal::Result<()> {
let mut map = HashMap::new();
map.insert("endpoint".to_string(), "http://namenode_host:50070".to_string());
map.insert("root".to_string(), "/".to_string());
map.insert("atomic_write_dir".to_string(), "atomic_write_dir/".to_string());
let op: Operator = Operator::via_map(Scheme::Webhdfs, map)?;
let dir = op.create_dir("/webhdfs_test1/").await.unwrap();
multi_write_example(op).await.unwrap();
Ok(())
}
async fn multi_write_example(op: Operator) -> Result<()> {
let mut w = op.writer_with("/webhdfs_test1/sink_file.txt").await?;
w.write("here comes some data for line 1").await?;
w.write("line 2 starts brings in more info").await?;
w.close().await?;
Ok(())
}Xuanwo
01/16/2024, 7:38 AMXuanwo
01/16/2024, 7:38 AMshbhmrzd
01/16/2024, 8:29 AMXuanwo
01/16/2024, 8:33 AMnoredirect, it returns with the location and empty body instead.Xuanwo
01/16/2024, 8:33 AMXuanwo
01/16/2024, 8:35 AMXuanwo
01/16/2024, 8:35 AMshbhmrzd
01/16/2024, 8:40 AMshbhmrzd
01/16/2024, 8:43 AMshbhmrzd
01/17/2024, 6:52 AMContext:
uri: http://namenode:50070/webhdfs/v1/atomic_write_dir2/96c10cfe-dade-460e-906d-a7567ec978cd?op=CONCAT&sources=/atomic_write_dir2/2c9ad7ab-9c4c-41b7-a54a-070968ba41bc
response: Parts { status: 400, version: HTTP/1.1, headers: {"cache-control": "no-cache", "expires": "Wed, 17 Jan 2024 04:41:10 GMT", "expires": "Wed, 17 Jan 2024 04:41:10 GMT", "date": "Wed, 17 Jan 2024 04:41:10 GMT", "date": "Wed, 17 Jan 2024 04:41:10 GMT", "pragma": "no-cache", "pragma": "no-cache", "content-type": "application/json", "x-frame-options": "SAMEORIGIN", "transfer-encoding": "chunked"} }
service: webhdfs
path: webhdfs_test2/sink_file.txt