abstractdog commented on code in PR #5613:
URL: https://github.com/apache/hive/pull/5613#discussion_r1931555728
##########
common/src/java/org/apache/hadoop/hive/conf/HiveConf.java:
##########
@@ -5734,6 +5734,26 @@ public static enum ConfVars {
+ "a background update happens periodically to report the actual
state of the query"),
HIVE_SCHEDULED_QUERIES_CREATE_AS_ENABLED("hive.scheduled.queries.create.as.enabled",
true,
"This option sets the default behaviour of newly created scheduled
queries."),
+ HIVE_QUERY_HISTORY_SERVICE_ENABLED("hive.query.history.service.enabled",
true,
+ "Whether to start QueryHistoryService in HS2"),
+
HIVE_QUERY_HISTORY_SERVICE_EXPLAIN_PLAN_ENABLED("hive.query.history.service.explain.plan.enabled",
true,
+ "Whether to collect and store explain plan in the query history.
Default is true."),
+
HIVE_QUERY_HISTORY_SERVICE_EXEC_SUMMARY_ENABLED("hive.query.history.service.exec.summary.enabled",
true,
+ "Whether to collect and store execution summary in the query history.
Default is true."),
+
HIVE_QUERY_HISTORY_SERVICE_PERSIST_MAX_BATCH_SIZE("hive.query.history.service.persist.max.batch.size",
200,
+ "The maximum amount of records held in memory " +
+ "before query history service persists them to the target table. "
+
+ "A small value (like 1-5) will lead to more real-time behavior
with the price of small files. " +
+ "Set this to 0 to wait for the records to be persisted
synchronously (not recommended in production)."),
Review Comment:
flush is always async (for a reason, the thread used by the persistExecutor
has the session state set up for iceberg writes), the question is whether we
wait for it or not
if I want to separate with, I'll have to share the condition between those,
actually I'm fine with that
```
CountDownLatch latch = new CountDownLatch(1);
persistRecordsIfNeeded(latch);
maybeWaitForRecordsToBePersisted(maxBatchSize == 0, latch);
private void maybeWaitForRecordsToBePersisted(boolean shouldWait,
CountDownLatch condition) {
if (shouldWait) {
try {
condition.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
}
```
--
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]