datafusion-contrib / datafusion-objectstore-hdfs

HDFS based on Java implementation as a remote ObjectStore for DataFusion
Apache License 2.0
8 stars 8 forks source link

The example does not run correctly. #11

Open RuiSiJia opened 1 year ago

RuiSiJia commented 1 year ago
let ctx = SessionContext::new();
ctx.runtime_env().register_object_store("hdfs", "", Arc::new(HadoopFileSystem));
let table_name = "line_item";
println!(
    "Register table {} with parquet file {}",
    table_name, hdfs_file_uri
);
ctx.register_parquet(table_name, &hdfs_file_uri, ParquetReadOptions::default()).await?;

let sql = "SELECT count(*) FROM line_item";
let result = ctx.sql(sql).await?.collect().await?;

The above code cannot be run. HadoopFileSystem maybe is not correct.

yahoNanJing commented 11 months ago

Thanks @RuiSiJia for reporting this issue. It's caused by the API change of SessionContext. I'll fixed.