You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ch...@apache.org on 2022/05/11 06:29:41 UTC
[incubator-kyuubi] branch master updated: [KYUUBI #2626] Replace literal by FetchType.LOG
This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new 32b38cc6e [KYUUBI #2626] Replace literal by FetchType.LOG
32b38cc6e is described below
commit 32b38cc6ea500b1260768445a55d3e30cd75973a
Author: gabrywu <ga...@apache.org>
AuthorDate: Wed May 11 14:29:32 2022 +0800
[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
7edfc3e5 [gabrywu] replace constant 1 with FetchType.LOG.toTFetchType()
Authored-by: gabrywu <ga...@apache.org>
Signed-off-by: Cheng Pan <ch...@apache.org>
---
.../src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiConnection.java | 3 ++-
.../src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiStatement.java | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiConnection.java b/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiConnection.java
index 6845e6438..33e5b9e55 100644
--- a/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiConnection.java
+++ b/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiConnection.java
@@ -42,6 +42,7 @@ import javax.security.sasl.SaslException;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.hive.common.auth.HiveAuthUtils;
import org.apache.hive.service.auth.*;
+import org.apache.hive.service.cli.FetchType;
import org.apache.hive.service.cli.RowSet;
import org.apache.hive.service.cli.RowSetFactory;
import org.apache.hive.service.cli.session.SessionUtils;
@@ -275,7 +276,7 @@ public class KyuubiConnection implements java.sql.Connection, KyuubiLoggable {
TFetchResultsReq fetchResultsReq =
new TFetchResultsReq(launchEngineOpHandle, TFetchOrientation.FETCH_NEXT, fetchSize);
- fetchResultsReq.setFetchType((short) 1);
+ fetchResultsReq.setFetchType(FetchType.LOG.toTFetchType());
List<String> logs = new ArrayList<>();
try {
diff --git a/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiStatement.java b/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiStatement.java
index 1352ee914..31156f5fb 100644
--- a/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiStatement.java
+++ b/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiStatement.java
@@ -26,6 +26,7 @@ import java.sql.SQLTimeoutException;
import java.sql.SQLWarning;
import java.util.*;
import org.apache.commons.lang.StringUtils;
+import org.apache.hive.service.cli.FetchType;
import org.apache.hive.service.cli.RowSet;
import org.apache.hive.service.cli.RowSetFactory;
import org.apache.hive.service.rpc.thrift.*;
@@ -941,7 +942,7 @@ public class KyuubiStatement implements java.sql.Statement, KyuubiLoggable {
if (stmtHandle != null) {
TFetchResultsReq tFetchResultsReq =
new TFetchResultsReq(stmtHandle, getFetchOrientation(incremental), fetchSize);
- tFetchResultsReq.setFetchType((short) 1);
+ tFetchResultsReq.setFetchType(FetchType.LOG.toTFetchType());
tFetchResultsResp = client.FetchResults(tFetchResultsReq);
Utils.verifySuccessWithInfo(tFetchResultsResp.getStatus());
} else {