You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2023/01/01 17:47:52 UTC

[GitHub] [arrow-datafusion] cfraz89 opened a new pull request, #4788: fix: ListingSchemaProvider directory paths (related: #4204)

cfraz89 opened a new pull request, #4788:
URL: https://github.com/apache/arrow-datafusion/pull/4788

   - Append trailing slash to table paths  if they are directories
   
   # Which issue does this PR close?
   Is similar to #4204 - inability to use an object store listing for a table schema.
   
   However this PR addresses tables generated from `ListingSchemaProvider`.
   
   # Rationale for this change
   I would like to set up an object store (s3) where each directory maps to a single table/schema, with the contents being made up of all files (parquet) inside the directory. By registering the schema provider like:
   
   ```
   Arc::new(ListingSchemaProvider::new(
           String::from(format!("s3://{bucket_name}")),
           "".into(),
           Arc::new(ListingTableFactory::default()),
           s3.clone(),
           String::from("PARQUET"),
           false,
       ));
   ```
   
   Then if there is a folder in the bucket, such as `userdata`, attempting to query against `userdata` table causes the s3 client to 404, as the provider creates ListingTables with paths set to the raw directory names, eg `userdata`, and in `datafusion/core/src/datasource/listing/url.rs:149`, we have:
   
   ```
           // If the prefix is a file, use a head request, otherwise list
           let is_dir = self.url.as_str().ends_with('/');
   ```
   
   Since the paths don't end with `/`, it treats the directories as files and attempts to perform `head` on them instead of listing them.
   
   This PR remedies this scenario, allowing the query to succeed.
   
   # What changes are included in this PR?
   ListingSchemaProvider is altered to track whether the table paths it has listed are directories or files. If they are directories, it creates the ListingTables with a '/' appended to the stringified table path, allowing the ListingTable to successfully list its contents.
   
   # Are these changes tested?
   Some light unit tests added.
   
   # Are there any user-facing changes?
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] ursabot commented on pull request #4788: fix: ListingSchemaProvider directory paths (related: #4204)

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #4788:
URL: https://github.com/apache/arrow-datafusion/pull/4788#issuecomment-1370205385

   Benchmark runs are scheduled for baseline = 6c0e5d9a47e0a13f3c84481ee14df31e833e6ca0 and contender = 34a8b864d08d6199547c019414b0ac77b75d8e61. 34a8b864d08d6199547c019414b0ac77b75d8e61 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/2abb61defc45454a969aee8e52c8a1a7...96c4b2dda11b4805899737eec8e2fdba/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/c029adbb01a34f31b54c977b897a6e1b...86914d833eac4891a663ba98639aa8d4/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/ba983f411dbf4e29896284f95a7eb654...28fc18566e9c4111914db29fce48bee1/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/0ce8eb0fcd6a4afb8bac6cc6462705ab...3a1c9cc2ddb849518e1a62349fb5ac56/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on pull request #4788: fix: ListingSchemaProvider directory paths (related: #4204)

Posted by GitBox <gi...@apache.org>.
alamb commented on PR #4788:
URL: https://github.com/apache/arrow-datafusion/pull/4788#issuecomment-1370200546

   Thanks again @cfraz89 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] tustvold commented on pull request #4788: fix: ListingSchemaProvider directory paths (related: #4204)

Posted by GitBox <gi...@apache.org>.
tustvold commented on PR #4788:
URL: https://github.com/apache/arrow-datafusion/pull/4788#issuecomment-1370704130

   FYI this was merged with failing clippy lints, fix in https://github.com/apache/arrow-datafusion/pull/4817


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on pull request #4788: fix: ListingSchemaProvider directory paths (related: #4204)

Posted by GitBox <gi...@apache.org>.
alamb commented on PR #4788:
URL: https://github.com/apache/arrow-datafusion/pull/4788#issuecomment-1371353734

   > FYI this was merged with failing clippy lints, fix in https://github.com/apache/arrow-datafusion/pull/4817
   
   Sorry that was my bad 😞  Thank you for fixing it @tustvold 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] cfraz89 commented on pull request #4788: fix: ListingSchemaProvider directory paths (related: #4204)

Posted by GitBox <gi...@apache.org>.
cfraz89 commented on PR #4788:
URL: https://github.com/apache/arrow-datafusion/pull/4788#issuecomment-1370507129

   No problems, thanks the great library!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb merged pull request #4788: fix: ListingSchemaProvider directory paths (related: #4204)

Posted by GitBox <gi...@apache.org>.
alamb merged PR #4788:
URL: https://github.com/apache/arrow-datafusion/pull/4788


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org