architjainjain commented on code in PR #6501:
URL: https://github.com/apache/hive/pull/6501#discussion_r3457350742
##########
service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:
##########
@@ -813,14 +813,21 @@ public TGetOperationStatusResp
GetOperationStatus(TGetOperationStatusReq req) th
}
TJobExecutionStatus executionStatus =
mapper.forStatus(progressUpdate.status);
- resp.setProgressUpdateResponse(new TProgressUpdateResp(
+ TProgressUpdateResp tProgressUpdateResp = new TProgressUpdateResp(
progressUpdate.headers(),
progressUpdate.rows(),
progressUpdate.progressedPercentage,
executionStatus,
progressUpdate.footerSummary,
progressUpdate.startTimeMillis
- ));
+ );
+ // HIVE-27126: Thrift regeneration omitted setStartTimeIsSet(true) from
the constructor.
+ // Explicitly call setStartTime() to set the isset flag required for
Thrift validation.
+ tProgressUpdateResp.setStartTime(progressUpdate.startTimeMillis);
+ if (progressUpdate.queueMetrics() != null &&
!progressUpdate.queueMetrics().isEmpty()) {
+ tProgressUpdateResp.setQueueMetrics(progressUpdate.queueMetrics());
+ }
+ resp.setProgressUpdateResponse(tProgressUpdateResp);
Review Comment:
This works around a Thrift code generation bug. When we regenerated Thrift
code after adding the queueMetrics field, the generated constructor for
TProgressUpdateResp accepts startTimeMillis but fails to set the isset flag.
Without this flag, Thrift serialization treats the field as unset, causing
clients to receive incomplete progress updates. The explicit setStartTime()
call ensures both the value AND the isset flag are properly set, maintaining
backward compatibility with Thrift clients.
without this test the generated file is not having the starttime isset flag
updated.
--
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]