vinothchandar commented on a change in pull request #2759:
URL: https://github.com/apache/hudi/pull/2759#discussion_r628578256
##########
File path:
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HoodieHiveClient.java
##########
@@ -386,39 +408,18 @@ public CommandProcessorResponse
updateHiveSQLUsingHiveDriver(String sql) {
}
private List<CommandProcessorResponse> updateHiveSQLs(List<String> sqls) {
- SessionState ss = null;
- org.apache.hadoop.hive.ql.Driver hiveDriver = null;
List<CommandProcessorResponse> responses = new ArrayList<>();
try {
- final long startTime = System.currentTimeMillis();
- ss = SessionState.start(configuration);
- ss.setCurrentDatabase(syncConfig.databaseName);
- hiveDriver = new org.apache.hadoop.hive.ql.Driver(configuration);
- final long endTime = System.currentTimeMillis();
- LOG.info(String.format("Time taken to start SessionState and create
Driver: %s ms", (endTime - startTime)));
for (String sql : sqls) {
- final long start = System.currentTimeMillis();
- responses.add(hiveDriver.run(sql));
- final long end = System.currentTimeMillis();
- LOG.info(String.format("Time taken to execute [%s]: %s ms", sql, (end
- start)));
+ if (hiveDriver != null) {
+ final long start = System.currentTimeMillis();
Review comment:
a single timer can be used to measure multiple measurements actually.
its like a stack. . But I see that this is how it was. So we can skip this in
this PR.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]