Currently HiveDecimal class provided a bunch of constructors that unfortunately also throws a runtime exception. For example,
As a result, it's hard for the caller to detect error occurrences and the error handling is also complicated. In many cases, the error handling is omitted or missed. For instance,
Throwing runtime exception while expecting caller to catch seems anti-pattern. In the case of constructor, factory class or methods seem more appropriate. With such a change, the apis are cleaner, and the error handling is simplified.