You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "mdroogh (via GitHub)" <gi...@apache.org> on 2024/12/10 21:45:55 UTC

[PR] Fix compatibility changes schema handling apache-avro 0.17 [datafusion]

mdroogh opened a new pull request, #13727:
URL: https://github.com/apache/datafusion/pull/13727

   ## Which issue does this PR close?
   
   Closes #13588.
   
   ## 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.  
   -->
   
   Making sure apache-avro can be bumped to version 0.17.
   
   ## What changes are included in this PR?
   
   - Handle ArraySchema struct in schema_to_field_with_props
   - Handle MapSchema struct in schema_to_field_with_props
   - Map BigDecimal => LargeBinary in schema_to_field_with_props
   - Map TimestampNanos => Timestamp(TimeUnit::Nanosecond, None) in schema_to_field_with_props
   - Map LocalTimestampNanos => todo!() in schema_to_field_with_props
   - Add Default to FixedSchema test
   
   ## Are these changes tested?
   
   Not really, making the code compile.
   
   ## Are there any user-facing changes?
   
   Not really.
   


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Update to apache-avro 0.17, fix compatibility changes schema handling [datafusion]

Posted by "mdroogh (via GitHub)" <gi...@apache.org>.
mdroogh commented on PR #13727:
URL: https://github.com/apache/datafusion/pull/13727#issuecomment-2535901042

   Thanks! @alamb 
   
   For next time, should I just point the MR to `main` straight away?


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Update to apache-avro 0.17, fix compatibility changes schema handling [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #13727:
URL: https://github.com/apache/datafusion/pull/13727


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Update to apache-avro 0.17, fix compatibility changes schema handling [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #13727:
URL: https://github.com/apache/datafusion/pull/13727#issuecomment-2536241823

   > Thanks! @alamb
   > 
   > For next time, should I just point the MR to `main` straight away?
   
   Yes, please!


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Update to apache-avro 0.17, fix compatibility changes schema handling [datafusion]

Posted by "mdroogh (via GitHub)" <gi...@apache.org>.
mdroogh commented on code in PR #13727:
URL: https://github.com/apache/datafusion/pull/13727#discussion_r1880137800


##########
datafusion/core/src/datasource/avro_to_arrow/schema.rs:
##########
@@ -144,14 +148,17 @@ fn schema_to_field_with_props(
         AvroSchema::Decimal(DecimalSchema {
             precision, scale, ..
         }) => DataType::Decimal128(*precision as u8, *scale as i8),
+        AvroSchema::BigDecimal => DataType::LargeBinary,

Review Comment:
   I tend to agree, it's not very clear what would be the best mapping.
   
   If it has the preference, we can also set it to "todo!()" that was done for some other types.
   



-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Update to apache-avro 0.17, fix compatibility changes schema handling [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #13727:
URL: https://github.com/apache/datafusion/pull/13727#issuecomment-2539047084

   Thanks again @mdroogh 


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Update to apache-avro 0.17 Fix compatibility changes schema handling [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #13727:
URL: https://github.com/apache/datafusion/pull/13727#discussion_r1880087687


##########
datafusion/core/src/datasource/avro_to_arrow/schema.rs:
##########
@@ -144,14 +148,17 @@ fn schema_to_field_with_props(
         AvroSchema::Decimal(DecimalSchema {
             precision, scale, ..
         }) => DataType::Decimal128(*precision as u8, *scale as i8),
+        AvroSchema::BigDecimal => DataType::LargeBinary,

Review Comment:
   I wondered if there would be a more useful mapping for `BigDecimal`, but it seems like binary is good for now:
   https://docs.rs/apache-avro/latest/apache_avro/schema/enum.Schema.html#variant.BigDecimal



-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org