[
https://issues.apache.org/jira/browse/AVRO-3259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17490297#comment-17490297
]
ASF subversion and git services commented on AVRO-3259:
-------------------------------------------------------
Commit ba0bd1dbdf50501d5034ec55b679d3865f2dcdf7 in avro's branch
refs/heads/branch-1.11 from Zoltan Csizmadia
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=ba0bd1d ]
AVRO-3259: Throw exception if unknown codec (#1531)
* AVRO-3259: Throw exception if unknown codec
* AVRO-3259: If codec is absent, it is assumed to be "null"
* AVRO-3259: Sync null and exception handling with Java code
Co-authored-by: Zoltan Csizmadia <[email protected]>
(cherry picked from commit 9f37f912e9bde481a14a27e5553fb61a4df1277b)
> 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: 2h 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)