You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2016/11/15 20:20:42 UTC
[10/50] [abbrv] hive git commit: HIVE-15062 : create backward compat
checking for metastore APIs (Sergey Shelukhin,
reviewed by Thejas M Nair and Sushanth Sowmyan)
http://git-wip-us.apache.org/repos/asf/hive/blob/fb5bf0cb/metastore/src/gen/thrift/gen-php/metastore/Types.php
----------------------------------------------------------------------
diff --git a/metastore/src/gen/thrift/gen-php/metastore/Types.php b/metastore/src/gen/thrift/gen-php/metastore/Types.php
index 61171c2..ecb6254 100644
--- a/metastore/src/gen/thrift/gen-php/metastore/Types.php
+++ b/metastore/src/gen/thrift/gen-php/metastore/Types.php
@@ -167,6 +167,13 @@ final class FileMetadataExprType {
);
}
+final class ClientCapability {
+ const TEST_CAPABILITY = 1;
+ static public $__names = array(
+ 1 => 'TEST_CAPABILITY',
+ );
+}
+
class Version {
static $_TSPEC;
@@ -17566,6 +17573,568 @@ class GetAllFunctionsResponse {
}
+class ClientCapabilities {
+ static $_TSPEC;
+
+ /**
+ * @var int[]
+ */
+ public $values = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'values',
+ 'type' => TType::LST,
+ 'etype' => TType::I32,
+ 'elem' => array(
+ 'type' => TType::I32,
+ ),
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['values'])) {
+ $this->values = $vals['values'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'ClientCapabilities';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::LST) {
+ $this->values = array();
+ $_size569 = 0;
+ $_etype572 = 0;
+ $xfer += $input->readListBegin($_etype572, $_size569);
+ for ($_i573 = 0; $_i573 < $_size569; ++$_i573)
+ {
+ $elem574 = null;
+ $xfer += $input->readI32($elem574);
+ $this->values []= $elem574;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('ClientCapabilities');
+ if ($this->values !== null) {
+ if (!is_array($this->values)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('values', TType::LST, 1);
+ {
+ $output->writeListBegin(TType::I32, count($this->values));
+ {
+ foreach ($this->values as $iter575)
+ {
+ $xfer += $output->writeI32($iter575);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class GetTableRequest {
+ static $_TSPEC;
+
+ /**
+ * @var string
+ */
+ public $dbName = null;
+ /**
+ * @var string
+ */
+ public $tblName = null;
+ /**
+ * @var \metastore\ClientCapabilities
+ */
+ public $capabilities = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'dbName',
+ 'type' => TType::STRING,
+ ),
+ 2 => array(
+ 'var' => 'tblName',
+ 'type' => TType::STRING,
+ ),
+ 3 => array(
+ 'var' => 'capabilities',
+ 'type' => TType::STRUCT,
+ 'class' => '\metastore\ClientCapabilities',
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['dbName'])) {
+ $this->dbName = $vals['dbName'];
+ }
+ if (isset($vals['tblName'])) {
+ $this->tblName = $vals['tblName'];
+ }
+ if (isset($vals['capabilities'])) {
+ $this->capabilities = $vals['capabilities'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'GetTableRequest';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->dbName);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->tblName);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::STRUCT) {
+ $this->capabilities = new \metastore\ClientCapabilities();
+ $xfer += $this->capabilities->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('GetTableRequest');
+ if ($this->dbName !== null) {
+ $xfer += $output->writeFieldBegin('dbName', TType::STRING, 1);
+ $xfer += $output->writeString($this->dbName);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->tblName !== null) {
+ $xfer += $output->writeFieldBegin('tblName', TType::STRING, 2);
+ $xfer += $output->writeString($this->tblName);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->capabilities !== null) {
+ if (!is_object($this->capabilities)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('capabilities', TType::STRUCT, 3);
+ $xfer += $this->capabilities->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class GetTableResult {
+ static $_TSPEC;
+
+ /**
+ * @var \metastore\Table
+ */
+ public $table = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'table',
+ 'type' => TType::STRUCT,
+ 'class' => '\metastore\Table',
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['table'])) {
+ $this->table = $vals['table'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'GetTableResult';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::STRUCT) {
+ $this->table = new \metastore\Table();
+ $xfer += $this->table->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('GetTableResult');
+ if ($this->table !== null) {
+ if (!is_object($this->table)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('table', TType::STRUCT, 1);
+ $xfer += $this->table->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class GetTablesRequest {
+ static $_TSPEC;
+
+ /**
+ * @var string
+ */
+ public $dbName = null;
+ /**
+ * @var string[]
+ */
+ public $tblNames = null;
+ /**
+ * @var \metastore\ClientCapabilities
+ */
+ public $capabilities = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'dbName',
+ 'type' => TType::STRING,
+ ),
+ 2 => array(
+ 'var' => 'tblNames',
+ 'type' => TType::LST,
+ 'etype' => TType::STRING,
+ 'elem' => array(
+ 'type' => TType::STRING,
+ ),
+ ),
+ 3 => array(
+ 'var' => 'capabilities',
+ 'type' => TType::STRUCT,
+ 'class' => '\metastore\ClientCapabilities',
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['dbName'])) {
+ $this->dbName = $vals['dbName'];
+ }
+ if (isset($vals['tblNames'])) {
+ $this->tblNames = $vals['tblNames'];
+ }
+ if (isset($vals['capabilities'])) {
+ $this->capabilities = $vals['capabilities'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'GetTablesRequest';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->dbName);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::LST) {
+ $this->tblNames = array();
+ $_size576 = 0;
+ $_etype579 = 0;
+ $xfer += $input->readListBegin($_etype579, $_size576);
+ for ($_i580 = 0; $_i580 < $_size576; ++$_i580)
+ {
+ $elem581 = null;
+ $xfer += $input->readString($elem581);
+ $this->tblNames []= $elem581;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::STRUCT) {
+ $this->capabilities = new \metastore\ClientCapabilities();
+ $xfer += $this->capabilities->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('GetTablesRequest');
+ if ($this->dbName !== null) {
+ $xfer += $output->writeFieldBegin('dbName', TType::STRING, 1);
+ $xfer += $output->writeString($this->dbName);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->tblNames !== null) {
+ if (!is_array($this->tblNames)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('tblNames', TType::LST, 2);
+ {
+ $output->writeListBegin(TType::STRING, count($this->tblNames));
+ {
+ foreach ($this->tblNames as $iter582)
+ {
+ $xfer += $output->writeString($iter582);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->capabilities !== null) {
+ if (!is_object($this->capabilities)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('capabilities', TType::STRUCT, 3);
+ $xfer += $this->capabilities->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class GetTablesResult {
+ static $_TSPEC;
+
+ /**
+ * @var \metastore\Table[]
+ */
+ public $tables = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'tables',
+ 'type' => TType::LST,
+ 'etype' => TType::STRUCT,
+ 'elem' => array(
+ 'type' => TType::STRUCT,
+ 'class' => '\metastore\Table',
+ ),
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['tables'])) {
+ $this->tables = $vals['tables'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'GetTablesResult';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::LST) {
+ $this->tables = array();
+ $_size583 = 0;
+ $_etype586 = 0;
+ $xfer += $input->readListBegin($_etype586, $_size583);
+ for ($_i587 = 0; $_i587 < $_size583; ++$_i587)
+ {
+ $elem588 = null;
+ $elem588 = new \metastore\Table();
+ $xfer += $elem588->read($input);
+ $this->tables []= $elem588;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('GetTablesResult');
+ if ($this->tables !== null) {
+ if (!is_array($this->tables)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('tables', TType::LST, 1);
+ {
+ $output->writeListBegin(TType::STRUCT, count($this->tables));
+ {
+ foreach ($this->tables as $iter589)
+ {
+ $xfer += $iter589->write($output);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
class TableMeta {
static $_TSPEC;
http://git-wip-us.apache.org/repos/asf/hive/blob/fb5bf0cb/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote
----------------------------------------------------------------------
diff --git a/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote b/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote
index 8f505f1..81bebd8 100755
--- a/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote
+++ b/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote
@@ -54,6 +54,8 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
print(' get_all_tables(string db_name)')
print(' Table get_table(string dbname, string tbl_name)')
print(' get_table_objects_by_name(string dbname, tbl_names)')
+ print(' GetTableResult get_table_req(GetTableRequest req)')
+ print(' GetTablesResult get_table_objects_by_name_req(GetTablesRequest req)')
print(' get_table_names_by_filter(string dbname, string filter, i16 max_tables)')
print(' void alter_table(string dbname, string tbl_name, Table new_tbl)')
print(' void alter_table_with_environment_context(string dbname, string tbl_name, Table new_tbl, EnvironmentContext environment_context)')
@@ -423,6 +425,18 @@ elif cmd == 'get_table_objects_by_name':
sys.exit(1)
pp.pprint(client.get_table_objects_by_name(args[0],eval(args[1]),))
+elif cmd == 'get_table_req':
+ if len(args) != 1:
+ print('get_table_req requires 1 args')
+ sys.exit(1)
+ pp.pprint(client.get_table_req(eval(args[0]),))
+
+elif cmd == 'get_table_objects_by_name_req':
+ if len(args) != 1:
+ print('get_table_objects_by_name_req requires 1 args')
+ sys.exit(1)
+ pp.pprint(client.get_table_objects_by_name_req(eval(args[0]),))
+
elif cmd == 'get_table_names_by_filter':
if len(args) != 3:
print('get_table_names_by_filter requires 3 args')