thiru-mg commented on code in PR #3326:
URL: https://github.com/apache/avro/pull/3326#discussion_r1975514962


##########
lang/c++/impl/LogicalType.cc:
##########
@@ -22,7 +22,10 @@
 namespace avro {
 
 LogicalType::LogicalType(Type type)
-    : type_(type), precision_(0), scale_(0) {}
+    : type_(type), precision_(0), scale_(0), custom_(nullptr) {}

Review Comment:
   Calling this with `CUSTOM` type constructs an invalid object of 
`LogicalType`. If someone wants a custom type, we have the constructor below at 
line 27. Can we throw if this constructor is called with `type == CUSTOM`. Then 
we can get rid of `setCustomLogicalType` function? That will keep `LogicalType` 
immutable.



-- 
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]

Reply via email to