[
https://issues.apache.org/jira/browse/AVRO-3259?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Tzvetanov Grigorov resolved AVRO-3259.
---------------------------------------------
Fix Version/s: 1.11.1
1.12.0
Assignee: Zoltan Csizmadia
Resolution: Fixed
>From 1.11.1 on it will throw an exception if the file is encoded an unknown
>codec.
AVRO-3223 also makes it possible to register custom codecs, if needed.
> 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
> Assignee: Zoltan Csizmadia
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.11.1, 1.12.0
>
> Time Spent: 2.5h
> 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)