Skip to content

Commit 32b38cc

Browse files
gabry-labpan3793
authored andcommitted
[KYUUBI #2626] Replace literal by FetchType.LOG
### Why are the changes needed? replace constant 1 with FetchType.LOG.toTFetchType() ### How was this patch tested? using existing UTs to test it Closes #2626 from gabrywu/fetchType. Closes #2626 7edfc3e [gabrywu] replace constant 1 with FetchType.LOG.toTFetchType() Authored-by: gabrywu <gabrywu@apache.org> Signed-off-by: Cheng Pan <chengpan@apache.org>
1 parent 098ae16 commit 32b38cc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiConnection.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.apache.commons.lang.StringUtils;
4343
import org.apache.hadoop.hive.common.auth.HiveAuthUtils;
4444
import org.apache.hive.service.auth.*;
45+
import org.apache.hive.service.cli.FetchType;
4546
import org.apache.hive.service.cli.RowSet;
4647
import org.apache.hive.service.cli.RowSetFactory;
4748
import org.apache.hive.service.cli.session.SessionUtils;
@@ -275,7 +276,7 @@ public List<String> getExecLog() throws SQLException, ClosedOrCancelledException
275276

276277
TFetchResultsReq fetchResultsReq =
277278
new TFetchResultsReq(launchEngineOpHandle, TFetchOrientation.FETCH_NEXT, fetchSize);
278-
fetchResultsReq.setFetchType((short) 1);
279+
fetchResultsReq.setFetchType(FetchType.LOG.toTFetchType());
279280

280281
List<String> logs = new ArrayList<>();
281282
try {

kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiStatement.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.sql.SQLWarning;
2727
import java.util.*;
2828
import org.apache.commons.lang.StringUtils;
29+
import org.apache.hive.service.cli.FetchType;
2930
import org.apache.hive.service.cli.RowSet;
3031
import org.apache.hive.service.cli.RowSetFactory;
3132
import org.apache.hive.service.rpc.thrift.*;
@@ -941,7 +942,7 @@ public List<String> getQueryLog(boolean incremental, int fetchSize)
941942
if (stmtHandle != null) {
942943
TFetchResultsReq tFetchResultsReq =
943944
new TFetchResultsReq(stmtHandle, getFetchOrientation(incremental), fetchSize);
944-
tFetchResultsReq.setFetchType((short) 1);
945+
tFetchResultsReq.setFetchType(FetchType.LOG.toTFetchType());
945946
tFetchResultsResp = client.FetchResults(tFetchResultsReq);
946947
Utils.verifySuccessWithInfo(tFetchResultsResp.getStatus());
947948
} else {

0 commit comments

Comments
 (0)