difin commented on code in PR #6258:
URL: https://github.com/apache/hive/pull/6258#discussion_r2715085374
##########
serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/TimestampLocalTZTypeInfo.java:
##########
@@ -28,19 +28,27 @@ public class TimestampLocalTZTypeInfo extends
PrimitiveTypeInfo {
private static final long serialVersionUID = 1L;
private ZoneId timeZone;
+ private final int precision;
public TimestampLocalTZTypeInfo() {
- super(serdeConstants.TIMESTAMPLOCALTZ_TYPE_NAME);
+ this(6, ZoneId.systemDefault());
}
public TimestampLocalTZTypeInfo(String timeZoneStr) {
+ this(6, TimestampTZUtil.parseTimeZone(timeZoneStr));
+ }
+
+ public TimestampLocalTZTypeInfo(int precision, ZoneId timeZone) {
super(serdeConstants.TIMESTAMPLOCALTZ_TYPE_NAME);
- this.timeZone = TimestampTZUtil.parseTimeZone(timeZoneStr);
+ if (precision != 6 && precision != 9) {
+ throw new RuntimeException("Unsupported value for precision: " +
precision);
Review Comment:
The same exception error message is reused in `TimestampTypeInfo`
constructor, should we define a common error message in `ErrorMsg` for reuse?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]