diff --git common/src/java/org/apache/hadoop/hive/conf/HiveConf.java common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 1e0ffa4..b613038 100644 --- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -2392,6 +2392,11 @@ private static void populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal HIVE_SERVER2_THRIFT_CLIENT_PASSWORD("hive.server2.thrift.client.password", "anonymous","Password to use against " + "thrift client"), + // webhdfs bypass setting for fetching data + HIVE_SERVER2_WEBHDFS_BYPASS_ENABLED("hive.server2.webhdfs.bypass.enabled", false, + "Setting this property to true will have client download data by webhdfs if it is possible." + ), + // ResultSet serialization settings HIVE_SERVER2_THRIFT_RESULTSET_SERIALIZE_IN_TASKS("hive.server2.thrift.resultset.serialize.in.tasks", false, "Whether we should serialize the Thrift structures used in JDBC ResultSet RPC in task nodes.\n " + diff --git itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHA.java itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHA.java index 84644d1..37308f5 100644 --- itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHA.java +++ itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHA.java @@ -153,6 +153,39 @@ public void testMrQuery() throws Exception { testKvQuery(tableName, queryStr, resultVal); } + @Test + public void testBypassMrQuery() throws Exception { + stmt.execute("SET hive.server2.webhdfs.bypass.enabled = true"); + String tableName = "testTab2"; + String resultVal = "val_238"; + String queryStr = "SELECT * FROM " + tableName + + " where value = '" + resultVal + "'"; + + testKvQuery(tableName, queryStr, resultVal); + } + + @Test + public void testJoinQuery() throws Exception { + stmt.execute("drop table if exists testThriftJoinOrders"); + stmt.execute("drop table if exists testThriftJoinCustomers"); + stmt.execute("create table testThriftJoinOrders (orderid int, orderdate string, customerid int)"); + stmt.execute("create table testThriftJoinCustomers (customerid int, customername string, customercountry string)"); + stmt.execute("insert into testThriftJoinOrders values (1, '2015-09-09', 123), (2, '2015-10-10', 246), (3, '2015-11-11', 356)"); + stmt.execute("insert into testThriftJoinCustomers values (123, 'David', 'America'), (246, 'John', 'Canada'), (356, 'Mary', 'CostaRica')"); + ResultSet joinResultSet = stmt.executeQuery("select testThriftJoinOrders.orderid, testThriftJoinCustomers.customername from testThriftJoinOrders inner join testThriftJoinCustomers where testThriftJoinOrders.customerid=testThriftJoinCustomers.customerid"); + Map expectedResult = new HashMap(); + expectedResult.put(1, "David"); + expectedResult.put(2, "John"); + expectedResult.put(3, "Mary"); + for (int i = 1; i < 4; i++) { + assertTrue(joinResultSet.next()); + assertEquals(joinResultSet.getString(2), expectedResult.get(i)); + } + stmt.execute("drop table testThriftJoinOrders"); + stmt.execute("drop table testThriftJoinCustomers"); + stmt.close(); + } + /** * Verify if the given property contains the expected value * @param propertyName diff --git itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java index 0c313a2..7015210 100644 --- itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java +++ itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java @@ -1014,6 +1014,155 @@ private int getNucleusClassLoaderResolverMapSize() { return -1; } + @Test + public void testBypassConnection() throws Exception { + String tableName = "testTab1"; + hs2Conn = getConnection(); + Statement stmt = hs2Conn.createStatement(); + + // create table and load data + stmt.execute("DROP TABLE IF EXISTS " + tableName); + stmt.execute("CREATE TABLE " + tableName + + " (under_col INT COMMENT 'the under column', value STRING) COMMENT ' test table'"); + stmt.execute("load data local inpath '" + + kvDataFilePath.toString() + "' into table " + tableName); + + // use bypass + stmt.execute("SET hive.server2.webhdfs.bypass.enabled = true"); + ResultSet res = stmt.executeQuery("SELECT * FROM " + tableName + " ORDER BY under_col"); + assertTrue(res.next()); + assertEquals("val_0", res.getString(2)); + res.close(); + stmt.close(); + } + + @Test + public void testBypassMultipelIntermediateFiles() throws Exception { + String tableName = "testTab1"; + hs2Conn = getConnection(); + Statement stmt = hs2Conn.createStatement(); + stmt.setFetchSize(10); + + // create table and load data + stmt.execute("DROP TABLE IF EXISTS " + tableName); + stmt.execute("CREATE TABLE " + tableName + + " (under_col INT COMMENT 'the under column', value STRING) COMMENT ' test table'"); + stmt.execute("load data local inpath '" + + kvDataFilePath.toString() + "' into table " + tableName); + + // set a query which generates multiple intermediate files + stmt.execute("set mapred.reduce.tasks = 31"); + String sql = "select under_col, count(value) from testTab1 group by under_col"; + + stmt.execute("set hive.server2.webhdfs.bypass.enabled = false"); + ResultSet res = stmt.executeQuery(sql); + ArrayList bypassResults = new ArrayList(); + while (res.next()) { + bypassResults.add(res.getInt(1)); + } + + stmt.execute("set hive.server2.webhdfs.bypass.enabled = true"); + res = stmt.executeQuery(sql); + ArrayList results = new ArrayList(); + while (res.next()) { + results.add(res.getInt(1)); + } + + assertEquals(results.size(), bypassResults.size()); + for (int i = 0; i < results.size(); i++) { + assertEquals(results.get(i), bypassResults.get(i)); + } + + res.close(); + stmt.close(); + } + + @Test + public void testBypassBeforeFirst() throws Exception { + String tableName = "testTab1"; + hs2Conn = getConnection(); + Statement stmt = hs2Conn.createStatement( + ResultSet.TYPE_SCROLL_INSENSITIVE, + ResultSet.CONCUR_READ_ONLY + ); + + // create table and load data + stmt.execute("DROP TABLE IF EXISTS " + tableName); + stmt.execute("CREATE TABLE " + tableName + + " (under_col INT COMMENT 'the under column', value STRING) COMMENT ' test table'"); + stmt.execute("load data local inpath '" + + kvDataFilePath.toString() + "' into table " + tableName); + + stmt.execute("set hive.server2.webhdfs.bypass.enabled = true"); + ResultSet res = stmt.executeQuery("SELECT * FROM " + tableName + " ORDER BY under_col"); + + ArrayList results1 = new ArrayList(); + while (res.next()) { + results1.add(res.getInt(1)); + } + + res.beforeFirst(); + assertTrue(res.isBeforeFirst()); + + ArrayList results2 = new ArrayList(); + while (res.next()) { + results2.add(res.getInt(1)); + } + + assertEquals(results1.size(), results2.size()); + for (int i = 0; i < results1.size(); i++) { + assertEquals(results1.get(i), results2.get(i)); + } + + res.close(); + stmt.close(); + } + + @Test + public void testUnableUseBypassCase() throws Exception { + String tableName1 = "testTab1"; + String tableName2 = "testTab2"; + hs2Conn = getConnection(); + Statement stmt = hs2Conn.createStatement(); + + // create table and load data + stmt.execute("DROP TABLE IF EXISTS " + tableName1); + stmt.execute("DROP TABLE IF EXISTS " + tableName2); + stmt.execute("CREATE TABLE " + tableName1 + + " (under_col INT COMMENT 'the under column', value STRING) COMMENT ' test table'"); + stmt.execute("CREATE TABLE " + tableName2 + + " (under_col INT COMMENT 'the under column', value STRING) COMMENT ' test table'"); + stmt.execute("load data local inpath '" + + kvDataFilePath.toString() + "' into table " + tableName1); + + // Enable the bypass flag. But it is unable to be used in the below cases. + stmt.execute("set hive.server2.webhdfs.bypass.enabled = true"); + + // Queries don't return any results to jdbc clients. + stmt.execute("INSERT INTO TABLE " + tableName2 + " SELECT * FROM " + tableName1); + + // Queries don't execute any jobs. + ResultSet res = stmt.executeQuery("SELECT * FROM " + tableName2); + assertTrue(res.next()); + assertEquals("val_238", res.getString(2)); + + // Result data is compressed. + stmt.execute("set hive.exec.compress.output = true"); + res = stmt.executeQuery("SELECT * FROM " + tableName1 + " ORDER BY under_col"); + assertTrue(res.next()); + assertEquals("val_0", res.getString(2)); + + // Result data is not SequenceFile(default) + stmt.execute("set hive.exec.compress.output = false"); + stmt.execute("set hive.query.result.fileformat = TextFile"); + res = stmt.executeQuery("SELECT * FROM " + tableName1 + " ORDER BY under_col"); + assertTrue(res.next()); + assertEquals("val_0", res.getString(2)); + + res.close(); + stmt.close(); + } + /** * Tests ADD JAR uses Hives ReflectionUtil.CONSTRUCTOR_CACHE * diff --git itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniMr.java itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniMr.java index 637e51a..3e45924 100644 --- itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniMr.java +++ itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniMr.java @@ -287,6 +287,17 @@ public void testTempTable() throws Exception { assertTrue("Exception while querying non-existing temp table", gotException); } + @Test + public void testBypassMrQuery() throws Exception { + stmt.execute("SET hive.server2.webhdfs.bypass.enabled = true"); + String tableName = "testTab2"; + String resultVal = "val_238"; + String queryStr = "SELECT * FROM " + tableName + + " where value = '" + resultVal + "'"; + + testKvQuery(tableName, queryStr, resultVal); + } + private void checkForNotExist(ResultSet res) throws Exception { int numRows = 0; while (res.next()) { diff --git jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java index 8ac040e..ad96a64 100644 --- jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java +++ jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java @@ -157,6 +157,7 @@ public HiveConnection(String uri, Properties info) throws SQLException { supportedProtocols.add(TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V6); supportedProtocols.add(TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V7); supportedProtocols.add(TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8); + supportedProtocols.add(TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V9); if (isEmbeddedMode) { EmbeddedThriftBinaryCLIService embeddedClient = new EmbeddedThriftBinaryCLIService(); diff --git jdbc/src/java/org/apache/hive/jdbc/HiveQueryResultSet.java jdbc/src/java/org/apache/hive/jdbc/HiveQueryResultSet.java index 92fdbca..e495b94 100644 --- jdbc/src/java/org/apache/hive/jdbc/HiveQueryResultSet.java +++ jdbc/src/java/org/apache/hive/jdbc/HiveQueryResultSet.java @@ -20,17 +20,42 @@ import static org.apache.hive.service.rpc.thrift.TCLIServiceConstants.TYPE_NAMES; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; +import java.util.Arrays; import java.util.Iterator; import java.util.List; +import java.util.Map; +import java.util.Properties; import java.util.concurrent.locks.ReentrantLock; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FSDataInputStream; +import org.apache.hadoop.fs.FileStatus; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.common.type.HiveDecimal; +import org.apache.hadoop.hive.serde.serdeConstants; +import org.apache.hadoop.hive.serde2.AbstractSerDe; +import org.apache.hadoop.hive.serde2.SerDeUtils; +import org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe; +import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; +import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils; +import org.apache.hadoop.hive.serde2.objectinspector.StructField; +import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; +import org.apache.hadoop.io.BytesWritable; +import org.apache.hadoop.io.IOUtils; +import org.apache.hadoop.io.SequenceFile; +import org.apache.hadoop.io.Writable; +import org.apache.hive.common.util.ReflectionUtil; +import org.apache.hive.service.cli.ColumnDescriptor; import org.apache.hive.service.cli.RowSet; import org.apache.hive.service.cli.RowSetFactory; import org.apache.hive.service.cli.TableSchema; @@ -77,6 +102,13 @@ private boolean isScrollable = false; private boolean fetchFirst = false; + private boolean isSetTypeName = false; + private String finalDirUri; + private Configuration conf; + private AbstractSerDe serde = null; + private Map haConf = null; + private SequenceFileReader sequenceFileReader = null; + private final TProtocolVersion protocol; public static class Builder { @@ -101,6 +133,8 @@ private boolean emptyResultSet = false; private boolean isScrollable = false; private ReentrantLock transportLock = null; + private String finalDirUri; + private Map haConf; public Builder(Statement statement) throws SQLException { this.statement = statement; @@ -174,6 +208,16 @@ public Builder setTransportLock(ReentrantLock transportLock) { return this; } + public Builder setFinalDirUri(String finalDirUri) { + this.finalDirUri = finalDirUri; + return this; + } + + public Builder setHaConf(Map haConf) { + this.haConf = haConf; + return this; + } + public HiveQueryResultSet build() throws SQLException { return new HiveQueryResultSet(this); } @@ -189,6 +233,8 @@ protected HiveQueryResultSet(Builder builder) throws SQLException { this.stmtHandle = builder.stmtHandle; this.sessHandle = builder.sessHandle; this.fetchSize = builder.fetchSize; + this.finalDirUri = builder.finalDirUri; + this.haConf = builder.haConf; columnNames = new ArrayList(); normalizedColumnNames = new ArrayList(); columnTypes = new ArrayList(); @@ -263,6 +309,13 @@ private void retrieveSchema() throws SQLException { setSchema(new TableSchema(schema)); List columns = schema.getColumns(); + + if (columns != null) { + if (columns.get(0).getTypeName() != null) { + isSetTypeName = true; + } + } + for (int pos = 0; pos < schema.getColumnsSize(); pos++) { if (pos != 0) { namesSb.append(","); @@ -280,7 +333,7 @@ private void retrieveSchema() throws SQLException { } catch (SQLException eS) { throw eS; // rethrow the SQLException as is } catch (Exception ex) { - ex.printStackTrace(); + LOG.error(ex.getMessage(), ex); throw new SQLException("Could not create ResultSet: " + ex.getMessage(), ex); } } @@ -363,18 +416,56 @@ public boolean next() throws SQLException { orientation = TFetchOrientation.FETCH_FIRST; fetchedRows = null; fetchedRowsItr = null; + sequenceFileReader = null; fetchFirst = false; } if (fetchedRows == null || !fetchedRowsItr.hasNext()) { - TFetchResultsReq fetchReq = new TFetchResultsReq(stmtHandle, - orientation, fetchSize); - TFetchResultsResp fetchResp; - fetchResp = client.FetchResults(fetchReq); - Utils.verifySuccessWithInfo(fetchResp.getStatus()); + if (useBypass()) { + conf = getConf(); + serde = getSerDe(conf); + if (sequenceFileReader == null) { + sequenceFileReader = new SequenceFileReader(finalDirUri, conf); + } - TRowSet results = fetchResp.getResults(); - fetchedRows = RowSetFactory.create(results, protocol); - fetchedRowsItr = fetchedRows.iterator(); + StructObjectInspector soi = (StructObjectInspector) serde.getObjectInspector(); + List fieldRefs = soi.getAllStructFieldRefs(); + Object[] deserializedFields = new Object[fieldRefs.size()]; + Object rowObj; + ObjectInspector fieldOI; + + TableSchema tb = getSchema(); + fetchedRows = RowSetFactory.create(tb, protocol, false); + + int count = 0; + String line; + while (true) { + count++; + line = sequenceFileReader.next(); + if (line == null) break; + rowObj = serde.deserialize(new BytesWritable(line.getBytes("UTF-8"))); + for (int i = 0; i < fieldRefs.size(); i++) { + StructField fieldRef = fieldRefs.get(i); + fieldOI = fieldRef.getFieldObjectInspector(); + Object fieldData = soi.getStructFieldData(rowObj, fieldRef); + deserializedFields[i] = ObjectInspectorUtils + .copyToStandardObject(fieldData, fieldOI, + ObjectInspectorUtils.ObjectInspectorCopyOption.JAVA); + } + fetchedRows.addRow(deserializedFields); + if (count == fetchSize) break; + } + + fetchedRowsItr = fetchedRows.iterator(); + } else { + TFetchResultsReq fetchReq = new TFetchResultsReq(stmtHandle, + orientation, fetchSize); + TFetchResultsResp fetchResp; + fetchResp = client.FetchResults(fetchReq); + Utils.verifySuccessWithInfo(fetchResp.getStatus()); + TRowSet results = fetchResp.getResults(); + fetchedRows = RowSetFactory.create(results, protocol); + fetchedRowsItr = fetchedRows.iterator(); + } } String rowStr = ""; @@ -390,15 +481,121 @@ public boolean next() throws SQLException { } } catch (SQLException eS) { + LOG.error(eS.getMessage(), eS); throw eS; } catch (Exception ex) { - ex.printStackTrace(); + LOG.error(ex.getMessage(), ex); throw new SQLException("Error retrieving next row", ex); } // NOTE: fetchOne dosn't throw new SQLException("Method not supported"). return true; } + boolean useBypass() { + if (isSetTypeName == true && finalDirUri != null) return true; + return false; + } + + public Configuration getConf() { + if (conf == null) { + conf = new Configuration(); + if (haConf != null) { + for (Map.Entry e : haConf.entrySet()) { + conf.set(e.getKey(), e.getValue()); + } + } + } + return conf; + } + + private AbstractSerDe getSerDe(Configuration conf) throws SQLException { + if (serde != null) { + return serde; + } + + try { + TableSchema schema = getSchema(); + List descriptors = schema.getColumnDescriptors(); + StringBuilder nameSb = new StringBuilder(); + StringBuilder typesSb = new StringBuilder(); + ColumnDescriptor desc; + + for (int pos = 0; pos < schema.getSize(); pos++) { + if (pos != 0) { + nameSb.append(","); + typesSb.append(","); + } + desc = descriptors.get(pos); + nameSb.append(desc.getName()); + typesSb.append(desc.getTypeName().toLowerCase()); + } + String names = nameSb.toString(); + String types = typesSb.toString(); + + serde = new LazySimpleSerDe(); + Properties props = new Properties(); + if (names.length() > 0) { + props.setProperty(serdeConstants.LIST_COLUMNS, names); + } + if (types.length() > 0) { + props.setProperty(serdeConstants.LIST_COLUMN_TYPES, types); + } + SerDeUtils.initializeSerDe(serde, conf, props, null); + } catch (Exception ex) { + LOG.error(ex.getMessage(), ex); + throw new SQLException("Could not create ResultSet: " + ex.getMessage(), ex); + } + return serde; + } + + private class SequenceFileReader { + Path dirPath; + Configuration configuration; + FileSystem fs; + List arrayFiles; + Iterator iter; + SequenceFile.Reader reader = null; + Writable key = null; + Writable value = null; + + SequenceFileReader(String uri, Configuration conf) + throws IOException, URISyntaxException { + configuration = conf; + dirPath = new Path(uri); + fs = FileSystem.get(new URI(uri), conf); + arrayFiles = Arrays.asList(fs.listStatus(dirPath)); + iter = arrayFiles.iterator(); + } + + public String next() throws IOException { + if (reader == null) { + prepareReadNext(); + } + + if (reader.next(key,value)) { + return value.toString(); + } else { + if (iter.hasNext()) { + IOUtils.closeStream(reader); + prepareReadNext(); + return next(); + } else { + IOUtils.closeStream(reader); + return null; + } + } + } + + private void prepareReadNext() throws IOException { + Path filePath = iter.next().getPath(); + FSDataInputStream in = fs.open(filePath); + long length = fs.getFileStatus(filePath).getLen(); + reader = new SequenceFile.Reader(configuration, SequenceFile.Reader.stream(in), SequenceFile.Reader.length(length)); + key = (Writable) ReflectionUtil.newInstance(reader.getKeyClass(), configuration); + value = (Writable) ReflectionUtil.newInstance(reader.getValueClass(), configuration); + } + } + @Override public ResultSetMetaData getMetaData() throws SQLException { if (isClosed) { diff --git jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java index a242501..62988ff 100644 --- jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java +++ jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java @@ -64,7 +64,10 @@ Map sessConf = new HashMap(); private int fetchSize = DEFAULT_FETCH_SIZE; private boolean isScrollableResultset = false; + private String finalDirUri; + private Map haConf = null; private boolean isOperationComplete = false; + /** * We need to keep a reference to the result set to support the following: * @@ -256,7 +259,7 @@ public boolean execute(String sql) throws SQLException { } resultSet = new HiveQueryResultSet.Builder(this).setClient(client).setSessionHandle(sessHandle) .setStmtHandle(stmtHandle).setMaxRows(maxRows).setFetchSize(fetchSize) - .setScrollable(isScrollableResultset) + .setScrollable(isScrollableResultset).setFinalDirUri(finalDirUri).setHaConf(haConf) .build(); return true; } @@ -282,10 +285,10 @@ public boolean executeAsync(String sql) throws SQLException { if (!status.isHasResultSet()) { return false; } - resultSet = - new HiveQueryResultSet.Builder(this).setClient(client).setSessionHandle(sessHandle) - .setStmtHandle(stmtHandle).setMaxRows(maxRows).setFetchSize(fetchSize) - .setScrollable(isScrollableResultset).build(); + resultSet = new HiveQueryResultSet.Builder(this).setClient(client).setSessionHandle(sessHandle) + .setStmtHandle(stmtHandle).setMaxRows(maxRows).setFetchSize(fetchSize) + .setScrollable(isScrollableResultset).setFinalDirUri(finalDirUri).setHaConf(haConf) + .build(); return true; } @@ -309,6 +312,16 @@ private void runAsyncOnServer(String sql) throws SQLException { TExecuteStatementResp execResp = client.ExecuteStatement(execReq); Utils.verifySuccessWithInfo(execResp.getStatus()); stmtHandle = execResp.getOperationHandle(); + if (execResp.isSetFinalDirUri()) { + finalDirUri = execResp.getFinalDirUri(); + } else { + finalDirUri = null; + } + if (execResp.isSetHaConf()) { + haConf = execResp.getHaConf(); + } else { + haConf = null; + } isExecuteStatementFailed = false; } catch (SQLException eS) { isExecuteStatementFailed = true; diff --git ql/src/java/org/apache/hadoop/hive/ql/Driver.java ql/src/java/org/apache/hadoop/hive/ql/Driver.java index 2263192..026244c 100644 --- ql/src/java/org/apache/hadoop/hive/ql/Driver.java +++ ql/src/java/org/apache/hadoop/hive/ql/Driver.java @@ -23,6 +23,8 @@ import java.io.IOException; import java.io.PrintStream; import java.io.Serializable; +import java.net.URI; +import java.net.URISyntaxException; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -37,6 +39,13 @@ import java.util.concurrent.locks.ReentrantLock; import org.apache.commons.lang.StringUtils; +import org.apache.hadoop.hdfs.DFSConfigKeys; +import org.apache.hadoop.hdfs.DFSUtil; +import org.apache.hadoop.hdfs.HAUtil; +import org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider; +import org.apache.hadoop.mapreduce.MRJobConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.hive.common.ValidTxnList; import org.apache.hadoop.hive.conf.HiveConf; @@ -1931,6 +1940,58 @@ public boolean getResults(List res) throws IOException, CommandNeedRetryExceptio return true; } + public String getFinalDirName(Map haConf) + throws URISyntaxException { + if (useBypass()) { + URI finalDirUri = new URI(plan.getFetchTask().getTableDirName()); + if (finalDirUri.getScheme().equals("hdfs")) { + if (HAUtil.isHAEnabled(conf, DFSUtil.getNamenodeNameServiceId(conf))) { + String service = conf.get(DFSConfigKeys.DFS_NAMESERVICES); + String nnIDs = conf.get(DFSUtil.addKeySuffixes(DFSConfigKeys.DFS_HA_NAMENODES_KEY_PREFIX, service)); + haConf.put(DFSConfigKeys.FS_DEFAULT_NAME_KEY, conf.get(DFSConfigKeys.FS_DEFAULT_NAME_KEY)); + haConf.put(DFSConfigKeys.DFS_NAMESERVICES, service); + haConf.put(DFSUtil.addKeySuffixes(DFSConfigKeys.DFS_HA_NAMENODES_KEY_PREFIX, service), nnIDs); + haConf.put(DFSUtil.addKeySuffixes(DFSConfigKeys.DFS_CLIENT_FAILOVER_PROXY_PROVIDER_KEY_PREFIX, + service), ConfiguredFailoverProxyProvider.class.getName()); + for (String nnID : nnIDs.split(",")) { + String httpKey = DFSUtil.addKeySuffixes( + DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY, service, nnID); + haConf.put(httpKey, conf.get(httpKey)); + } + finalDirUri = new URI("webhdfs://" + service + finalDirUri.getPath()); + } else { + String nnHttpAddr = conf.get(DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY); + finalDirUri = new URI("webhdfs://" + nnHttpAddr + finalDirUri.getPath()); + } + } + return finalDirUri.toString(); + } + return null; + } + + public boolean useBypass() { + if(!conf.getBoolVar(ConfVars.HIVE_SERVER2_WEBHDFS_BYPASS_ENABLED)) { + return false; + } else if(plan.getFetchTask() == null) { + LOG.info("Unable to use bypass: the query does not return any results."); + return false; + } else if(conf.getBoolVar(ConfVars.COMPRESSRESULT)) { + LOG.info("Unable to use bypass: intermediate results are compressed."); + return false; + } else if(!conf.getVar(ConfVars.HIVEQUERYRESULTFILEFORMAT).equals("SequenceFile")) { + LOG.info("Unable to use bypass: intermediate results are not SequenceFile."); + return false; + } + int jobs = Utilities.getMRTasks(plan.getRootTasks()).size() + + Utilities.getTezTasks(plan.getRootTasks()).size() + + Utilities.getSparkTasks(plan.getRootTasks()).size(); + if (jobs == 0) { + LOG.info("Unable to use bypass: the query does not execute any jobs."); + return false; + } + return true; + } + public void resetFetch() throws IOException { if (isFetchingTable()) { try { diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/FetchTask.java ql/src/java/org/apache/hadoop/hive/ql/exec/FetchTask.java index dff1815..e71b0b1 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/FetchTask.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/FetchTask.java @@ -115,6 +115,13 @@ public TableDesc getTblDesc() { } /** + * Return the tableDirName of the fetchWork. + */ + public String getTableDirName() { + return work.getTblDir().toString(); + } + + /** * Return the maximum number of rows returned by fetch. */ public int getMaxRows() { diff --git service-rpc/if/TCLIService.thrift service-rpc/if/TCLIService.thrift index 5a9a785..cb33fa3 100644 --- service-rpc/if/TCLIService.thrift +++ service-rpc/if/TCLIService.thrift @@ -60,6 +60,9 @@ enum TProtocolVersion { // V8 adds support for interval types HIVE_CLI_SERVICE_PROTOCOL_V8 + + // V9 adds a optional uri of result data in ExecuteStatementResp + HIVE_CLI_SERVICE_PROTOCOL_V9 } enum TTypeId { @@ -270,6 +273,8 @@ struct TColumnDesc { 3: required i32 position 4: optional string comment + + 5: optional string typeName } // Metadata used to describe the schema (column names, types, comments) @@ -556,7 +561,7 @@ struct TOperationHandle { // which operations may be executed. struct TOpenSessionReq { // The version of the HiveServer2 protocol that the client is using. - 1: required TProtocolVersion client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8 + 1: required TProtocolVersion client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V9 // Username and password for authentication. // Depending on the authentication scheme being used, @@ -575,7 +580,7 @@ struct TOpenSessionResp { 1: required TStatus status // The protocol version that the server is using. - 2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8 + 2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V9 // Session Handle 3: optional TSessionHandle sessionHandle @@ -708,6 +713,11 @@ struct TExecuteStatementReq { struct TExecuteStatementResp { 1: required TStatus status 2: optional TOperationHandle operationHandle + + // When clients try to download data by WebHDFS and if it is possible, + // finalDirUri has the HDFS path. If that is null, clients use FetchResults. + 3: optional string finalDirUri + 4: optional map haConf } // GetTypeInfo() diff --git service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp index 0f53cb2..876427e 100644 --- service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp +++ service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp @@ -21,7 +21,8 @@ int _kTProtocolVersionValues[] = { TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V5, TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V6, TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V7, - TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V8 + TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V8, + TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V9 }; const char* _kTProtocolVersionNames[] = { "HIVE_CLI_SERVICE_PROTOCOL_V1", @@ -31,9 +32,10 @@ const char* _kTProtocolVersionNames[] = { "HIVE_CLI_SERVICE_PROTOCOL_V5", "HIVE_CLI_SERVICE_PROTOCOL_V6", "HIVE_CLI_SERVICE_PROTOCOL_V7", - "HIVE_CLI_SERVICE_PROTOCOL_V8" + "HIVE_CLI_SERVICE_PROTOCOL_V8", + "HIVE_CLI_SERVICE_PROTOCOL_V9" }; -const std::map _TProtocolVersion_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(8, _kTProtocolVersionValues, _kTProtocolVersionNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); +const std::map _TProtocolVersion_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(9, _kTProtocolVersionValues, _kTProtocolVersionNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); int _kTTypeIdValues[] = { TTypeId::BOOLEAN_TYPE, @@ -1415,6 +1417,11 @@ void TColumnDesc::__set_comment(const std::string& val) { __isset.comment = true; } +void TColumnDesc::__set_typeName(const std::string& val) { + this->typeName = val; +__isset.typeName = true; +} + uint32_t TColumnDesc::read(::apache::thrift::protocol::TProtocol* iprot) { apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); @@ -1471,6 +1478,14 @@ uint32_t TColumnDesc::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->skip(ftype); } break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->typeName); + this->__isset.typeName = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -1511,6 +1526,11 @@ uint32_t TColumnDesc::write(::apache::thrift::protocol::TProtocol* oprot) const xfer += oprot->writeString(this->comment); xfer += oprot->writeFieldEnd(); } + if (this->__isset.typeName) { + xfer += oprot->writeFieldBegin("typeName", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->typeName); + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -1522,6 +1542,7 @@ void swap(TColumnDesc &a, TColumnDesc &b) { swap(a.typeDesc, b.typeDesc); swap(a.position, b.position); swap(a.comment, b.comment); + swap(a.typeName, b.typeName); swap(a.__isset, b.__isset); } @@ -1530,6 +1551,7 @@ TColumnDesc::TColumnDesc(const TColumnDesc& other51) { typeDesc = other51.typeDesc; position = other51.position; comment = other51.comment; + typeName = other51.typeName; __isset = other51.__isset; } TColumnDesc& TColumnDesc::operator=(const TColumnDesc& other52) { @@ -1537,6 +1559,7 @@ TColumnDesc& TColumnDesc::operator=(const TColumnDesc& other52) { typeDesc = other52.typeDesc; position = other52.position; comment = other52.comment; + typeName = other52.typeName; __isset = other52.__isset; return *this; } @@ -1547,6 +1570,7 @@ void TColumnDesc::printTo(std::ostream& out) const { out << ", " << "typeDesc=" << to_string(typeDesc); out << ", " << "position=" << to_string(position); out << ", " << "comment="; (__isset.comment ? (out << to_string(comment)) : (out << "")); + out << ", " << "typeName="; (__isset.typeName ? (out << to_string(typeName)) : (out << "")); out << ")"; } @@ -5770,6 +5794,16 @@ void TExecuteStatementResp::__set_operationHandle(const TOperationHandle& val) { __isset.operationHandle = true; } +void TExecuteStatementResp::__set_finalDirUri(const std::string& val) { + this->finalDirUri = val; +__isset.finalDirUri = true; +} + +void TExecuteStatementResp::__set_haConf(const std::map & val) { + this->haConf = val; +__isset.haConf = true; +} + uint32_t TExecuteStatementResp::read(::apache::thrift::protocol::TProtocol* iprot) { apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); @@ -5808,6 +5842,37 @@ uint32_t TExecuteStatementResp::read(::apache::thrift::protocol::TProtocol* ipro xfer += iprot->skip(ftype); } break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->finalDirUri); + this->__isset.finalDirUri = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->haConf.clear(); + uint32_t _size224; + ::apache::thrift::protocol::TType _ktype225; + ::apache::thrift::protocol::TType _vtype226; + xfer += iprot->readMapBegin(_ktype225, _vtype226, _size224); + uint32_t _i228; + for (_i228 = 0; _i228 < _size224; ++_i228) + { + std::string _key229; + xfer += iprot->readString(_key229); + std::string& _val230 = this->haConf[_key229]; + xfer += iprot->readString(_val230); + } + xfer += iprot->readMapEnd(); + } + this->__isset.haConf = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -5836,6 +5901,25 @@ uint32_t TExecuteStatementResp::write(::apache::thrift::protocol::TProtocol* opr xfer += this->operationHandle.write(oprot); xfer += oprot->writeFieldEnd(); } + if (this->__isset.finalDirUri) { + xfer += oprot->writeFieldBegin("finalDirUri", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->finalDirUri); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.haConf) { + xfer += oprot->writeFieldBegin("haConf", ::apache::thrift::protocol::T_MAP, 4); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->haConf.size())); + std::map ::const_iterator _iter231; + for (_iter231 = this->haConf.begin(); _iter231 != this->haConf.end(); ++_iter231) + { + xfer += oprot->writeString(_iter231->first); + xfer += oprot->writeString(_iter231->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -5845,18 +5929,24 @@ void swap(TExecuteStatementResp &a, TExecuteStatementResp &b) { using ::std::swap; swap(a.status, b.status); swap(a.operationHandle, b.operationHandle); + swap(a.finalDirUri, b.finalDirUri); + swap(a.haConf, b.haConf); swap(a.__isset, b.__isset); } -TExecuteStatementResp::TExecuteStatementResp(const TExecuteStatementResp& other224) { - status = other224.status; - operationHandle = other224.operationHandle; - __isset = other224.__isset; +TExecuteStatementResp::TExecuteStatementResp(const TExecuteStatementResp& other232) { + status = other232.status; + operationHandle = other232.operationHandle; + finalDirUri = other232.finalDirUri; + haConf = other232.haConf; + __isset = other232.__isset; } -TExecuteStatementResp& TExecuteStatementResp::operator=(const TExecuteStatementResp& other225) { - status = other225.status; - operationHandle = other225.operationHandle; - __isset = other225.__isset; +TExecuteStatementResp& TExecuteStatementResp::operator=(const TExecuteStatementResp& other233) { + status = other233.status; + operationHandle = other233.operationHandle; + finalDirUri = other233.finalDirUri; + haConf = other233.haConf; + __isset = other233.__isset; return *this; } void TExecuteStatementResp::printTo(std::ostream& out) const { @@ -5864,6 +5954,8 @@ void TExecuteStatementResp::printTo(std::ostream& out) const { out << "TExecuteStatementResp("; out << "status=" << to_string(status); out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); + out << ", " << "finalDirUri="; (__isset.finalDirUri ? (out << to_string(finalDirUri)) : (out << "")); + out << ", " << "haConf="; (__isset.haConf ? (out << to_string(haConf)) : (out << "")); out << ")"; } @@ -5939,11 +6031,11 @@ void swap(TGetTypeInfoReq &a, TGetTypeInfoReq &b) { swap(a.sessionHandle, b.sessionHandle); } -TGetTypeInfoReq::TGetTypeInfoReq(const TGetTypeInfoReq& other226) { - sessionHandle = other226.sessionHandle; +TGetTypeInfoReq::TGetTypeInfoReq(const TGetTypeInfoReq& other234) { + sessionHandle = other234.sessionHandle; } -TGetTypeInfoReq& TGetTypeInfoReq::operator=(const TGetTypeInfoReq& other227) { - sessionHandle = other227.sessionHandle; +TGetTypeInfoReq& TGetTypeInfoReq::operator=(const TGetTypeInfoReq& other235) { + sessionHandle = other235.sessionHandle; return *this; } void TGetTypeInfoReq::printTo(std::ostream& out) const { @@ -6045,15 +6137,15 @@ void swap(TGetTypeInfoResp &a, TGetTypeInfoResp &b) { swap(a.__isset, b.__isset); } -TGetTypeInfoResp::TGetTypeInfoResp(const TGetTypeInfoResp& other228) { - status = other228.status; - operationHandle = other228.operationHandle; - __isset = other228.__isset; +TGetTypeInfoResp::TGetTypeInfoResp(const TGetTypeInfoResp& other236) { + status = other236.status; + operationHandle = other236.operationHandle; + __isset = other236.__isset; } -TGetTypeInfoResp& TGetTypeInfoResp::operator=(const TGetTypeInfoResp& other229) { - status = other229.status; - operationHandle = other229.operationHandle; - __isset = other229.__isset; +TGetTypeInfoResp& TGetTypeInfoResp::operator=(const TGetTypeInfoResp& other237) { + status = other237.status; + operationHandle = other237.operationHandle; + __isset = other237.__isset; return *this; } void TGetTypeInfoResp::printTo(std::ostream& out) const { @@ -6136,11 +6228,11 @@ void swap(TGetCatalogsReq &a, TGetCatalogsReq &b) { swap(a.sessionHandle, b.sessionHandle); } -TGetCatalogsReq::TGetCatalogsReq(const TGetCatalogsReq& other230) { - sessionHandle = other230.sessionHandle; +TGetCatalogsReq::TGetCatalogsReq(const TGetCatalogsReq& other238) { + sessionHandle = other238.sessionHandle; } -TGetCatalogsReq& TGetCatalogsReq::operator=(const TGetCatalogsReq& other231) { - sessionHandle = other231.sessionHandle; +TGetCatalogsReq& TGetCatalogsReq::operator=(const TGetCatalogsReq& other239) { + sessionHandle = other239.sessionHandle; return *this; } void TGetCatalogsReq::printTo(std::ostream& out) const { @@ -6242,15 +6334,15 @@ void swap(TGetCatalogsResp &a, TGetCatalogsResp &b) { swap(a.__isset, b.__isset); } -TGetCatalogsResp::TGetCatalogsResp(const TGetCatalogsResp& other232) { - status = other232.status; - operationHandle = other232.operationHandle; - __isset = other232.__isset; +TGetCatalogsResp::TGetCatalogsResp(const TGetCatalogsResp& other240) { + status = other240.status; + operationHandle = other240.operationHandle; + __isset = other240.__isset; } -TGetCatalogsResp& TGetCatalogsResp::operator=(const TGetCatalogsResp& other233) { - status = other233.status; - operationHandle = other233.operationHandle; - __isset = other233.__isset; +TGetCatalogsResp& TGetCatalogsResp::operator=(const TGetCatalogsResp& other241) { + status = other241.status; + operationHandle = other241.operationHandle; + __isset = other241.__isset; return *this; } void TGetCatalogsResp::printTo(std::ostream& out) const { @@ -6372,17 +6464,17 @@ void swap(TGetSchemasReq &a, TGetSchemasReq &b) { swap(a.__isset, b.__isset); } -TGetSchemasReq::TGetSchemasReq(const TGetSchemasReq& other234) { - sessionHandle = other234.sessionHandle; - catalogName = other234.catalogName; - schemaName = other234.schemaName; - __isset = other234.__isset; +TGetSchemasReq::TGetSchemasReq(const TGetSchemasReq& other242) { + sessionHandle = other242.sessionHandle; + catalogName = other242.catalogName; + schemaName = other242.schemaName; + __isset = other242.__isset; } -TGetSchemasReq& TGetSchemasReq::operator=(const TGetSchemasReq& other235) { - sessionHandle = other235.sessionHandle; - catalogName = other235.catalogName; - schemaName = other235.schemaName; - __isset = other235.__isset; +TGetSchemasReq& TGetSchemasReq::operator=(const TGetSchemasReq& other243) { + sessionHandle = other243.sessionHandle; + catalogName = other243.catalogName; + schemaName = other243.schemaName; + __isset = other243.__isset; return *this; } void TGetSchemasReq::printTo(std::ostream& out) const { @@ -6486,15 +6578,15 @@ void swap(TGetSchemasResp &a, TGetSchemasResp &b) { swap(a.__isset, b.__isset); } -TGetSchemasResp::TGetSchemasResp(const TGetSchemasResp& other236) { - status = other236.status; - operationHandle = other236.operationHandle; - __isset = other236.__isset; +TGetSchemasResp::TGetSchemasResp(const TGetSchemasResp& other244) { + status = other244.status; + operationHandle = other244.operationHandle; + __isset = other244.__isset; } -TGetSchemasResp& TGetSchemasResp::operator=(const TGetSchemasResp& other237) { - status = other237.status; - operationHandle = other237.operationHandle; - __isset = other237.__isset; +TGetSchemasResp& TGetSchemasResp::operator=(const TGetSchemasResp& other245) { + status = other245.status; + operationHandle = other245.operationHandle; + __isset = other245.__isset; return *this; } void TGetSchemasResp::printTo(std::ostream& out) const { @@ -6592,14 +6684,14 @@ uint32_t TGetTablesReq::read(::apache::thrift::protocol::TProtocol* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->tableTypes.clear(); - uint32_t _size238; - ::apache::thrift::protocol::TType _etype241; - xfer += iprot->readListBegin(_etype241, _size238); - this->tableTypes.resize(_size238); - uint32_t _i242; - for (_i242 = 0; _i242 < _size238; ++_i242) + uint32_t _size246; + ::apache::thrift::protocol::TType _etype249; + xfer += iprot->readListBegin(_etype249, _size246); + this->tableTypes.resize(_size246); + uint32_t _i250; + for (_i250 = 0; _i250 < _size246; ++_i250) { - xfer += iprot->readString(this->tableTypes[_i242]); + xfer += iprot->readString(this->tableTypes[_i250]); } xfer += iprot->readListEnd(); } @@ -6650,10 +6742,10 @@ uint32_t TGetTablesReq::write(::apache::thrift::protocol::TProtocol* oprot) cons xfer += oprot->writeFieldBegin("tableTypes", ::apache::thrift::protocol::T_LIST, 5); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->tableTypes.size())); - std::vector ::const_iterator _iter243; - for (_iter243 = this->tableTypes.begin(); _iter243 != this->tableTypes.end(); ++_iter243) + std::vector ::const_iterator _iter251; + for (_iter251 = this->tableTypes.begin(); _iter251 != this->tableTypes.end(); ++_iter251) { - xfer += oprot->writeString((*_iter243)); + xfer += oprot->writeString((*_iter251)); } xfer += oprot->writeListEnd(); } @@ -6674,21 +6766,21 @@ void swap(TGetTablesReq &a, TGetTablesReq &b) { swap(a.__isset, b.__isset); } -TGetTablesReq::TGetTablesReq(const TGetTablesReq& other244) { - sessionHandle = other244.sessionHandle; - catalogName = other244.catalogName; - schemaName = other244.schemaName; - tableName = other244.tableName; - tableTypes = other244.tableTypes; - __isset = other244.__isset; +TGetTablesReq::TGetTablesReq(const TGetTablesReq& other252) { + sessionHandle = other252.sessionHandle; + catalogName = other252.catalogName; + schemaName = other252.schemaName; + tableName = other252.tableName; + tableTypes = other252.tableTypes; + __isset = other252.__isset; } -TGetTablesReq& TGetTablesReq::operator=(const TGetTablesReq& other245) { - sessionHandle = other245.sessionHandle; - catalogName = other245.catalogName; - schemaName = other245.schemaName; - tableName = other245.tableName; - tableTypes = other245.tableTypes; - __isset = other245.__isset; +TGetTablesReq& TGetTablesReq::operator=(const TGetTablesReq& other253) { + sessionHandle = other253.sessionHandle; + catalogName = other253.catalogName; + schemaName = other253.schemaName; + tableName = other253.tableName; + tableTypes = other253.tableTypes; + __isset = other253.__isset; return *this; } void TGetTablesReq::printTo(std::ostream& out) const { @@ -6794,15 +6886,15 @@ void swap(TGetTablesResp &a, TGetTablesResp &b) { swap(a.__isset, b.__isset); } -TGetTablesResp::TGetTablesResp(const TGetTablesResp& other246) { - status = other246.status; - operationHandle = other246.operationHandle; - __isset = other246.__isset; +TGetTablesResp::TGetTablesResp(const TGetTablesResp& other254) { + status = other254.status; + operationHandle = other254.operationHandle; + __isset = other254.__isset; } -TGetTablesResp& TGetTablesResp::operator=(const TGetTablesResp& other247) { - status = other247.status; - operationHandle = other247.operationHandle; - __isset = other247.__isset; +TGetTablesResp& TGetTablesResp::operator=(const TGetTablesResp& other255) { + status = other255.status; + operationHandle = other255.operationHandle; + __isset = other255.__isset; return *this; } void TGetTablesResp::printTo(std::ostream& out) const { @@ -6885,11 +6977,11 @@ void swap(TGetTableTypesReq &a, TGetTableTypesReq &b) { swap(a.sessionHandle, b.sessionHandle); } -TGetTableTypesReq::TGetTableTypesReq(const TGetTableTypesReq& other248) { - sessionHandle = other248.sessionHandle; +TGetTableTypesReq::TGetTableTypesReq(const TGetTableTypesReq& other256) { + sessionHandle = other256.sessionHandle; } -TGetTableTypesReq& TGetTableTypesReq::operator=(const TGetTableTypesReq& other249) { - sessionHandle = other249.sessionHandle; +TGetTableTypesReq& TGetTableTypesReq::operator=(const TGetTableTypesReq& other257) { + sessionHandle = other257.sessionHandle; return *this; } void TGetTableTypesReq::printTo(std::ostream& out) const { @@ -6991,15 +7083,15 @@ void swap(TGetTableTypesResp &a, TGetTableTypesResp &b) { swap(a.__isset, b.__isset); } -TGetTableTypesResp::TGetTableTypesResp(const TGetTableTypesResp& other250) { - status = other250.status; - operationHandle = other250.operationHandle; - __isset = other250.__isset; +TGetTableTypesResp::TGetTableTypesResp(const TGetTableTypesResp& other258) { + status = other258.status; + operationHandle = other258.operationHandle; + __isset = other258.__isset; } -TGetTableTypesResp& TGetTableTypesResp::operator=(const TGetTableTypesResp& other251) { - status = other251.status; - operationHandle = other251.operationHandle; - __isset = other251.__isset; +TGetTableTypesResp& TGetTableTypesResp::operator=(const TGetTableTypesResp& other259) { + status = other259.status; + operationHandle = other259.operationHandle; + __isset = other259.__isset; return *this; } void TGetTableTypesResp::printTo(std::ostream& out) const { @@ -7159,21 +7251,21 @@ void swap(TGetColumnsReq &a, TGetColumnsReq &b) { swap(a.__isset, b.__isset); } -TGetColumnsReq::TGetColumnsReq(const TGetColumnsReq& other252) { - sessionHandle = other252.sessionHandle; - catalogName = other252.catalogName; - schemaName = other252.schemaName; - tableName = other252.tableName; - columnName = other252.columnName; - __isset = other252.__isset; +TGetColumnsReq::TGetColumnsReq(const TGetColumnsReq& other260) { + sessionHandle = other260.sessionHandle; + catalogName = other260.catalogName; + schemaName = other260.schemaName; + tableName = other260.tableName; + columnName = other260.columnName; + __isset = other260.__isset; } -TGetColumnsReq& TGetColumnsReq::operator=(const TGetColumnsReq& other253) { - sessionHandle = other253.sessionHandle; - catalogName = other253.catalogName; - schemaName = other253.schemaName; - tableName = other253.tableName; - columnName = other253.columnName; - __isset = other253.__isset; +TGetColumnsReq& TGetColumnsReq::operator=(const TGetColumnsReq& other261) { + sessionHandle = other261.sessionHandle; + catalogName = other261.catalogName; + schemaName = other261.schemaName; + tableName = other261.tableName; + columnName = other261.columnName; + __isset = other261.__isset; return *this; } void TGetColumnsReq::printTo(std::ostream& out) const { @@ -7279,15 +7371,15 @@ void swap(TGetColumnsResp &a, TGetColumnsResp &b) { swap(a.__isset, b.__isset); } -TGetColumnsResp::TGetColumnsResp(const TGetColumnsResp& other254) { - status = other254.status; - operationHandle = other254.operationHandle; - __isset = other254.__isset; +TGetColumnsResp::TGetColumnsResp(const TGetColumnsResp& other262) { + status = other262.status; + operationHandle = other262.operationHandle; + __isset = other262.__isset; } -TGetColumnsResp& TGetColumnsResp::operator=(const TGetColumnsResp& other255) { - status = other255.status; - operationHandle = other255.operationHandle; - __isset = other255.__isset; +TGetColumnsResp& TGetColumnsResp::operator=(const TGetColumnsResp& other263) { + status = other263.status; + operationHandle = other263.operationHandle; + __isset = other263.__isset; return *this; } void TGetColumnsResp::printTo(std::ostream& out) const { @@ -7429,19 +7521,19 @@ void swap(TGetFunctionsReq &a, TGetFunctionsReq &b) { swap(a.__isset, b.__isset); } -TGetFunctionsReq::TGetFunctionsReq(const TGetFunctionsReq& other256) { - sessionHandle = other256.sessionHandle; - catalogName = other256.catalogName; - schemaName = other256.schemaName; - functionName = other256.functionName; - __isset = other256.__isset; +TGetFunctionsReq::TGetFunctionsReq(const TGetFunctionsReq& other264) { + sessionHandle = other264.sessionHandle; + catalogName = other264.catalogName; + schemaName = other264.schemaName; + functionName = other264.functionName; + __isset = other264.__isset; } -TGetFunctionsReq& TGetFunctionsReq::operator=(const TGetFunctionsReq& other257) { - sessionHandle = other257.sessionHandle; - catalogName = other257.catalogName; - schemaName = other257.schemaName; - functionName = other257.functionName; - __isset = other257.__isset; +TGetFunctionsReq& TGetFunctionsReq::operator=(const TGetFunctionsReq& other265) { + sessionHandle = other265.sessionHandle; + catalogName = other265.catalogName; + schemaName = other265.schemaName; + functionName = other265.functionName; + __isset = other265.__isset; return *this; } void TGetFunctionsReq::printTo(std::ostream& out) const { @@ -7546,15 +7638,15 @@ void swap(TGetFunctionsResp &a, TGetFunctionsResp &b) { swap(a.__isset, b.__isset); } -TGetFunctionsResp::TGetFunctionsResp(const TGetFunctionsResp& other258) { - status = other258.status; - operationHandle = other258.operationHandle; - __isset = other258.__isset; +TGetFunctionsResp::TGetFunctionsResp(const TGetFunctionsResp& other266) { + status = other266.status; + operationHandle = other266.operationHandle; + __isset = other266.__isset; } -TGetFunctionsResp& TGetFunctionsResp::operator=(const TGetFunctionsResp& other259) { - status = other259.status; - operationHandle = other259.operationHandle; - __isset = other259.__isset; +TGetFunctionsResp& TGetFunctionsResp::operator=(const TGetFunctionsResp& other267) { + status = other267.status; + operationHandle = other267.operationHandle; + __isset = other267.__isset; return *this; } void TGetFunctionsResp::printTo(std::ostream& out) const { @@ -7695,19 +7787,19 @@ void swap(TGetPrimaryKeysReq &a, TGetPrimaryKeysReq &b) { swap(a.__isset, b.__isset); } -TGetPrimaryKeysReq::TGetPrimaryKeysReq(const TGetPrimaryKeysReq& other260) { - sessionHandle = other260.sessionHandle; - catalogName = other260.catalogName; - schemaName = other260.schemaName; - tableName = other260.tableName; - __isset = other260.__isset; +TGetPrimaryKeysReq::TGetPrimaryKeysReq(const TGetPrimaryKeysReq& other268) { + sessionHandle = other268.sessionHandle; + catalogName = other268.catalogName; + schemaName = other268.schemaName; + tableName = other268.tableName; + __isset = other268.__isset; } -TGetPrimaryKeysReq& TGetPrimaryKeysReq::operator=(const TGetPrimaryKeysReq& other261) { - sessionHandle = other261.sessionHandle; - catalogName = other261.catalogName; - schemaName = other261.schemaName; - tableName = other261.tableName; - __isset = other261.__isset; +TGetPrimaryKeysReq& TGetPrimaryKeysReq::operator=(const TGetPrimaryKeysReq& other269) { + sessionHandle = other269.sessionHandle; + catalogName = other269.catalogName; + schemaName = other269.schemaName; + tableName = other269.tableName; + __isset = other269.__isset; return *this; } void TGetPrimaryKeysReq::printTo(std::ostream& out) const { @@ -7812,15 +7904,15 @@ void swap(TGetPrimaryKeysResp &a, TGetPrimaryKeysResp &b) { swap(a.__isset, b.__isset); } -TGetPrimaryKeysResp::TGetPrimaryKeysResp(const TGetPrimaryKeysResp& other262) { - status = other262.status; - operationHandle = other262.operationHandle; - __isset = other262.__isset; +TGetPrimaryKeysResp::TGetPrimaryKeysResp(const TGetPrimaryKeysResp& other270) { + status = other270.status; + operationHandle = other270.operationHandle; + __isset = other270.__isset; } -TGetPrimaryKeysResp& TGetPrimaryKeysResp::operator=(const TGetPrimaryKeysResp& other263) { - status = other263.status; - operationHandle = other263.operationHandle; - __isset = other263.__isset; +TGetPrimaryKeysResp& TGetPrimaryKeysResp::operator=(const TGetPrimaryKeysResp& other271) { + status = other271.status; + operationHandle = other271.operationHandle; + __isset = other271.__isset; return *this; } void TGetPrimaryKeysResp::printTo(std::ostream& out) const { @@ -8018,25 +8110,25 @@ void swap(TGetCrossReferenceReq &a, TGetCrossReferenceReq &b) { swap(a.__isset, b.__isset); } -TGetCrossReferenceReq::TGetCrossReferenceReq(const TGetCrossReferenceReq& other264) { - sessionHandle = other264.sessionHandle; - parentCatalogName = other264.parentCatalogName; - parentSchemaName = other264.parentSchemaName; - parentTableName = other264.parentTableName; - foreignCatalogName = other264.foreignCatalogName; - foreignSchemaName = other264.foreignSchemaName; - foreignTableName = other264.foreignTableName; - __isset = other264.__isset; +TGetCrossReferenceReq::TGetCrossReferenceReq(const TGetCrossReferenceReq& other272) { + sessionHandle = other272.sessionHandle; + parentCatalogName = other272.parentCatalogName; + parentSchemaName = other272.parentSchemaName; + parentTableName = other272.parentTableName; + foreignCatalogName = other272.foreignCatalogName; + foreignSchemaName = other272.foreignSchemaName; + foreignTableName = other272.foreignTableName; + __isset = other272.__isset; } -TGetCrossReferenceReq& TGetCrossReferenceReq::operator=(const TGetCrossReferenceReq& other265) { - sessionHandle = other265.sessionHandle; - parentCatalogName = other265.parentCatalogName; - parentSchemaName = other265.parentSchemaName; - parentTableName = other265.parentTableName; - foreignCatalogName = other265.foreignCatalogName; - foreignSchemaName = other265.foreignSchemaName; - foreignTableName = other265.foreignTableName; - __isset = other265.__isset; +TGetCrossReferenceReq& TGetCrossReferenceReq::operator=(const TGetCrossReferenceReq& other273) { + sessionHandle = other273.sessionHandle; + parentCatalogName = other273.parentCatalogName; + parentSchemaName = other273.parentSchemaName; + parentTableName = other273.parentTableName; + foreignCatalogName = other273.foreignCatalogName; + foreignSchemaName = other273.foreignSchemaName; + foreignTableName = other273.foreignTableName; + __isset = other273.__isset; return *this; } void TGetCrossReferenceReq::printTo(std::ostream& out) const { @@ -8144,15 +8236,15 @@ void swap(TGetCrossReferenceResp &a, TGetCrossReferenceResp &b) { swap(a.__isset, b.__isset); } -TGetCrossReferenceResp::TGetCrossReferenceResp(const TGetCrossReferenceResp& other266) { - status = other266.status; - operationHandle = other266.operationHandle; - __isset = other266.__isset; +TGetCrossReferenceResp::TGetCrossReferenceResp(const TGetCrossReferenceResp& other274) { + status = other274.status; + operationHandle = other274.operationHandle; + __isset = other274.__isset; } -TGetCrossReferenceResp& TGetCrossReferenceResp::operator=(const TGetCrossReferenceResp& other267) { - status = other267.status; - operationHandle = other267.operationHandle; - __isset = other267.__isset; +TGetCrossReferenceResp& TGetCrossReferenceResp::operator=(const TGetCrossReferenceResp& other275) { + status = other275.status; + operationHandle = other275.operationHandle; + __isset = other275.__isset; return *this; } void TGetCrossReferenceResp::printTo(std::ostream& out) const { @@ -8235,11 +8327,11 @@ void swap(TGetOperationStatusReq &a, TGetOperationStatusReq &b) { swap(a.operationHandle, b.operationHandle); } -TGetOperationStatusReq::TGetOperationStatusReq(const TGetOperationStatusReq& other268) { - operationHandle = other268.operationHandle; +TGetOperationStatusReq::TGetOperationStatusReq(const TGetOperationStatusReq& other276) { + operationHandle = other276.operationHandle; } -TGetOperationStatusReq& TGetOperationStatusReq::operator=(const TGetOperationStatusReq& other269) { - operationHandle = other269.operationHandle; +TGetOperationStatusReq& TGetOperationStatusReq::operator=(const TGetOperationStatusReq& other277) { + operationHandle = other277.operationHandle; return *this; } void TGetOperationStatusReq::printTo(std::ostream& out) const { @@ -8330,9 +8422,9 @@ uint32_t TGetOperationStatusResp::read(::apache::thrift::protocol::TProtocol* ip break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast270; - xfer += iprot->readI32(ecast270); - this->operationState = (TOperationState::type)ecast270; + int32_t ecast278; + xfer += iprot->readI32(ecast278); + this->operationState = (TOperationState::type)ecast278; this->__isset.operationState = true; } else { xfer += iprot->skip(ftype); @@ -8476,29 +8568,29 @@ void swap(TGetOperationStatusResp &a, TGetOperationStatusResp &b) { swap(a.__isset, b.__isset); } -TGetOperationStatusResp::TGetOperationStatusResp(const TGetOperationStatusResp& other271) { - status = other271.status; - operationState = other271.operationState; - sqlState = other271.sqlState; - errorCode = other271.errorCode; - errorMessage = other271.errorMessage; - taskStatus = other271.taskStatus; - operationStarted = other271.operationStarted; - operationCompleted = other271.operationCompleted; - hasResultSet = other271.hasResultSet; - __isset = other271.__isset; -} -TGetOperationStatusResp& TGetOperationStatusResp::operator=(const TGetOperationStatusResp& other272) { - status = other272.status; - operationState = other272.operationState; - sqlState = other272.sqlState; - errorCode = other272.errorCode; - errorMessage = other272.errorMessage; - taskStatus = other272.taskStatus; - operationStarted = other272.operationStarted; - operationCompleted = other272.operationCompleted; - hasResultSet = other272.hasResultSet; - __isset = other272.__isset; +TGetOperationStatusResp::TGetOperationStatusResp(const TGetOperationStatusResp& other279) { + status = other279.status; + operationState = other279.operationState; + sqlState = other279.sqlState; + errorCode = other279.errorCode; + errorMessage = other279.errorMessage; + taskStatus = other279.taskStatus; + operationStarted = other279.operationStarted; + operationCompleted = other279.operationCompleted; + hasResultSet = other279.hasResultSet; + __isset = other279.__isset; +} +TGetOperationStatusResp& TGetOperationStatusResp::operator=(const TGetOperationStatusResp& other280) { + status = other280.status; + operationState = other280.operationState; + sqlState = other280.sqlState; + errorCode = other280.errorCode; + errorMessage = other280.errorMessage; + taskStatus = other280.taskStatus; + operationStarted = other280.operationStarted; + operationCompleted = other280.operationCompleted; + hasResultSet = other280.hasResultSet; + __isset = other280.__isset; return *this; } void TGetOperationStatusResp::printTo(std::ostream& out) const { @@ -8588,11 +8680,11 @@ void swap(TCancelOperationReq &a, TCancelOperationReq &b) { swap(a.operationHandle, b.operationHandle); } -TCancelOperationReq::TCancelOperationReq(const TCancelOperationReq& other273) { - operationHandle = other273.operationHandle; +TCancelOperationReq::TCancelOperationReq(const TCancelOperationReq& other281) { + operationHandle = other281.operationHandle; } -TCancelOperationReq& TCancelOperationReq::operator=(const TCancelOperationReq& other274) { - operationHandle = other274.operationHandle; +TCancelOperationReq& TCancelOperationReq::operator=(const TCancelOperationReq& other282) { + operationHandle = other282.operationHandle; return *this; } void TCancelOperationReq::printTo(std::ostream& out) const { @@ -8674,11 +8766,11 @@ void swap(TCancelOperationResp &a, TCancelOperationResp &b) { swap(a.status, b.status); } -TCancelOperationResp::TCancelOperationResp(const TCancelOperationResp& other275) { - status = other275.status; +TCancelOperationResp::TCancelOperationResp(const TCancelOperationResp& other283) { + status = other283.status; } -TCancelOperationResp& TCancelOperationResp::operator=(const TCancelOperationResp& other276) { - status = other276.status; +TCancelOperationResp& TCancelOperationResp::operator=(const TCancelOperationResp& other284) { + status = other284.status; return *this; } void TCancelOperationResp::printTo(std::ostream& out) const { @@ -8760,11 +8852,11 @@ void swap(TCloseOperationReq &a, TCloseOperationReq &b) { swap(a.operationHandle, b.operationHandle); } -TCloseOperationReq::TCloseOperationReq(const TCloseOperationReq& other277) { - operationHandle = other277.operationHandle; +TCloseOperationReq::TCloseOperationReq(const TCloseOperationReq& other285) { + operationHandle = other285.operationHandle; } -TCloseOperationReq& TCloseOperationReq::operator=(const TCloseOperationReq& other278) { - operationHandle = other278.operationHandle; +TCloseOperationReq& TCloseOperationReq::operator=(const TCloseOperationReq& other286) { + operationHandle = other286.operationHandle; return *this; } void TCloseOperationReq::printTo(std::ostream& out) const { @@ -8846,11 +8938,11 @@ void swap(TCloseOperationResp &a, TCloseOperationResp &b) { swap(a.status, b.status); } -TCloseOperationResp::TCloseOperationResp(const TCloseOperationResp& other279) { - status = other279.status; +TCloseOperationResp::TCloseOperationResp(const TCloseOperationResp& other287) { + status = other287.status; } -TCloseOperationResp& TCloseOperationResp::operator=(const TCloseOperationResp& other280) { - status = other280.status; +TCloseOperationResp& TCloseOperationResp::operator=(const TCloseOperationResp& other288) { + status = other288.status; return *this; } void TCloseOperationResp::printTo(std::ostream& out) const { @@ -8932,11 +9024,11 @@ void swap(TGetResultSetMetadataReq &a, TGetResultSetMetadataReq &b) { swap(a.operationHandle, b.operationHandle); } -TGetResultSetMetadataReq::TGetResultSetMetadataReq(const TGetResultSetMetadataReq& other281) { - operationHandle = other281.operationHandle; +TGetResultSetMetadataReq::TGetResultSetMetadataReq(const TGetResultSetMetadataReq& other289) { + operationHandle = other289.operationHandle; } -TGetResultSetMetadataReq& TGetResultSetMetadataReq::operator=(const TGetResultSetMetadataReq& other282) { - operationHandle = other282.operationHandle; +TGetResultSetMetadataReq& TGetResultSetMetadataReq::operator=(const TGetResultSetMetadataReq& other290) { + operationHandle = other290.operationHandle; return *this; } void TGetResultSetMetadataReq::printTo(std::ostream& out) const { @@ -9038,15 +9130,15 @@ void swap(TGetResultSetMetadataResp &a, TGetResultSetMetadataResp &b) { swap(a.__isset, b.__isset); } -TGetResultSetMetadataResp::TGetResultSetMetadataResp(const TGetResultSetMetadataResp& other283) { - status = other283.status; - schema = other283.schema; - __isset = other283.__isset; +TGetResultSetMetadataResp::TGetResultSetMetadataResp(const TGetResultSetMetadataResp& other291) { + status = other291.status; + schema = other291.schema; + __isset = other291.__isset; } -TGetResultSetMetadataResp& TGetResultSetMetadataResp::operator=(const TGetResultSetMetadataResp& other284) { - status = other284.status; - schema = other284.schema; - __isset = other284.__isset; +TGetResultSetMetadataResp& TGetResultSetMetadataResp::operator=(const TGetResultSetMetadataResp& other292) { + status = other292.status; + schema = other292.schema; + __isset = other292.__isset; return *this; } void TGetResultSetMetadataResp::printTo(std::ostream& out) const { @@ -9113,9 +9205,9 @@ uint32_t TFetchResultsReq::read(::apache::thrift::protocol::TProtocol* iprot) { break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast285; - xfer += iprot->readI32(ecast285); - this->orientation = (TFetchOrientation::type)ecast285; + int32_t ecast293; + xfer += iprot->readI32(ecast293); + this->orientation = (TFetchOrientation::type)ecast293; isset_orientation = true; } else { xfer += iprot->skip(ftype); @@ -9191,19 +9283,19 @@ void swap(TFetchResultsReq &a, TFetchResultsReq &b) { swap(a.__isset, b.__isset); } -TFetchResultsReq::TFetchResultsReq(const TFetchResultsReq& other286) { - operationHandle = other286.operationHandle; - orientation = other286.orientation; - maxRows = other286.maxRows; - fetchType = other286.fetchType; - __isset = other286.__isset; -} -TFetchResultsReq& TFetchResultsReq::operator=(const TFetchResultsReq& other287) { - operationHandle = other287.operationHandle; - orientation = other287.orientation; - maxRows = other287.maxRows; - fetchType = other287.fetchType; - __isset = other287.__isset; +TFetchResultsReq::TFetchResultsReq(const TFetchResultsReq& other294) { + operationHandle = other294.operationHandle; + orientation = other294.orientation; + maxRows = other294.maxRows; + fetchType = other294.fetchType; + __isset = other294.__isset; +} +TFetchResultsReq& TFetchResultsReq::operator=(const TFetchResultsReq& other295) { + operationHandle = other295.operationHandle; + orientation = other295.orientation; + maxRows = other295.maxRows; + fetchType = other295.fetchType; + __isset = other295.__isset; return *this; } void TFetchResultsReq::printTo(std::ostream& out) const { @@ -9327,17 +9419,17 @@ void swap(TFetchResultsResp &a, TFetchResultsResp &b) { swap(a.__isset, b.__isset); } -TFetchResultsResp::TFetchResultsResp(const TFetchResultsResp& other288) { - status = other288.status; - hasMoreRows = other288.hasMoreRows; - results = other288.results; - __isset = other288.__isset; -} -TFetchResultsResp& TFetchResultsResp::operator=(const TFetchResultsResp& other289) { - status = other289.status; - hasMoreRows = other289.hasMoreRows; - results = other289.results; - __isset = other289.__isset; +TFetchResultsResp::TFetchResultsResp(const TFetchResultsResp& other296) { + status = other296.status; + hasMoreRows = other296.hasMoreRows; + results = other296.results; + __isset = other296.__isset; +} +TFetchResultsResp& TFetchResultsResp::operator=(const TFetchResultsResp& other297) { + status = other297.status; + hasMoreRows = other297.hasMoreRows; + results = other297.results; + __isset = other297.__isset; return *this; } void TFetchResultsResp::printTo(std::ostream& out) const { @@ -9461,15 +9553,15 @@ void swap(TGetDelegationTokenReq &a, TGetDelegationTokenReq &b) { swap(a.renewer, b.renewer); } -TGetDelegationTokenReq::TGetDelegationTokenReq(const TGetDelegationTokenReq& other290) { - sessionHandle = other290.sessionHandle; - owner = other290.owner; - renewer = other290.renewer; +TGetDelegationTokenReq::TGetDelegationTokenReq(const TGetDelegationTokenReq& other298) { + sessionHandle = other298.sessionHandle; + owner = other298.owner; + renewer = other298.renewer; } -TGetDelegationTokenReq& TGetDelegationTokenReq::operator=(const TGetDelegationTokenReq& other291) { - sessionHandle = other291.sessionHandle; - owner = other291.owner; - renewer = other291.renewer; +TGetDelegationTokenReq& TGetDelegationTokenReq::operator=(const TGetDelegationTokenReq& other299) { + sessionHandle = other299.sessionHandle; + owner = other299.owner; + renewer = other299.renewer; return *this; } void TGetDelegationTokenReq::printTo(std::ostream& out) const { @@ -9573,15 +9665,15 @@ void swap(TGetDelegationTokenResp &a, TGetDelegationTokenResp &b) { swap(a.__isset, b.__isset); } -TGetDelegationTokenResp::TGetDelegationTokenResp(const TGetDelegationTokenResp& other292) { - status = other292.status; - delegationToken = other292.delegationToken; - __isset = other292.__isset; +TGetDelegationTokenResp::TGetDelegationTokenResp(const TGetDelegationTokenResp& other300) { + status = other300.status; + delegationToken = other300.delegationToken; + __isset = other300.__isset; } -TGetDelegationTokenResp& TGetDelegationTokenResp::operator=(const TGetDelegationTokenResp& other293) { - status = other293.status; - delegationToken = other293.delegationToken; - __isset = other293.__isset; +TGetDelegationTokenResp& TGetDelegationTokenResp::operator=(const TGetDelegationTokenResp& other301) { + status = other301.status; + delegationToken = other301.delegationToken; + __isset = other301.__isset; return *this; } void TGetDelegationTokenResp::printTo(std::ostream& out) const { @@ -9684,13 +9776,13 @@ void swap(TCancelDelegationTokenReq &a, TCancelDelegationTokenReq &b) { swap(a.delegationToken, b.delegationToken); } -TCancelDelegationTokenReq::TCancelDelegationTokenReq(const TCancelDelegationTokenReq& other294) { - sessionHandle = other294.sessionHandle; - delegationToken = other294.delegationToken; +TCancelDelegationTokenReq::TCancelDelegationTokenReq(const TCancelDelegationTokenReq& other302) { + sessionHandle = other302.sessionHandle; + delegationToken = other302.delegationToken; } -TCancelDelegationTokenReq& TCancelDelegationTokenReq::operator=(const TCancelDelegationTokenReq& other295) { - sessionHandle = other295.sessionHandle; - delegationToken = other295.delegationToken; +TCancelDelegationTokenReq& TCancelDelegationTokenReq::operator=(const TCancelDelegationTokenReq& other303) { + sessionHandle = other303.sessionHandle; + delegationToken = other303.delegationToken; return *this; } void TCancelDelegationTokenReq::printTo(std::ostream& out) const { @@ -9773,11 +9865,11 @@ void swap(TCancelDelegationTokenResp &a, TCancelDelegationTokenResp &b) { swap(a.status, b.status); } -TCancelDelegationTokenResp::TCancelDelegationTokenResp(const TCancelDelegationTokenResp& other296) { - status = other296.status; +TCancelDelegationTokenResp::TCancelDelegationTokenResp(const TCancelDelegationTokenResp& other304) { + status = other304.status; } -TCancelDelegationTokenResp& TCancelDelegationTokenResp::operator=(const TCancelDelegationTokenResp& other297) { - status = other297.status; +TCancelDelegationTokenResp& TCancelDelegationTokenResp::operator=(const TCancelDelegationTokenResp& other305) { + status = other305.status; return *this; } void TCancelDelegationTokenResp::printTo(std::ostream& out) const { @@ -9879,13 +9971,13 @@ void swap(TRenewDelegationTokenReq &a, TRenewDelegationTokenReq &b) { swap(a.delegationToken, b.delegationToken); } -TRenewDelegationTokenReq::TRenewDelegationTokenReq(const TRenewDelegationTokenReq& other298) { - sessionHandle = other298.sessionHandle; - delegationToken = other298.delegationToken; +TRenewDelegationTokenReq::TRenewDelegationTokenReq(const TRenewDelegationTokenReq& other306) { + sessionHandle = other306.sessionHandle; + delegationToken = other306.delegationToken; } -TRenewDelegationTokenReq& TRenewDelegationTokenReq::operator=(const TRenewDelegationTokenReq& other299) { - sessionHandle = other299.sessionHandle; - delegationToken = other299.delegationToken; +TRenewDelegationTokenReq& TRenewDelegationTokenReq::operator=(const TRenewDelegationTokenReq& other307) { + sessionHandle = other307.sessionHandle; + delegationToken = other307.delegationToken; return *this; } void TRenewDelegationTokenReq::printTo(std::ostream& out) const { @@ -9968,11 +10060,11 @@ void swap(TRenewDelegationTokenResp &a, TRenewDelegationTokenResp &b) { swap(a.status, b.status); } -TRenewDelegationTokenResp::TRenewDelegationTokenResp(const TRenewDelegationTokenResp& other300) { - status = other300.status; +TRenewDelegationTokenResp::TRenewDelegationTokenResp(const TRenewDelegationTokenResp& other308) { + status = other308.status; } -TRenewDelegationTokenResp& TRenewDelegationTokenResp::operator=(const TRenewDelegationTokenResp& other301) { - status = other301.status; +TRenewDelegationTokenResp& TRenewDelegationTokenResp::operator=(const TRenewDelegationTokenResp& other309) { + status = other309.status; return *this; } void TRenewDelegationTokenResp::printTo(std::ostream& out) const { diff --git service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h index d23b3cd..b34f9a0 100644 --- service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h +++ service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h @@ -28,7 +28,8 @@ struct TProtocolVersion { HIVE_CLI_SERVICE_PROTOCOL_V5 = 4, HIVE_CLI_SERVICE_PROTOCOL_V6 = 5, HIVE_CLI_SERVICE_PROTOCOL_V7 = 6, - HIVE_CLI_SERVICE_PROTOCOL_V8 = 7 + HIVE_CLI_SERVICE_PROTOCOL_V8 = 7, + HIVE_CLI_SERVICE_PROTOCOL_V9 = 8 }; }; @@ -809,8 +810,9 @@ inline std::ostream& operator<<(std::ostream& out, const TTypeDesc& obj) } typedef struct _TColumnDesc__isset { - _TColumnDesc__isset() : comment(false) {} + _TColumnDesc__isset() : comment(false), typeName(false) {} bool comment :1; + bool typeName :1; } _TColumnDesc__isset; class TColumnDesc { @@ -818,7 +820,7 @@ class TColumnDesc { TColumnDesc(const TColumnDesc&); TColumnDesc& operator=(const TColumnDesc&); - TColumnDesc() : columnName(), position(0), comment() { + TColumnDesc() : columnName(), position(0), comment(), typeName() { } virtual ~TColumnDesc() throw(); @@ -826,6 +828,7 @@ class TColumnDesc { TTypeDesc typeDesc; int32_t position; std::string comment; + std::string typeName; _TColumnDesc__isset __isset; @@ -837,6 +840,8 @@ class TColumnDesc { void __set_comment(const std::string& val); + void __set_typeName(const std::string& val); + bool operator == (const TColumnDesc & rhs) const { if (!(columnName == rhs.columnName)) @@ -849,6 +854,10 @@ class TColumnDesc { return false; else if (__isset.comment && !(comment == rhs.comment)) return false; + if (__isset.typeName != rhs.__isset.typeName) + return false; + else if (__isset.typeName && !(typeName == rhs.typeName)) + return false; return true; } bool operator != (const TColumnDesc &rhs) const { @@ -2128,8 +2137,8 @@ class TOpenSessionReq { TOpenSessionReq(const TOpenSessionReq&); TOpenSessionReq& operator=(const TOpenSessionReq&); - TOpenSessionReq() : client_protocol((TProtocolVersion::type)7), username(), password() { - client_protocol = (TProtocolVersion::type)7; + TOpenSessionReq() : client_protocol((TProtocolVersion::type)8), username(), password() { + client_protocol = (TProtocolVersion::type)8; } @@ -2198,8 +2207,8 @@ class TOpenSessionResp { TOpenSessionResp(const TOpenSessionResp&); TOpenSessionResp& operator=(const TOpenSessionResp&); - TOpenSessionResp() : serverProtocolVersion((TProtocolVersion::type)7) { - serverProtocolVersion = (TProtocolVersion::type)7; + TOpenSessionResp() : serverProtocolVersion((TProtocolVersion::type)8) { + serverProtocolVersion = (TProtocolVersion::type)8; } @@ -2576,8 +2585,10 @@ inline std::ostream& operator<<(std::ostream& out, const TExecuteStatementReq& o } typedef struct _TExecuteStatementResp__isset { - _TExecuteStatementResp__isset() : operationHandle(false) {} + _TExecuteStatementResp__isset() : operationHandle(false), finalDirUri(false), haConf(false) {} bool operationHandle :1; + bool finalDirUri :1; + bool haConf :1; } _TExecuteStatementResp__isset; class TExecuteStatementResp { @@ -2585,12 +2596,14 @@ class TExecuteStatementResp { TExecuteStatementResp(const TExecuteStatementResp&); TExecuteStatementResp& operator=(const TExecuteStatementResp&); - TExecuteStatementResp() { + TExecuteStatementResp() : finalDirUri() { } virtual ~TExecuteStatementResp() throw(); TStatus status; TOperationHandle operationHandle; + std::string finalDirUri; + std::map haConf; _TExecuteStatementResp__isset __isset; @@ -2598,6 +2611,10 @@ class TExecuteStatementResp { void __set_operationHandle(const TOperationHandle& val); + void __set_finalDirUri(const std::string& val); + + void __set_haConf(const std::map & val); + bool operator == (const TExecuteStatementResp & rhs) const { if (!(status == rhs.status)) @@ -2606,6 +2623,14 @@ class TExecuteStatementResp { return false; else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) return false; + if (__isset.finalDirUri != rhs.__isset.finalDirUri) + return false; + else if (__isset.finalDirUri && !(finalDirUri == rhs.finalDirUri)) + return false; + if (__isset.haConf != rhs.__isset.haConf) + return false; + else if (__isset.haConf && !(haConf == rhs.haConf)) + return false; return true; } bool operator != (const TExecuteStatementResp &rhs) const { diff --git service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TColumnDesc.java service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TColumnDesc.java index 31472c8..5bcd1f9 100644 --- service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TColumnDesc.java +++ service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TColumnDesc.java @@ -42,6 +42,7 @@ private static final org.apache.thrift.protocol.TField TYPE_DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("typeDesc", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField POSITION_FIELD_DESC = new org.apache.thrift.protocol.TField("position", org.apache.thrift.protocol.TType.I32, (short)3); private static final org.apache.thrift.protocol.TField COMMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("comment", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField TYPE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("typeName", org.apache.thrift.protocol.TType.STRING, (short)5); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -53,13 +54,15 @@ private TTypeDesc typeDesc; // required private int position; // required private String comment; // optional + private String typeName; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { COLUMN_NAME((short)1, "columnName"), TYPE_DESC((short)2, "typeDesc"), POSITION((short)3, "position"), - COMMENT((short)4, "comment"); + COMMENT((short)4, "comment"), + TYPE_NAME((short)5, "typeName"); private static final Map byName = new HashMap(); @@ -82,6 +85,8 @@ public static _Fields findByThriftId(int fieldId) { return POSITION; case 4: // COMMENT return COMMENT; + case 5: // TYPE_NAME + return TYPE_NAME; default: return null; } @@ -124,7 +129,7 @@ public String getFieldName() { // isset id assignments private static final int __POSITION_ISSET_ID = 0; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.COMMENT}; + private static final _Fields optionals[] = {_Fields.COMMENT,_Fields.TYPE_NAME}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -136,6 +141,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.COMMENT, new org.apache.thrift.meta_data.FieldMetaData("comment", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TYPE_NAME, new org.apache.thrift.meta_data.FieldMetaData("typeName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnDesc.class, metaDataMap); } @@ -170,6 +177,9 @@ public TColumnDesc(TColumnDesc other) { if (other.isSetComment()) { this.comment = other.comment; } + if (other.isSetTypeName()) { + this.typeName = other.typeName; + } } public TColumnDesc deepCopy() { @@ -183,6 +193,7 @@ public void clear() { setPositionIsSet(false); this.position = 0; this.comment = null; + this.typeName = null; } public String getColumnName() { @@ -276,6 +287,29 @@ public void setCommentIsSet(boolean value) { } } + public String getTypeName() { + return this.typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public void unsetTypeName() { + this.typeName = null; + } + + /** Returns true if field typeName is set (has been assigned a value) and false otherwise */ + public boolean isSetTypeName() { + return this.typeName != null; + } + + public void setTypeNameIsSet(boolean value) { + if (!value) { + this.typeName = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case COLUMN_NAME: @@ -310,6 +344,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case TYPE_NAME: + if (value == null) { + unsetTypeName(); + } else { + setTypeName((String)value); + } + break; + } } @@ -327,6 +369,9 @@ public Object getFieldValue(_Fields field) { case COMMENT: return getComment(); + case TYPE_NAME: + return getTypeName(); + } throw new IllegalStateException(); } @@ -346,6 +391,8 @@ public boolean isSet(_Fields field) { return isSetPosition(); case COMMENT: return isSetComment(); + case TYPE_NAME: + return isSetTypeName(); } throw new IllegalStateException(); } @@ -399,6 +446,15 @@ public boolean equals(TColumnDesc that) { return false; } + boolean this_present_typeName = true && this.isSetTypeName(); + boolean that_present_typeName = true && that.isSetTypeName(); + if (this_present_typeName || that_present_typeName) { + if (!(this_present_typeName && that_present_typeName)) + return false; + if (!this.typeName.equals(that.typeName)) + return false; + } + return true; } @@ -426,6 +482,11 @@ public int hashCode() { if (present_comment) list.add(comment); + boolean present_typeName = true && (isSetTypeName()); + list.add(present_typeName); + if (present_typeName) + list.add(typeName); + return list.hashCode(); } @@ -477,6 +538,16 @@ public int compareTo(TColumnDesc other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetTypeName()).compareTo(other.isSetTypeName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTypeName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeName, other.typeName); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -526,6 +597,16 @@ public String toString() { } first = false; } + if (isSetTypeName()) { + if (!first) sb.append(", "); + sb.append("typeName:"); + if (this.typeName == null) { + sb.append("null"); + } else { + sb.append(this.typeName); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -619,6 +700,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TColumnDesc struct) org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 5: // TYPE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.typeName = iprot.readString(); + struct.setTypeNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -652,6 +741,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TColumnDesc struct oprot.writeFieldEnd(); } } + if (struct.typeName != null) { + if (struct.isSetTypeName()) { + oprot.writeFieldBegin(TYPE_NAME_FIELD_DESC); + oprot.writeString(struct.typeName); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -676,10 +772,16 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) if (struct.isSetComment()) { optionals.set(0); } - oprot.writeBitSet(optionals, 1); + if (struct.isSetTypeName()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); if (struct.isSetComment()) { oprot.writeString(struct.comment); } + if (struct.isSetTypeName()) { + oprot.writeString(struct.typeName); + } } @Override @@ -692,11 +794,15 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) struct.setTypeDescIsSet(true); struct.position = iprot.readI32(); struct.setPositionIsSet(true); - BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.comment = iprot.readString(); struct.setCommentIsSet(true); } + if (incoming.get(1)) { + struct.typeName = iprot.readString(); + struct.setTypeNameIsSet(true); + } } } diff --git service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TExecuteStatementResp.java service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TExecuteStatementResp.java index 7101fa5..30e5845 100644 --- service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TExecuteStatementResp.java +++ service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TExecuteStatementResp.java @@ -40,6 +40,8 @@ private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField FINAL_DIR_URI_FIELD_DESC = new org.apache.thrift.protocol.TField("finalDirUri", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField HA_CONF_FIELD_DESC = new org.apache.thrift.protocol.TField("haConf", org.apache.thrift.protocol.TType.MAP, (short)4); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -49,11 +51,15 @@ private TStatus status; // required private TOperationHandle operationHandle; // optional + private String finalDirUri; // optional + private Map haConf; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); + OPERATION_HANDLE((short)2, "operationHandle"), + FINAL_DIR_URI((short)3, "finalDirUri"), + HA_CONF((short)4, "haConf"); private static final Map byName = new HashMap(); @@ -72,6 +78,10 @@ public static _Fields findByThriftId(int fieldId) { return STATUS; case 2: // OPERATION_HANDLE return OPERATION_HANDLE; + case 3: // FINAL_DIR_URI + return FINAL_DIR_URI; + case 4: // HA_CONF + return HA_CONF; default: return null; } @@ -112,7 +122,7 @@ public String getFieldName() { } // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE,_Fields.FINAL_DIR_URI,_Fields.HA_CONF}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -120,6 +130,12 @@ public String getFieldName() { new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); + tmpMap.put(_Fields.FINAL_DIR_URI, new org.apache.thrift.meta_data.FieldMetaData("finalDirUri", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.HA_CONF, new org.apache.thrift.meta_data.FieldMetaData("haConf", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementResp.class, metaDataMap); } @@ -144,6 +160,13 @@ public TExecuteStatementResp(TExecuteStatementResp other) { if (other.isSetOperationHandle()) { this.operationHandle = new TOperationHandle(other.operationHandle); } + if (other.isSetFinalDirUri()) { + this.finalDirUri = other.finalDirUri; + } + if (other.isSetHaConf()) { + Map __this__haConf = new HashMap(other.haConf); + this.haConf = __this__haConf; + } } public TExecuteStatementResp deepCopy() { @@ -154,6 +177,8 @@ public TExecuteStatementResp deepCopy() { public void clear() { this.status = null; this.operationHandle = null; + this.finalDirUri = null; + this.haConf = null; } public TStatus getStatus() { @@ -202,6 +227,63 @@ public void setOperationHandleIsSet(boolean value) { } } + public String getFinalDirUri() { + return this.finalDirUri; + } + + public void setFinalDirUri(String finalDirUri) { + this.finalDirUri = finalDirUri; + } + + public void unsetFinalDirUri() { + this.finalDirUri = null; + } + + /** Returns true if field finalDirUri is set (has been assigned a value) and false otherwise */ + public boolean isSetFinalDirUri() { + return this.finalDirUri != null; + } + + public void setFinalDirUriIsSet(boolean value) { + if (!value) { + this.finalDirUri = null; + } + } + + public int getHaConfSize() { + return (this.haConf == null) ? 0 : this.haConf.size(); + } + + public void putToHaConf(String key, String val) { + if (this.haConf == null) { + this.haConf = new HashMap(); + } + this.haConf.put(key, val); + } + + public Map getHaConf() { + return this.haConf; + } + + public void setHaConf(Map haConf) { + this.haConf = haConf; + } + + public void unsetHaConf() { + this.haConf = null; + } + + /** Returns true if field haConf is set (has been assigned a value) and false otherwise */ + public boolean isSetHaConf() { + return this.haConf != null; + } + + public void setHaConfIsSet(boolean value) { + if (!value) { + this.haConf = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: @@ -220,6 +302,22 @@ public void setFieldValue(_Fields field, Object value) { } break; + case FINAL_DIR_URI: + if (value == null) { + unsetFinalDirUri(); + } else { + setFinalDirUri((String)value); + } + break; + + case HA_CONF: + if (value == null) { + unsetHaConf(); + } else { + setHaConf((Map)value); + } + break; + } } @@ -231,6 +329,12 @@ public Object getFieldValue(_Fields field) { case OPERATION_HANDLE: return getOperationHandle(); + case FINAL_DIR_URI: + return getFinalDirUri(); + + case HA_CONF: + return getHaConf(); + } throw new IllegalStateException(); } @@ -246,6 +350,10 @@ public boolean isSet(_Fields field) { return isSetStatus(); case OPERATION_HANDLE: return isSetOperationHandle(); + case FINAL_DIR_URI: + return isSetFinalDirUri(); + case HA_CONF: + return isSetHaConf(); } throw new IllegalStateException(); } @@ -281,6 +389,24 @@ public boolean equals(TExecuteStatementResp that) { return false; } + boolean this_present_finalDirUri = true && this.isSetFinalDirUri(); + boolean that_present_finalDirUri = true && that.isSetFinalDirUri(); + if (this_present_finalDirUri || that_present_finalDirUri) { + if (!(this_present_finalDirUri && that_present_finalDirUri)) + return false; + if (!this.finalDirUri.equals(that.finalDirUri)) + return false; + } + + boolean this_present_haConf = true && this.isSetHaConf(); + boolean that_present_haConf = true && that.isSetHaConf(); + if (this_present_haConf || that_present_haConf) { + if (!(this_present_haConf && that_present_haConf)) + return false; + if (!this.haConf.equals(that.haConf)) + return false; + } + return true; } @@ -298,6 +424,16 @@ public int hashCode() { if (present_operationHandle) list.add(operationHandle); + boolean present_finalDirUri = true && (isSetFinalDirUri()); + list.add(present_finalDirUri); + if (present_finalDirUri) + list.add(finalDirUri); + + boolean present_haConf = true && (isSetHaConf()); + list.add(present_haConf); + if (present_haConf) + list.add(haConf); + return list.hashCode(); } @@ -329,6 +465,26 @@ public int compareTo(TExecuteStatementResp other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetFinalDirUri()).compareTo(other.isSetFinalDirUri()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFinalDirUri()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.finalDirUri, other.finalDirUri); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetHaConf()).compareTo(other.isSetHaConf()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHaConf()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.haConf, other.haConf); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -366,6 +522,26 @@ public String toString() { } first = false; } + if (isSetFinalDirUri()) { + if (!first) sb.append(", "); + sb.append("finalDirUri:"); + if (this.finalDirUri == null) { + sb.append("null"); + } else { + sb.append(this.finalDirUri); + } + first = false; + } + if (isSetHaConf()) { + if (!first) sb.append(", "); + sb.append("haConf:"); + if (this.haConf == null) { + sb.append("null"); + } else { + sb.append(this.haConf); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -437,6 +613,34 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementRe org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 3: // FINAL_DIR_URI + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.finalDirUri = iprot.readString(); + struct.setFinalDirUriIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // HA_CONF + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map172 = iprot.readMapBegin(); + struct.haConf = new HashMap(2*_map172.size); + String _key173; + String _val174; + for (int _i175 = 0; _i175 < _map172.size; ++_i175) + { + _key173 = iprot.readString(); + _val174 = iprot.readString(); + struct.haConf.put(_key173, _val174); + } + iprot.readMapEnd(); + } + struct.setHaConfIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -462,6 +666,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementR oprot.writeFieldEnd(); } } + if (struct.finalDirUri != null) { + if (struct.isSetFinalDirUri()) { + oprot.writeFieldBegin(FINAL_DIR_URI_FIELD_DESC); + oprot.writeString(struct.finalDirUri); + oprot.writeFieldEnd(); + } + } + if (struct.haConf != null) { + if (struct.isSetHaConf()) { + oprot.writeFieldBegin(HA_CONF_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.haConf.size())); + for (Map.Entry _iter176 : struct.haConf.entrySet()) + { + oprot.writeString(_iter176.getKey()); + oprot.writeString(_iter176.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -484,10 +710,29 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementRe if (struct.isSetOperationHandle()) { optionals.set(0); } - oprot.writeBitSet(optionals, 1); + if (struct.isSetFinalDirUri()) { + optionals.set(1); + } + if (struct.isSetHaConf()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetOperationHandle()) { struct.operationHandle.write(oprot); } + if (struct.isSetFinalDirUri()) { + oprot.writeString(struct.finalDirUri); + } + if (struct.isSetHaConf()) { + { + oprot.writeI32(struct.haConf.size()); + for (Map.Entry _iter177 : struct.haConf.entrySet()) + { + oprot.writeString(_iter177.getKey()); + oprot.writeString(_iter177.getValue()); + } + } + } } @Override @@ -496,12 +741,31 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementRes struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); } + if (incoming.get(1)) { + struct.finalDirUri = iprot.readString(); + struct.setFinalDirUriIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TMap _map178 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.haConf = new HashMap(2*_map178.size); + String _key179; + String _val180; + for (int _i181 = 0; _i181 < _map178.size; ++_i181) + { + _key179 = iprot.readString(); + _val180 = iprot.readString(); + struct.haConf.put(_key179, _val180); + } + } + struct.setHaConfIsSet(true); + } } } diff --git service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetTablesReq.java service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetTablesReq.java index 1aa3f94..471a3da 100644 --- service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetTablesReq.java +++ service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetTablesReq.java @@ -712,13 +712,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesReq struc case 5: // TABLE_TYPES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list172 = iprot.readListBegin(); - struct.tableTypes = new ArrayList(_list172.size); - String _elem173; - for (int _i174 = 0; _i174 < _list172.size; ++_i174) + org.apache.thrift.protocol.TList _list182 = iprot.readListBegin(); + struct.tableTypes = new ArrayList(_list182.size); + String _elem183; + for (int _i184 = 0; _i184 < _list182.size; ++_i184) { - _elem173 = iprot.readString(); - struct.tableTypes.add(_elem173); + _elem183 = iprot.readString(); + struct.tableTypes.add(_elem183); } iprot.readListEnd(); } @@ -771,9 +771,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesReq stru oprot.writeFieldBegin(TABLE_TYPES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.tableTypes.size())); - for (String _iter175 : struct.tableTypes) + for (String _iter185 : struct.tableTypes) { - oprot.writeString(_iter175); + oprot.writeString(_iter185); } oprot.writeListEnd(); } @@ -824,9 +824,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struc if (struct.isSetTableTypes()) { { oprot.writeI32(struct.tableTypes.size()); - for (String _iter176 : struct.tableTypes) + for (String _iter186 : struct.tableTypes) { - oprot.writeString(_iter176); + oprot.writeString(_iter186); } } } @@ -853,13 +853,13 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct } if (incoming.get(3)) { { - org.apache.thrift.protocol.TList _list177 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.tableTypes = new ArrayList(_list177.size); - String _elem178; - for (int _i179 = 0; _i179 < _list177.size; ++_i179) + org.apache.thrift.protocol.TList _list187 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.tableTypes = new ArrayList(_list187.size); + String _elem188; + for (int _i189 = 0; _i189 < _list187.size; ++_i189) { - _elem178 = iprot.readString(); - struct.tableTypes.add(_elem178); + _elem188 = iprot.readString(); + struct.tableTypes.add(_elem188); } } struct.setTableTypesIsSet(true); diff --git service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TOpenSessionReq.java service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TOpenSessionReq.java index c6279dc..18937d9 100644 --- service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TOpenSessionReq.java +++ service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TOpenSessionReq.java @@ -145,7 +145,7 @@ public String getFieldName() { } public TOpenSessionReq() { - this.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8; + this.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V9; } @@ -181,7 +181,7 @@ public TOpenSessionReq deepCopy() { @Override public void clear() { - this.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8; + this.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V9; this.username = null; this.password = null; diff --git service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TOpenSessionResp.java service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TOpenSessionResp.java index 1eaeee6..0a3c121 100644 --- service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TOpenSessionResp.java +++ service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TOpenSessionResp.java @@ -145,7 +145,7 @@ public String getFieldName() { } public TOpenSessionResp() { - this.serverProtocolVersion = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8; + this.serverProtocolVersion = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V9; } @@ -184,7 +184,7 @@ public TOpenSessionResp deepCopy() { @Override public void clear() { this.status = null; - this.serverProtocolVersion = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8; + this.serverProtocolVersion = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V9; this.sessionHandle = null; this.configuration = null; diff --git service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TProtocolVersion.java service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TProtocolVersion.java index 14d50ed..bce2a0c 100644 --- service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TProtocolVersion.java +++ service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TProtocolVersion.java @@ -19,7 +19,8 @@ HIVE_CLI_SERVICE_PROTOCOL_V5(4), HIVE_CLI_SERVICE_PROTOCOL_V6(5), HIVE_CLI_SERVICE_PROTOCOL_V7(6), - HIVE_CLI_SERVICE_PROTOCOL_V8(7); + HIVE_CLI_SERVICE_PROTOCOL_V8(7), + HIVE_CLI_SERVICE_PROTOCOL_V9(8); private final int value; @@ -56,6 +57,8 @@ public static TProtocolVersion findByValue(int value) { return HIVE_CLI_SERVICE_PROTOCOL_V7; case 7: return HIVE_CLI_SERVICE_PROTOCOL_V8; + case 8: + return HIVE_CLI_SERVICE_PROTOCOL_V9; default: return null; } diff --git service-rpc/src/gen/thrift/gen-php/Types.php service-rpc/src/gen/thrift/gen-php/Types.php index a6a257f..bbd9512 100644 --- service-rpc/src/gen/thrift/gen-php/Types.php +++ service-rpc/src/gen/thrift/gen-php/Types.php @@ -24,6 +24,7 @@ final class TProtocolVersion { const HIVE_CLI_SERVICE_PROTOCOL_V6 = 5; const HIVE_CLI_SERVICE_PROTOCOL_V7 = 6; const HIVE_CLI_SERVICE_PROTOCOL_V8 = 7; + const HIVE_CLI_SERVICE_PROTOCOL_V9 = 8; static public $__names = array( 0 => 'HIVE_CLI_SERVICE_PROTOCOL_V1', 1 => 'HIVE_CLI_SERVICE_PROTOCOL_V2', @@ -33,6 +34,7 @@ final class TProtocolVersion { 5 => 'HIVE_CLI_SERVICE_PROTOCOL_V6', 6 => 'HIVE_CLI_SERVICE_PROTOCOL_V7', 7 => 'HIVE_CLI_SERVICE_PROTOCOL_V8', + 8 => 'HIVE_CLI_SERVICE_PROTOCOL_V9', ); } @@ -1382,6 +1384,10 @@ class TColumnDesc { * @var string */ public $comment = null; + /** + * @var string + */ + public $typeName = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -1403,6 +1409,10 @@ class TColumnDesc { 'var' => 'comment', 'type' => TType::STRING, ), + 5 => array( + 'var' => 'typeName', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -1418,6 +1428,9 @@ class TColumnDesc { if (isset($vals['comment'])) { $this->comment = $vals['comment']; } + if (isset($vals['typeName'])) { + $this->typeName = $vals['typeName']; + } } } @@ -1469,6 +1482,13 @@ class TColumnDesc { $xfer += $input->skip($ftype); } break; + case 5: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->typeName); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -1505,6 +1525,11 @@ class TColumnDesc { $xfer += $output->writeString($this->comment); $xfer += $output->writeFieldEnd(); } + if ($this->typeName !== null) { + $xfer += $output->writeFieldBegin('typeName', TType::STRING, 5); + $xfer += $output->writeString($this->typeName); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -4508,7 +4533,7 @@ class TOpenSessionReq { /** * @var int */ - public $client_protocol = 7; + public $client_protocol = 8; /** * @var string */ @@ -4690,7 +4715,7 @@ class TOpenSessionResp { /** * @var int */ - public $serverProtocolVersion = 7; + public $serverProtocolVersion = 8; /** * @var \TSessionHandle */ @@ -5646,6 +5671,14 @@ class TExecuteStatementResp { * @var \TOperationHandle */ public $operationHandle = null; + /** + * @var string + */ + public $finalDirUri = null; + /** + * @var array + */ + public $haConf = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -5660,6 +5693,22 @@ class TExecuteStatementResp { 'type' => TType::STRUCT, 'class' => '\TOperationHandle', ), + 3 => array( + 'var' => 'finalDirUri', + 'type' => TType::STRING, + ), + 4 => array( + 'var' => 'haConf', + 'type' => TType::MAP, + 'ktype' => TType::STRING, + 'vtype' => TType::STRING, + 'key' => array( + 'type' => TType::STRING, + ), + 'val' => array( + 'type' => TType::STRING, + ), + ), ); } if (is_array($vals)) { @@ -5669,6 +5718,12 @@ class TExecuteStatementResp { if (isset($vals['operationHandle'])) { $this->operationHandle = $vals['operationHandle']; } + if (isset($vals['finalDirUri'])) { + $this->finalDirUri = $vals['finalDirUri']; + } + if (isset($vals['haConf'])) { + $this->haConf = $vals['haConf']; + } } } @@ -5707,6 +5762,33 @@ class TExecuteStatementResp { $xfer += $input->skip($ftype); } break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->finalDirUri); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::MAP) { + $this->haConf = array(); + $_size152 = 0; + $_ktype153 = 0; + $_vtype154 = 0; + $xfer += $input->readMapBegin($_ktype153, $_vtype154, $_size152); + for ($_i156 = 0; $_i156 < $_size152; ++$_i156) + { + $key157 = ''; + $val158 = ''; + $xfer += $input->readString($key157); + $xfer += $input->readString($val158); + $this->haConf[$key157] = $val158; + } + $xfer += $input->readMapEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -5736,6 +5818,29 @@ class TExecuteStatementResp { $xfer += $this->operationHandle->write($output); $xfer += $output->writeFieldEnd(); } + if ($this->finalDirUri !== null) { + $xfer += $output->writeFieldBegin('finalDirUri', TType::STRING, 3); + $xfer += $output->writeString($this->finalDirUri); + $xfer += $output->writeFieldEnd(); + } + if ($this->haConf !== null) { + if (!is_array($this->haConf)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('haConf', TType::MAP, 4); + { + $output->writeMapBegin(TType::STRING, TType::STRING, count($this->haConf)); + { + foreach ($this->haConf as $kiter159 => $viter160) + { + $xfer += $output->writeString($kiter159); + $xfer += $output->writeString($viter160); + } + } + $output->writeMapEnd(); + } + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -6477,14 +6582,14 @@ class TGetTablesReq { case 5: if ($ftype == TType::LST) { $this->tableTypes = array(); - $_size152 = 0; - $_etype155 = 0; - $xfer += $input->readListBegin($_etype155, $_size152); - for ($_i156 = 0; $_i156 < $_size152; ++$_i156) + $_size161 = 0; + $_etype164 = 0; + $xfer += $input->readListBegin($_etype164, $_size161); + for ($_i165 = 0; $_i165 < $_size161; ++$_i165) { - $elem157 = null; - $xfer += $input->readString($elem157); - $this->tableTypes []= $elem157; + $elem166 = null; + $xfer += $input->readString($elem166); + $this->tableTypes []= $elem166; } $xfer += $input->readListEnd(); } else { @@ -6535,9 +6640,9 @@ class TGetTablesReq { { $output->writeListBegin(TType::STRING, count($this->tableTypes)); { - foreach ($this->tableTypes as $iter158) + foreach ($this->tableTypes as $iter167) { - $xfer += $output->writeString($iter158); + $xfer += $output->writeString($iter167); } } $output->writeListEnd(); diff --git service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py index fcd330f..b95ee85 100644 --- service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py +++ service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py @@ -25,6 +25,7 @@ class TProtocolVersion: HIVE_CLI_SERVICE_PROTOCOL_V6 = 5 HIVE_CLI_SERVICE_PROTOCOL_V7 = 6 HIVE_CLI_SERVICE_PROTOCOL_V8 = 7 + HIVE_CLI_SERVICE_PROTOCOL_V9 = 8 _VALUES_TO_NAMES = { 0: "HIVE_CLI_SERVICE_PROTOCOL_V1", @@ -35,6 +36,7 @@ class TProtocolVersion: 5: "HIVE_CLI_SERVICE_PROTOCOL_V6", 6: "HIVE_CLI_SERVICE_PROTOCOL_V7", 7: "HIVE_CLI_SERVICE_PROTOCOL_V8", + 8: "HIVE_CLI_SERVICE_PROTOCOL_V9", } _NAMES_TO_VALUES = { @@ -46,6 +48,7 @@ class TProtocolVersion: "HIVE_CLI_SERVICE_PROTOCOL_V6": 5, "HIVE_CLI_SERVICE_PROTOCOL_V7": 6, "HIVE_CLI_SERVICE_PROTOCOL_V8": 7, + "HIVE_CLI_SERVICE_PROTOCOL_V9": 8, } class TTypeId: @@ -1217,6 +1220,7 @@ class TColumnDesc: - typeDesc - position - comment + - typeName """ thrift_spec = ( @@ -1225,13 +1229,15 @@ class TColumnDesc: (2, TType.STRUCT, 'typeDesc', (TTypeDesc, TTypeDesc.thrift_spec), None, ), # 2 (3, TType.I32, 'position', None, None, ), # 3 (4, TType.STRING, 'comment', None, None, ), # 4 + (5, TType.STRING, 'typeName', None, None, ), # 5 ) - def __init__(self, columnName=None, typeDesc=None, position=None, comment=None,): + def __init__(self, columnName=None, typeDesc=None, position=None, comment=None, typeName=None,): self.columnName = columnName self.typeDesc = typeDesc self.position = position self.comment = comment + self.typeName = typeName def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -1263,6 +1269,11 @@ def read(self, iprot): self.comment = iprot.readString() else: iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.typeName = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -1289,6 +1300,10 @@ def write(self, oprot): oprot.writeFieldBegin('comment', TType.STRING, 4) oprot.writeString(self.comment) oprot.writeFieldEnd() + if self.typeName is not None: + oprot.writeFieldBegin('typeName', TType.STRING, 5) + oprot.writeString(self.typeName) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1308,6 +1323,7 @@ def __hash__(self): value = (value * 31) ^ hash(self.typeDesc) value = (value * 31) ^ hash(self.position) value = (value * 31) ^ hash(self.comment) + value = (value * 31) ^ hash(self.typeName) return value def __repr__(self): @@ -3500,7 +3516,7 @@ class TOpenSessionReq: thrift_spec = ( None, # 0 - (1, TType.I32, 'client_protocol', None, 7, ), # 1 + (1, TType.I32, 'client_protocol', None, 8, ), # 1 (2, TType.STRING, 'username', None, None, ), # 2 (3, TType.STRING, 'password', None, None, ), # 3 (4, TType.MAP, 'configuration', (TType.STRING,None,TType.STRING,None), None, ), # 4 @@ -3617,7 +3633,7 @@ class TOpenSessionResp: thrift_spec = ( None, # 0 (1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1 - (2, TType.I32, 'serverProtocolVersion', None, 7, ), # 2 + (2, TType.I32, 'serverProtocolVersion', None, 8, ), # 2 (3, TType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 3 (4, TType.MAP, 'configuration', (TType.STRING,None,TType.STRING,None), None, ), # 4 ) @@ -4295,17 +4311,23 @@ class TExecuteStatementResp: Attributes: - status - operationHandle + - finalDirUri + - haConf """ thrift_spec = ( None, # 0 (1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1 (2, TType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 2 + (3, TType.STRING, 'finalDirUri', None, None, ), # 3 + (4, TType.MAP, 'haConf', (TType.STRING,None,TType.STRING,None), None, ), # 4 ) - def __init__(self, status=None, operationHandle=None,): + def __init__(self, status=None, operationHandle=None, finalDirUri=None, haConf=None,): self.status = status self.operationHandle = operationHandle + self.finalDirUri = finalDirUri + self.haConf = haConf def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -4328,6 +4350,22 @@ def read(self, iprot): self.operationHandle.read(iprot) else: iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.finalDirUri = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.MAP: + self.haConf = {} + (_ktype153, _vtype154, _size152 ) = iprot.readMapBegin() + for _i156 in xrange(_size152): + _key157 = iprot.readString() + _val158 = iprot.readString() + self.haConf[_key157] = _val158 + iprot.readMapEnd() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -4346,6 +4384,18 @@ def write(self, oprot): oprot.writeFieldBegin('operationHandle', TType.STRUCT, 2) self.operationHandle.write(oprot) oprot.writeFieldEnd() + if self.finalDirUri is not None: + oprot.writeFieldBegin('finalDirUri', TType.STRING, 3) + oprot.writeString(self.finalDirUri) + oprot.writeFieldEnd() + if self.haConf is not None: + oprot.writeFieldBegin('haConf', TType.MAP, 4) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.haConf)) + for kiter159,viter160 in self.haConf.items(): + oprot.writeString(kiter159) + oprot.writeString(viter160) + oprot.writeMapEnd() + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -4359,6 +4409,8 @@ def __hash__(self): value = 17 value = (value * 31) ^ hash(self.status) value = (value * 31) ^ hash(self.operationHandle) + value = (value * 31) ^ hash(self.finalDirUri) + value = (value * 31) ^ hash(self.haConf) return value def __repr__(self): @@ -4907,10 +4959,10 @@ def read(self, iprot): elif fid == 5: if ftype == TType.LIST: self.tableTypes = [] - (_etype155, _size152) = iprot.readListBegin() - for _i156 in xrange(_size152): - _elem157 = iprot.readString() - self.tableTypes.append(_elem157) + (_etype164, _size161) = iprot.readListBegin() + for _i165 in xrange(_size161): + _elem166 = iprot.readString() + self.tableTypes.append(_elem166) iprot.readListEnd() else: iprot.skip(ftype) @@ -4943,8 +4995,8 @@ def write(self, oprot): if self.tableTypes is not None: oprot.writeFieldBegin('tableTypes', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.tableTypes)) - for iter158 in self.tableTypes: - oprot.writeString(iter158) + for iter167 in self.tableTypes: + oprot.writeString(iter167) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() diff --git service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb index 71148a0..9eee15d 100644 --- service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb +++ service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb @@ -15,8 +15,9 @@ module TProtocolVersion HIVE_CLI_SERVICE_PROTOCOL_V6 = 5 HIVE_CLI_SERVICE_PROTOCOL_V7 = 6 HIVE_CLI_SERVICE_PROTOCOL_V8 = 7 - VALUE_MAP = {0 => "HIVE_CLI_SERVICE_PROTOCOL_V1", 1 => "HIVE_CLI_SERVICE_PROTOCOL_V2", 2 => "HIVE_CLI_SERVICE_PROTOCOL_V3", 3 => "HIVE_CLI_SERVICE_PROTOCOL_V4", 4 => "HIVE_CLI_SERVICE_PROTOCOL_V5", 5 => "HIVE_CLI_SERVICE_PROTOCOL_V6", 6 => "HIVE_CLI_SERVICE_PROTOCOL_V7", 7 => "HIVE_CLI_SERVICE_PROTOCOL_V8"} - VALID_VALUES = Set.new([HIVE_CLI_SERVICE_PROTOCOL_V1, HIVE_CLI_SERVICE_PROTOCOL_V2, HIVE_CLI_SERVICE_PROTOCOL_V3, HIVE_CLI_SERVICE_PROTOCOL_V4, HIVE_CLI_SERVICE_PROTOCOL_V5, HIVE_CLI_SERVICE_PROTOCOL_V6, HIVE_CLI_SERVICE_PROTOCOL_V7, HIVE_CLI_SERVICE_PROTOCOL_V8]).freeze + HIVE_CLI_SERVICE_PROTOCOL_V9 = 8 + VALUE_MAP = {0 => "HIVE_CLI_SERVICE_PROTOCOL_V1", 1 => "HIVE_CLI_SERVICE_PROTOCOL_V2", 2 => "HIVE_CLI_SERVICE_PROTOCOL_V3", 3 => "HIVE_CLI_SERVICE_PROTOCOL_V4", 4 => "HIVE_CLI_SERVICE_PROTOCOL_V5", 5 => "HIVE_CLI_SERVICE_PROTOCOL_V6", 6 => "HIVE_CLI_SERVICE_PROTOCOL_V7", 7 => "HIVE_CLI_SERVICE_PROTOCOL_V8", 8 => "HIVE_CLI_SERVICE_PROTOCOL_V9"} + VALID_VALUES = Set.new([HIVE_CLI_SERVICE_PROTOCOL_V1, HIVE_CLI_SERVICE_PROTOCOL_V2, HIVE_CLI_SERVICE_PROTOCOL_V3, HIVE_CLI_SERVICE_PROTOCOL_V4, HIVE_CLI_SERVICE_PROTOCOL_V5, HIVE_CLI_SERVICE_PROTOCOL_V6, HIVE_CLI_SERVICE_PROTOCOL_V7, HIVE_CLI_SERVICE_PROTOCOL_V8, HIVE_CLI_SERVICE_PROTOCOL_V9]).freeze end module TTypeId @@ -379,12 +380,14 @@ class TColumnDesc TYPEDESC = 2 POSITION = 3 COMMENT = 4 + TYPENAME = 5 FIELDS = { COLUMNNAME => {:type => ::Thrift::Types::STRING, :name => 'columnName'}, TYPEDESC => {:type => ::Thrift::Types::STRUCT, :name => 'typeDesc', :class => ::TTypeDesc}, POSITION => {:type => ::Thrift::Types::I32, :name => 'position'}, - COMMENT => {:type => ::Thrift::Types::STRING, :name => 'comment', :optional => true} + COMMENT => {:type => ::Thrift::Types::STRING, :name => 'comment', :optional => true}, + TYPENAME => {:type => ::Thrift::Types::STRING, :name => 'typeName', :optional => true} } def struct_fields; FIELDS; end @@ -955,7 +958,7 @@ class TOpenSessionReq CONFIGURATION = 4 FIELDS = { - CLIENT_PROTOCOL => {:type => ::Thrift::Types::I32, :name => 'client_protocol', :default => 7, :enum_class => ::TProtocolVersion}, + CLIENT_PROTOCOL => {:type => ::Thrift::Types::I32, :name => 'client_protocol', :default => 8, :enum_class => ::TProtocolVersion}, USERNAME => {:type => ::Thrift::Types::STRING, :name => 'username', :optional => true}, PASSWORD => {:type => ::Thrift::Types::STRING, :name => 'password', :optional => true}, CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true} @@ -982,7 +985,7 @@ class TOpenSessionResp FIELDS = { STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - SERVERPROTOCOLVERSION => {:type => ::Thrift::Types::I32, :name => 'serverProtocolVersion', :default => 7, :enum_class => ::TProtocolVersion}, + SERVERPROTOCOLVERSION => {:type => ::Thrift::Types::I32, :name => 'serverProtocolVersion', :default => 8, :enum_class => ::TProtocolVersion}, SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle, :optional => true}, CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true} } @@ -1160,10 +1163,14 @@ class TExecuteStatementResp include ::Thrift::Struct, ::Thrift::Struct_Union STATUS = 1 OPERATIONHANDLE = 2 + FINALDIRURI = 3 + HACONF = 4 FIELDS = { STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true}, + FINALDIRURI => {:type => ::Thrift::Types::STRING, :name => 'finalDirUri', :optional => true}, + HACONF => {:type => ::Thrift::Types::MAP, :name => 'haConf', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true} } def struct_fields; FIELDS; end diff --git service/src/java/org/apache/hive/service/cli/CLIService.java service/src/java/org/apache/hive/service/cli/CLIService.java index ed52b4a..9276d7d 100644 --- service/src/java/org/apache/hive/service/cli/CLIService.java +++ service/src/java/org/apache/hive/service/cli/CLIService.java @@ -552,6 +552,13 @@ public void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory au LOG.info(sessionHandle + ": renewDelegationToken()"); } + public String getFinalDirUri(OperationHandle opHandle, Map haConf) + throws HiveSQLException { + String uri = sessionManager.getOperationManager().getOperation(opHandle) + .getParentSession().getFinalDirUri(opHandle, haConf); + return uri; + } + public SessionManager getSessionManager() { return sessionManager; } diff --git service/src/java/org/apache/hive/service/cli/ColumnDescriptor.java service/src/java/org/apache/hive/service/cli/ColumnDescriptor.java index bfd7135..1868233 100644 --- service/src/java/org/apache/hive/service/cli/ColumnDescriptor.java +++ service/src/java/org/apache/hive/service/cli/ColumnDescriptor.java @@ -43,7 +43,11 @@ public ColumnDescriptor(String name, String comment, TypeDescriptor type, int po public ColumnDescriptor(TColumnDesc tColumnDesc) { name = tColumnDesc.getColumnName(); comment = tColumnDesc.getComment(); - type = new TypeDescriptor(tColumnDesc.getTypeDesc()); + if (tColumnDesc.isSetTypeName()) { + type = new TypeDescriptor(tColumnDesc.getTypeName()); + } else { + type = new TypeDescriptor(tColumnDesc.getTypeDesc()); + } position = tColumnDesc.getPosition(); } @@ -75,6 +79,7 @@ public TColumnDesc toTColumnDesc() { tColumnDesc.setColumnName(name); tColumnDesc.setComment(comment); tColumnDesc.setTypeDesc(type.toTTypeDesc()); + tColumnDesc.setTypeName(getTypeName()); tColumnDesc.setPosition(position); return tColumnDesc; } diff --git service/src/java/org/apache/hive/service/cli/operation/Operation.java service/src/java/org/apache/hive/service/cli/operation/Operation.java index d48b92c..120ba26 100644 --- service/src/java/org/apache/hive/service/cli/operation/Operation.java +++ service/src/java/org/apache/hive/service/cli/operation/Operation.java @@ -351,6 +351,10 @@ protected synchronized void cleanupOperationLog() { public abstract RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException; + public String getFinalDirName(Map haConf) throws HiveSQLException { + return null; + } + public RowSet getNextRowSet() throws HiveSQLException { return getNextRowSet(FetchOrientation.FETCH_NEXT, DEFAULT_FETCH_MAX_ROWS); } diff --git service/src/java/org/apache/hive/service/cli/operation/OperationManager.java service/src/java/org/apache/hive/service/cli/operation/OperationManager.java index 2f18231..aa90948 100644 --- service/src/java/org/apache/hive/service/cli/operation/OperationManager.java +++ service/src/java/org/apache/hive/service/cli/operation/OperationManager.java @@ -357,6 +357,11 @@ public OperationLog getOperationLogByThread() { return OperationLog.getCurrentOperationLog(); } + public String getOperationFinalDirUri(OperationHandle opHandle, Map haConf) + throws HiveSQLException { + return getOperation(opHandle).getFinalDirName(haConf); + } + public List removeExpiredOperations(OperationHandle[] handles) { List removed = new ArrayList(); for (OperationHandle handle : handles) { diff --git service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java index 3bf40eb..79ffe7a 100644 --- service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java +++ service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java @@ -23,6 +23,7 @@ import java.io.PrintStream; import java.io.Serializable; import java.io.UnsupportedEncodingException; +import java.net.URISyntaxException; import java.security.PrivilegedExceptionAction; import java.sql.SQLException; import java.util.ArrayList; @@ -82,6 +83,8 @@ import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; +import static org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V9; + /** * SQLOperation. * @@ -473,6 +476,20 @@ public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) } @Override + public String getFinalDirName(Map haConf) throws HiveSQLException { + try { + if (getProtocolVersion().getValue() >= HIVE_CLI_SERVICE_PROTOCOL_V9.getValue()) { + return driver.getFinalDirName(haConf); + } else { + LOG.info("Unable to use bypass: the version of the jdbc client is old."); + return null; + } + } catch (URISyntaxException e) { + throw new HiveSQLException(e); + } + } + + @Override public String getTaskStatus() throws HiveSQLException { if (driver != null) { List statuses = driver.getQueryDisplay().getTaskDisplays(); diff --git service/src/java/org/apache/hive/service/cli/session/HiveSession.java service/src/java/org/apache/hive/service/cli/session/HiveSession.java index 78ff388..20cf6a3 100644 --- service/src/java/org/apache/hive/service/cli/session/HiveSession.java +++ service/src/java/org/apache/hive/service/cli/session/HiveSession.java @@ -211,4 +211,7 @@ void renewDelegationToken(HiveAuthFactory authFactory, String tokenStr) void closeExpiredOperations(); long getNoOperationTime(); + + String getFinalDirUri(OperationHandle opHandle, Map haConf) + throws HiveSQLException; } diff --git service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java index 7341635..c6fc6af 100644 --- service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java +++ service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java @@ -842,6 +842,12 @@ public void renewDelegationToken(HiveAuthFactory authFactory, String tokenStr) authFactory.renewDelegationToken(tokenStr); } + @Override + public String getFinalDirUri(OperationHandle opHandle, Map haConf) + throws HiveSQLException { + return operationManager.getOperationFinalDirUri(opHandle, haConf); + } + // extract the real user from the given token string private String getUserFromToken(HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException { return authFactory.getUserFromToken(tokenStr); diff --git service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java index 8bc3d94..7083ab2 100644 --- service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java +++ service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java @@ -500,6 +500,15 @@ public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws T queryTimeout); resp.setOperationHandle(operationHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); + String finalDirUri = null; + Map haConf = new HashMap<>(); + finalDirUri = cliService.getFinalDirUri(operationHandle, haConf); + if (finalDirUri != null) { + resp.setFinalDirUri(finalDirUri); + } + if (!haConf.isEmpty()) { + resp.setHaConf(haConf); + } } catch (Exception e) { // Note: it's rather important that this (and other methods) catch Exception, not Throwable; // in combination with HiveSessionProxy.invoke code, perhaps unintentionally, it used