Skip to content

Commit

Permalink
[hotfix][table-runtime] Avoid NPE for SliceAssigner and improve error…
Browse files Browse the repository at this point in the history
… message

This closes apache#20302
  • Loading branch information
lincoln-lil authored and fsk119 committed Jul 19, 2022
1 parent e54c864 commit 180774e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,11 @@ protected AbstractSliceAssigner(int rowtimeIndex, ZoneId shiftTimeZone) {
public final long assignSliceEnd(RowData element, ClockService clock) {
final long timestamp;
if (rowtimeIndex >= 0) {
if (element.isNullAt(rowtimeIndex)) {
throw new RuntimeException(
"RowTime field should not be null,"
+ " please convert it to a non-null long value.");
}
// Precision for row timestamp is always 3
TimestampData rowTime = element.getTimestamp(rowtimeIndex, 3);
timestamp = toUtcTimestampMills(rowTime.getMillisecond(), shiftTimeZone);
Expand Down

0 comments on commit 180774e

Please sign in to comment.