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/04/23 17:56:32 UTC

[GitHub] [arrow-rs] tfeda opened a new pull request, #1612: Update datatypes in parquet::basic::LogicalType

tfeda opened a new pull request, #1612:
URL: https://github.com/apache/arrow-rs/pull/1612

   # 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 #1554.
   
   # Rationale for this change
    
    <!---
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   # What changes are included in this PR?
   
   <!---
   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?
   See #1554. I can provide more detail if needed, but nothing really goes beyond the scope of the issue.
   
   <!---
   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] tustvold commented on a diff in pull request #1612: Update datatypes in parquet::basic::LogicalType

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #1612:
URL: https://github.com/apache/arrow-rs/pull/1612#discussion_r856968984


##########
parquet/src/arrow/schema.rs:
##########
@@ -678,20 +678,20 @@ impl ParquetTypeConverter<'_> {
                 (32, false) => Ok(DataType::UInt32),
                 _ => Err(ArrowError(format!(
                     "Cannot create INT32 physical type from {:?}",
-                    t
+                    self.schema.get_basic_info().logical_type(), 

Review Comment:
   You could use `t @ LogicalType::Integer { ... }` in the match expression, so that you can use `t` here



-- 
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] tustvold commented on a diff in pull request #1612: Update datatypes in parquet::basic::LogicalType

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #1612:
URL: https://github.com/apache/arrow-rs/pull/1612#discussion_r857035945


##########
parquet/src/arrow/schema.rs:
##########
@@ -678,20 +678,20 @@ impl ParquetTypeConverter<'_> {
                 (32, false) => Ok(DataType::UInt32),
                 _ => Err(ArrowError(format!(
                     "Cannot create INT32 physical type from {:?}",
-                    t
+                    self.schema.get_basic_info().logical_type(), 

Review Comment:
   Does this help - https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=ec783c91c37289091cce85107031b3df



-- 
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] tfeda commented on a diff in pull request #1612: Update datatypes in parquet::basic::LogicalType

Posted by GitBox <gi...@apache.org>.
tfeda commented on code in PR #1612:
URL: https://github.com/apache/arrow-rs/pull/1612#discussion_r857038398


##########
parquet/src/arrow/schema.rs:
##########
@@ -678,20 +678,20 @@ impl ParquetTypeConverter<'_> {
                 (32, false) => Ok(DataType::UInt32),
                 _ => Err(ArrowError(format!(
                     "Cannot create INT32 physical type from {:?}",
-                    t
+                    self.schema.get_basic_info().logical_type(), 

Review Comment:
   Ahhhh I missed the ref, thanks. Adding a ref seemed better than deriving Copy for LogicalType, TimeUnit, MilliSeconds, etc.



-- 
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] tfeda commented on a diff in pull request #1612: Update datatypes in parquet::basic::LogicalType

Posted by GitBox <gi...@apache.org>.
tfeda commented on code in PR #1612:
URL: https://github.com/apache/arrow-rs/pull/1612#discussion_r857033174


##########
parquet/src/arrow/schema.rs:
##########
@@ -678,20 +678,20 @@ impl ParquetTypeConverter<'_> {
                 (32, false) => Ok(DataType::UInt32),
                 _ => Err(ArrowError(format!(
                     "Cannot create INT32 physical type from {:?}",
-                    t
+                    self.schema.get_basic_info().logical_type(), 

Review Comment:
   I've spent some time looking into this. This syntax causes `t` to be evaluated as a `LogicalType` rather than a `LogicalType::Integer`. It then can't use it for `match (t.bit_width, t.is_signed) `. I also tried `t @ LogicalType::Integer { bit_width, is_signed }`, but then I run into borrow issues. Is there some order-of-op trick I'm missing?



-- 
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] tfeda commented on a diff in pull request #1612: Update datatypes in parquet::basic::LogicalType

Posted by GitBox <gi...@apache.org>.
tfeda commented on code in PR #1612:
URL: https://github.com/apache/arrow-rs/pull/1612#discussion_r857033174


##########
parquet/src/arrow/schema.rs:
##########
@@ -678,20 +678,20 @@ impl ParquetTypeConverter<'_> {
                 (32, false) => Ok(DataType::UInt32),
                 _ => Err(ArrowError(format!(
                     "Cannot create INT32 physical type from {:?}",
-                    t
+                    self.schema.get_basic_info().logical_type(), 

Review Comment:
   I've spent some time looking into this. This syntax causes `t` to be evaluated as a `LogicalType` rather than a `LogicalType::IntegerType`. I then can't use it for `match (t.bit_width, t.is_signed) `. I also tried `t @ LogicalType::Integer { bit_width, is_signed }`, but then I run into borrow issues. Is there some order-of-op trick I'm missing?



-- 
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] codecov-commenter commented on pull request #1612: Update datatypes in parquet::basic::LogicalType

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #1612:
URL: https://github.com/apache/arrow-rs/pull/1612#issuecomment-1107570812

   # [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1612?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1612](https://codecov.io/gh/apache/arrow-rs/pull/1612?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eab864b) into [master](https://codecov.io/gh/apache/arrow-rs/commit/4e22b890189762c22a1d33ad8fc9662c8582977c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4e22b89) will **decrease** coverage by `0.06%`.
   > The diff coverage is `67.27%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1612      +/-   ##
   ==========================================
   - Coverage   82.95%   82.89%   -0.07%     
   ==========================================
     Files         193      193              
     Lines       55439    55461      +22     
   ==========================================
   - Hits        45992    45976      -16     
   - Misses       9447     9485      +38     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-rs/pull/1612?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [parquet\_derive/src/parquet\_field.rs](https://codecov.io/gh/apache/arrow-rs/pull/1612/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldF9kZXJpdmUvc3JjL3BhcnF1ZXRfZmllbGQucnM=) | `65.75% <0.00%> (-0.46%)` | :arrow_down: |
   | [parquet/src/schema/types.rs](https://codecov.io/gh/apache/arrow-rs/pull/1612/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvc2NoZW1hL3R5cGVzLnJz) | `85.68% <53.84%> (-0.04%)` | :arrow_down: |
   | [parquet/src/schema/printer.rs](https://codecov.io/gh/apache/arrow-rs/pull/1612/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvc2NoZW1hL3ByaW50ZXIucnM=) | `67.09% <69.76%> (-1.48%)` | :arrow_down: |
   | [parquet/src/arrow/schema.rs](https://codecov.io/gh/apache/arrow-rs/pull/1612/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvYXJyb3cvc2NoZW1hLnJz) | `86.08% <70.27%> (ø)` | |
   | [parquet/src/basic.rs](https://codecov.io/gh/apache/arrow-rs/pull/1612/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvYmFzaWMucnM=) | `91.49% <71.42%> (-2.90%)` | :arrow_down: |
   | [parquet/src/schema/parser.rs](https://codecov.io/gh/apache/arrow-rs/pull/1612/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvc2NoZW1hL3BhcnNlci5ycw==) | `84.98% <77.27%> (-0.13%)` | :arrow_down: |
   | [parquet/src/column/writer.rs](https://codecov.io/gh/apache/arrow-rs/pull/1612/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvY29sdW1uL3dyaXRlci5ycw==) | `92.42% <100.00%> (ø)` | |
   | [parquet/src/file/writer.rs](https://codecov.io/gh/apache/arrow-rs/pull/1612/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZmlsZS93cml0ZXIucnM=) | `93.30% <100.00%> (ø)` | |
   | [arrow/src/datatypes/datatype.rs](https://codecov.io/gh/apache/arrow-rs/pull/1612/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2RhdGF0eXBlcy9kYXRhdHlwZS5ycw==) | `66.40% <0.00%> (-0.40%)` | :arrow_down: |
   | ... and [1 more](https://codecov.io/gh/apache/arrow-rs/pull/1612/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1612?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1612?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4e22b89...eab864b](https://codecov.io/gh/apache/arrow-rs/pull/1612?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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] tustvold commented on a diff in pull request #1612: Update datatypes in parquet::basic::LogicalType

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #1612:
URL: https://github.com/apache/arrow-rs/pull/1612#discussion_r857035945


##########
parquet/src/arrow/schema.rs:
##########
@@ -678,20 +678,20 @@ impl ParquetTypeConverter<'_> {
                 (32, false) => Ok(DataType::UInt32),
                 _ => Err(ArrowError(format!(
                     "Cannot create INT32 physical type from {:?}",
-                    t
+                    self.schema.get_basic_info().logical_type(), 

Review Comment:
   Does this help - https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=ec783c91c37289091cce85107031b3df
   
   Btw you can drop the "ref" if you make LogicalType implement Copy



-- 
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] tustvold commented on pull request #1612: Update datatypes in parquet::basic::LogicalType

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

   Thanks again for this 👍


-- 
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] tustvold merged pull request #1612: Update datatypes in parquet::basic::LogicalType

Posted by GitBox <gi...@apache.org>.
tustvold merged PR #1612:
URL: https://github.com/apache/arrow-rs/pull/1612


-- 
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] tfeda commented on a diff in pull request #1612: Update datatypes in parquet::basic::LogicalType

Posted by GitBox <gi...@apache.org>.
tfeda commented on code in PR #1612:
URL: https://github.com/apache/arrow-rs/pull/1612#discussion_r857033174


##########
parquet/src/arrow/schema.rs:
##########
@@ -678,20 +678,20 @@ impl ParquetTypeConverter<'_> {
                 (32, false) => Ok(DataType::UInt32),
                 _ => Err(ArrowError(format!(
                     "Cannot create INT32 physical type from {:?}",
-                    t
+                    self.schema.get_basic_info().logical_type(), 

Review Comment:
   I've spent some time looking into this. This syntax causes `t` to be evaluated as a `LogicalType` rather than a `LogicalType::Integer`. I then can't use it for `match (t.bit_width, t.is_signed) `. I also tried `t @ LogicalType::Integer { bit_width, is_signed }`, but then I run into borrow issues. Is there some order-of-op trick I'm missing?



-- 
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