-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AVRO-2825: [csharp] Resolve: C# Logical Types throw exception on unknown logical type #2741
Changes from all commits
28d4c90
c9c1bed
3f75a9a
556cff3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -192,9 +192,14 @@ | |||||||
return ArraySchema.NewInstance(jtok, props, names, encspace); | ||||||||
if (type.Equals("map", StringComparison.Ordinal)) | ||||||||
return MapSchema.NewInstance(jtok, props, names, encspace); | ||||||||
if (null != jo["logicalType"]) // logical type based on a primitive | ||||||||
return LogicalSchema.NewInstance(jtok, props, names, encspace); | ||||||||
|
||||||||
try | ||||||||
{ | ||||||||
if (null != jo["logicalType"]) // logical type based on a primitive | ||||||||
return LogicalSchema.NewInstance(jtok, props, names, encspace); | ||||||||
} | ||||||||
// swallow exception from unknown logicalType | ||||||||
catch { } | ||||||||
Check notice Code scanning / CodeQL Generic catch clause Note
Generic catch clause.
Check notice Code scanning / CodeQL Poor error handling: empty catch block Note
Poor error handling: empty catch block.
|
||||||||
|
||||||||
Comment on lines
+195
to
+202
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can LogicalSchema.NewInstance instead be made to work with unrecognized logical types? For these purposes:
LogicalSchema.LogicalType could then be null, or perhaps an instance of a new NotSupportedLogicalType class that would pass everything through without conversion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will work on that, thanks for the feedback |
||||||||
Schema schema = PrimitiveSchema.NewInstance((string)type, props); | ||||||||
if (null != schema) | ||||||||
return schema; | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not related to logical types. Please move to a separate pull request.