Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

operator.object("/admin/data/") error #107

Closed
BohuTANG opened this issue Mar 4, 2022 · 1 comment · Fixed by #112
Closed

operator.object("/admin/data/") error #107

BohuTANG opened this issue Mar 4, 2022 · 1 comment · Fixed by #112
Assignees

Comments

@BohuTANG
Copy link

BohuTANG commented Mar 4, 2022

Code

https://github.com/datafuselabs/databend/pull/4328/files#diff-1d363f761ee4a5fea885df6438f195e158da0d4adcd5e5c7d7ecfc0f03b2e019R87

// endpoint:http://127.0.0.1:9900, bucket:testbucket, path:/admin/data/
 let operator = Self::open(s3_endpoint, s3_bucket, aws_key_id, aws_secret_key).await?; -- 
 let mode = operator.object(path).metadata().await?.mode(); 

Error

2022-03-04T12:33:56.044309Z ERROR databend_query::servers::mysql::writers::query_result_writer: OnQuery Error: Code: 3006, displayText = Object { kind: ObjectNotExist, op: "stat", path: "/admin/data/", source: NotFound

Caused by:
    NotFound }.

   0: common_exception::exception_code::<impl common_exception::exception::ErrorCode>::DalError
             at common/exception/src/exception_code.rs:36:66
   1: common_exception::exception_into::<impl core::convert::From<opendal::error::Error> for common_exception::exception::ErrorCode>::from
             at common/exception/src/exception_into.rs:235:9
   2: <core::result::Result<T,F> as core::ops::try_trait::FromResidual<core::result::Result<core::convert::Infallible,E>>>::from_residual
             at /rustc/4ce3749235fc31d15ebd444b038a9877e8c700d7/library/core/src/result.rs:2064:27
   3: common_io::files::file_s3::S3File::list::{{closure}}
             at common/io/src/files/file_s3.rs:87:20
   4: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/4ce3749235fc31d15ebd444b038a9877e8c700d7/library/core/src/future/mod.rs:91:19
   5: databend_query::interpreters::interpreter_copy::CopyInterpreter::list_files::{{closure}}
             at query/src/interpreters/interpreter_copy.rs:74:81
   6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/4ce3749235fc31d15ebd444b038a9877e8c700d7/library/core/src/future/mod.rs:91:19
   7: <databend_query::interpreters::interpreter_copy::CopyInterpreter as databend_query::interpreters::interpreter::Interpreter>::execute::{{closure}}::{{closure}}
             at query/src/interpreters/interpreter_copy.rs:162:38
   8: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/4ce3749235fc31d15ebd444b038a9877e8c700d7/library/core/src/future/mod.rs:91:19
   9: <databend_query::interpreters::interpreter_copy::CopyInterpreter as databend_query::interpreters::interpreter::Interpreter>::execute::{{closure}}


Question

If we want to get all the files under a path, but the path maybe a file, so we should check the object is DIR or FILE.
How we do it?

@BohuTANG BohuTANG changed the title operator.object("/admin/data/ontime_200.csv") error operator.object("/admin/data/") error Mar 4, 2022
@Xuanwo Xuanwo self-assigned this Mar 7, 2022
@Xuanwo Xuanwo linked a pull request Mar 8, 2022 that will close this issue
@Xuanwo
Copy link
Member

Xuanwo commented Mar 8, 2022

Should be fixed in v0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants