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 2022/08/29 07:02:00 UTC
[GitHub] [arrow-rs] Dandandan opened a new pull request, #2604: Add support for CSV and JSON readers
Dandandan opened a new pull request, #2604:
URL: https://github.com/apache/arrow-rs/pull/2604
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #2603
# Rationale for this change
# What changes are included in this PR?
Support empty projection
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!---
If there are any breaking changes to public APIs, please add the `breaking change` label.
-->
--
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-rs] ursabot commented on pull request #2604: Support empty projection in CSV and JSON readers
Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #2604:
URL: https://github.com/apache/arrow-rs/pull/2604#issuecomment-1230621560
Benchmark runs are scheduled for baseline = 81f1f81025c9d5f511662f1c017ae17b5e2bff64 and contender = 248fa3091cbd081d183855ecfa8cdb0ba44787a0. 248fa3091cbd081d183855ecfa8cdb0ba44787a0 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-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/5b019d78bd364874b3f7599adf2f4f0d...3912a1fb99eb4bfeb815bbe2bfa63d72/)
[Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/bf74884ecd3647de82c953214cbc051d...6b4b448390c54c8a88cb321ac0dd6ff4/)
[Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/96a4ca2a5e8c44568e3bd88bc2f6b137...35274378395544ee8d0621bf66028a30/)
[Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/34a11e9c9f044f01ba7936423a67b036...efe25f1469b34dd581d20150faffa269/)
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-rs] Dandandan commented on pull request #2604: Support empty projection in CSV and JSON readers
Posted by GitBox <gi...@apache.org>.
Dandandan commented on PR #2604:
URL: https://github.com/apache/arrow-rs/pull/2604#issuecomment-1229916537
Some test failures related to the changes, will have a look later
--
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-rs] HaoYang670 commented on a diff in pull request #2604: Support empty projection in CSV and JSON readers
Posted by GitBox <gi...@apache.org>.
HaoYang670 commented on code in PR #2604:
URL: https://github.com/apache/arrow-rs/pull/2604#discussion_r957295418
##########
arrow/src/json/reader.rs:
##########
@@ -1178,11 +1190,16 @@ impl Decoder {
&self,
rows: &[Value],
struct_fields: &[Field],
- projection: &[String],
+ projection: &Option<Vec<String>>,
Review Comment:
BTW, we should also update the doc:
```
/// If `projection` is not empty, then all values are returned. ...
```
##########
arrow/src/csv/reader.rs:
##########
@@ -671,7 +671,16 @@ fn parse(
Some(metadata) => Schema::new_with_metadata(projected_fields, metadata),
});
- arrays.and_then(|arr| RecordBatch::try_new(projected_schema, arr))
+ arrays.and_then(|arr| {
+ RecordBatch::try_new_with_options(
+ projected_schema,
+ arr,
+ &RecordBatchOptions {
+ match_field_names: true,
+ row_count: Some(rows.len()),
Review Comment:
👍
##########
arrow/src/json/reader.rs:
##########
@@ -1178,11 +1190,16 @@ impl Decoder {
&self,
rows: &[Value],
struct_fields: &[Field],
- projection: &[String],
+ projection: &Option<Vec<String>>,
) -> Result<Vec<ArrayRef>> {
let arrays: Result<Vec<ArrayRef>> = struct_fields
.iter()
- .filter(|field| projection.is_empty() || projection.contains(field.name()))
+ .filter(|field| {
+ projection
+ .as_ref()
+ .map(|p| p.contains(field.name()))
+ .unwrap_or(true)
Review Comment:
👍
--
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-rs] Dandandan merged pull request #2604: Support empty projection in CSV and JSON readers
Posted by GitBox <gi...@apache.org>.
Dandandan merged PR #2604:
URL: https://github.com/apache/arrow-rs/pull/2604
--
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