[ 
https://issues.apache.org/jira/browse/AVRO-3259?focusedWorklogId=724199&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-724199
 ]

ASF GitHub Bot logged work on AVRO-3259:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Feb/22 00:44
            Start Date: 10/Feb/22 00:44
    Worklog Time Spent: 10m 
      Work Description: zcsizmadia edited a comment on pull request #1531:
URL: https://github.com/apache/avro/pull/1531#issuecomment-1034343395


   It is important to call out that avro.codec meta data is not defined, the 
codec is assumed to be "null". I guess that was the reason behind defaulting 
the codec to null in that case statement, which caused the issue in the ticket
   
   The only concern I have here is really the lack of avro.code metadata in the 
avro file, however it should be ok.  Maybe we should have a unit test which 
creates an avro file without the avro.codec metdata (if it is possible at all), 
and check the code selects the null codec.
   
   https://avro.apache.org/docs/current/spec.html (search for avro.codec)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 724199)
    Time Spent: 1h 20m  (was: 1h 10m)

> When opening an avro file which is encoded with anything besides none and 
> deflate, it defaults to none and then returns garbage.
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AVRO-3259
>                 URL: https://issues.apache.org/jira/browse/AVRO-3259
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: csharp
>    Affects Versions: 1.10.2
>            Reporter: Aleksandr Beylin
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> In the file 
> [https://github.com/apache/avro/blob/master/lang/csharp/src/apache/main/File/Codec.cs,]
>  the code is in two places which returns appropriate codec:
>  
> {code:java}
>         public static Codec CreateCodec(Type codecType)
>         {
>             switch (codecType)
>             {
>                 case Type.Deflate:
>                     return new DeflateCodec();
>                 default:
>                     return new NullCodec();
>             }
>         }{code}
> and
> {code:java}
>         public static Codec CreateCodecFromString(string codecType)
>         {
>             switch (codecType)
>             {
>                 case DataFileConstants.DeflateCodec:
>                     return new DeflateCodec();
>                 default:
>                     return new NullCodec();
>             }
>         } {code}
> Instead, if the codecType isn't null or Deflate, it should throw 
> NotImplementedException.
> I've had cases where a file encoded with snappy would first return garbage, 
> and then entirely kill the process.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to