deniskuzZ commented on code in PR #3172:
URL: https://github.com/apache/hive/pull/3172#discussion_r861546821
##########
ql/src/java/org/apache/hadoop/hive/ql/DriverUtils.java:
##########
@@ -46,26 +46,46 @@ private DriverUtils() {
throw new UnsupportedOperationException("DriverUtils should not be
instantiated!");
}
- public static void runOnDriver(HiveConf conf, String user, SessionState
sessionState,
+ @FunctionalInterface
+ private interface DriverCreator {
+ Driver createDriver(QueryState qs);
+ }
+
+ public static void runOnDriver(HiveConf conf, SessionState sessionState,
String query) throws HiveException {
- runOnDriver(conf, user, sessionState, query, null, -1);
+ runOnDriver(conf, sessionState, query, null, -1);
}
/**
* For Query Based compaction to run the query to generate the compacted
data.
*/
- public static void runOnDriver(HiveConf conf, String user,
+ public static void runOnDriver(HiveConf conf,
SessionState sessionState, String query, ValidWriteIdList writeIds, long
compactorTxnId)
throws HiveException {
if(writeIds != null && compactorTxnId < 0) {
Review Comment:
nit: space
##########
ql/src/java/org/apache/hadoop/hive/ql/DriverUtils.java:
##########
@@ -46,26 +46,46 @@ private DriverUtils() {
throw new UnsupportedOperationException("DriverUtils should not be
instantiated!");
}
- public static void runOnDriver(HiveConf conf, String user, SessionState
sessionState,
+ @FunctionalInterface
+ private interface DriverCreator {
+ Driver createDriver(QueryState qs);
+ }
+
+ public static void runOnDriver(HiveConf conf, SessionState sessionState,
String query) throws HiveException {
- runOnDriver(conf, user, sessionState, query, null, -1);
+ runOnDriver(conf, sessionState, query, null, -1);
}
/**
* For Query Based compaction to run the query to generate the compacted
data.
*/
- public static void runOnDriver(HiveConf conf, String user,
+ public static void runOnDriver(HiveConf conf,
SessionState sessionState, String query, ValidWriteIdList writeIds, long
compactorTxnId)
throws HiveException {
if(writeIds != null && compactorTxnId < 0) {
throw new
IllegalArgumentException(JavaUtils.txnIdToString(compactorTxnId) +
" is not valid. Context: " + query);
}
+ runOnDriverInternal(query, conf, sessionState, (qs) -> new Driver(qs,
writeIds, compactorTxnId));
+ }
+
+ /**
+ * For Query Based compaction to run the query to generate the compacted
data.
+ */
+ public static void runOnDriver(HiveConf conf, SessionState sessionState,
String query, long analyzeTableWriteId)
+ throws HiveException {
+ if(analyzeTableWriteId < 0) {
Review Comment:
nit: space
--
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]