Эх сурвалжийг харах

HUE-1799 [beeswax] GetOperationStatus() now returns operational states

Also fix quick start wizard page
Romain Rigaux 12 жил өмнө
parent
commit
2d53ca4fcf

+ 12 - 10
apps/about/src/about/templates/admin_wizard.mako

@@ -13,11 +13,13 @@
 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
+
 <%!
 from desktop.views import commonheader, commonfooter
 from django.utils.encoding import smart_unicode
 from django.utils.translation import ugettext as _
 %>
+
 <%namespace name="header" file="header.mako" />
 
 ${ commonheader(_('Quick Start'), "quickstart", user) | n,unicode }
@@ -153,8 +155,8 @@ ${ header.menubar() }
                     <label class="checkbox">
                       <input class="updatePreferences" type="checkbox" name="tours_and_tutorials"
                              style="margin-right: 10px"
-                             title="${ ('Check to enable the tours and tutorials') }" ${ tours_and_tutorials and "checked" }/>
-                    ${ ('Display the "Available Tours" question mark when tours are available for a specific page.') }
+                             title="${ _('Check to enable the tours and tutorials') }" ${ tours_and_tutorials and 'checked' or '' }/>
+                      ${ _('Display the "Available Tours" question mark when tours are available for a specific page.') }
                     </label>
                   </p>
                 </div>
@@ -165,11 +167,11 @@ ${ header.menubar() }
 
             <div class="card-body">
               <label class="checkbox">
-                <input class="updatePreferences" type="checkbox" name="collect_usage" style="margin-right: 10px" title="${ ('Check to enable usage analytics') }" ${ collect_usage and "checked" }/>
-                ${ ('Help improve Hue with anonymous usage analytics.') }
+                <input class="updatePreferences" type="checkbox" name="collect_usage" style="margin-right: 10px" title="${ _('Check to enable usage analytics') }" ${ collect_usage and 'checked' or '' }/>
+                ${ _('Help improve Hue with anonymous usage analytics.') }
                 <a href="javascript:void(0)" style="display: inline" data-trigger="hover" data-toggle="popover" data-placement="right" rel="popover"
-                   title="${_('How does it work?') }"
-                   data-content="${ ('We are using Google Analytics to see how many times an application or specific section of an application is used, nothing more.') }">
+                   title="${ _('How does it work?') }"
+                   data-content="${ _('We are using Google Analytics to see how many times an application or specific section of an application is used, nothing more.') }">
                    <i class="fa fa-question-circle"></i>
                 </a>
               </label>
@@ -184,7 +186,7 @@ ${ header.menubar() }
 
                 <div class="card-body">
                   <p>
-                    <a href="${ url('desktop.views.home') }" class="step"><i class="fa fa-home"></i> ${_('Hue Home') }
+                    <a href="${ url('desktop.views.home') }" class="step"><i class="fa fa-home"></i> ${ _('Hue Home') }
                     </a>
                   </p>
                 </div>
@@ -198,8 +200,8 @@ ${ header.menubar() }
                     <label class="checkbox">
                       <input id="updateSkipWizard" type="checkbox"
                              style="margin-right: 10px"
-                             title="${ ('Check to skip this wizard next time.') }"/>
-                    ${ ('Skip the Quick Start Wizard at next login and land directly on the home page.') }
+                             title="${ _('Check to skip this wizard next time.') }"/>
+                      ${ _('Skip the Quick Start Wizard at next login and land directly on the home page.') }
                     </label>
                   </p>
                 </div>
@@ -215,7 +217,7 @@ ${ header.menubar() }
       <div class="form-actions">
         <a id="backBtn" class="btn disabled">${ _('Back') }</a>
         <a id="nextBtn" class="btn btn-primary disable-feedback">${ _('Next') }</a>
-        <div class="pull-right muted">Hue and the Hue logo are trademarks of Cloudera, Inc.</div>
+        <div class="pull-right muted">${ _('Hue and the Hue logo are trademarks of Cloudera, Inc.') }</div>
       </div>
       % else:
         <p>

+ 21 - 0
apps/beeswax/gen-py/TCLIService/TCLIService-remote

@@ -39,6 +39,9 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
   print '  TCloseOperationResp CloseOperation(TCloseOperationReq req)'
   print '  TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req)'
   print '  TFetchResultsResp FetchResults(TFetchResultsReq req)'
+  print '  TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req)'
+  print '  TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req)'
+  print '  TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req)'
   print '  TGetLogResp GetLog(TGetLogReq req)'
   print ''
   sys.exit(0)
@@ -187,6 +190,24 @@ elif cmd == 'FetchResults':
     sys.exit(1)
   pp.pprint(client.FetchResults(eval(args[0]),))
 
+elif cmd == 'GetDelegationToken':
+  if len(args) != 1:
+    print 'GetDelegationToken requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.GetDelegationToken(eval(args[0]),))
+
+elif cmd == 'CancelDelegationToken':
+  if len(args) != 1:
+    print 'CancelDelegationToken requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.CancelDelegationToken(eval(args[0]),))
+
+elif cmd == 'RenewDelegationToken':
+  if len(args) != 1:
+    print 'RenewDelegationToken requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.RenewDelegationToken(eval(args[0]),))
+
 elif cmd == 'GetLog':
   if len(args) != 1:
     print 'GetLog requires 1 args'

+ 510 - 0
apps/beeswax/gen-py/TCLIService/TCLIService.py

@@ -130,6 +130,27 @@ class Iface(object):
     """
     pass
 
+  def GetDelegationToken(self, req):
+    """
+    Parameters:
+     - req
+    """
+    pass
+
+  def CancelDelegationToken(self, req):
+    """
+    Parameters:
+     - req
+    """
+    pass
+
+  def RenewDelegationToken(self, req):
+    """
+    Parameters:
+     - req
+    """
+    pass
+
   def GetLog(self, req):
     """
     Parameters:
@@ -625,6 +646,96 @@ class Client(Iface):
       return result.success
     raise TApplicationException(TApplicationException.MISSING_RESULT, "FetchResults failed: unknown result");
 
+  def GetDelegationToken(self, req):
+    """
+    Parameters:
+     - req
+    """
+    self.send_GetDelegationToken(req)
+    return self.recv_GetDelegationToken()
+
+  def send_GetDelegationToken(self, req):
+    self._oprot.writeMessageBegin('GetDelegationToken', TMessageType.CALL, self._seqid)
+    args = GetDelegationToken_args()
+    args.req = req
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_GetDelegationToken(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = GetDelegationToken_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "GetDelegationToken failed: unknown result");
+
+  def CancelDelegationToken(self, req):
+    """
+    Parameters:
+     - req
+    """
+    self.send_CancelDelegationToken(req)
+    return self.recv_CancelDelegationToken()
+
+  def send_CancelDelegationToken(self, req):
+    self._oprot.writeMessageBegin('CancelDelegationToken', TMessageType.CALL, self._seqid)
+    args = CancelDelegationToken_args()
+    args.req = req
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_CancelDelegationToken(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = CancelDelegationToken_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "CancelDelegationToken failed: unknown result");
+
+  def RenewDelegationToken(self, req):
+    """
+    Parameters:
+     - req
+    """
+    self.send_RenewDelegationToken(req)
+    return self.recv_RenewDelegationToken()
+
+  def send_RenewDelegationToken(self, req):
+    self._oprot.writeMessageBegin('RenewDelegationToken', TMessageType.CALL, self._seqid)
+    args = RenewDelegationToken_args()
+    args.req = req
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_RenewDelegationToken(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = RenewDelegationToken_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "RenewDelegationToken failed: unknown result");
+
   def GetLog(self, req):
     """
     Parameters:
@@ -676,6 +787,9 @@ class Processor(Iface, TProcessor):
     self._processMap["CloseOperation"] = Processor.process_CloseOperation
     self._processMap["GetResultSetMetadata"] = Processor.process_GetResultSetMetadata
     self._processMap["FetchResults"] = Processor.process_FetchResults
+    self._processMap["GetDelegationToken"] = Processor.process_GetDelegationToken
+    self._processMap["CancelDelegationToken"] = Processor.process_CancelDelegationToken
+    self._processMap["RenewDelegationToken"] = Processor.process_RenewDelegationToken
     self._processMap["GetLog"] = Processor.process_GetLog
 
   def process(self, iprot, oprot):
@@ -869,6 +983,39 @@ class Processor(Iface, TProcessor):
     oprot.writeMessageEnd()
     oprot.trans.flush()
 
+  def process_GetDelegationToken(self, seqid, iprot, oprot):
+    args = GetDelegationToken_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = GetDelegationToken_result()
+    result.success = self._handler.GetDelegationToken(args.req)
+    oprot.writeMessageBegin("GetDelegationToken", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_CancelDelegationToken(self, seqid, iprot, oprot):
+    args = CancelDelegationToken_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = CancelDelegationToken_result()
+    result.success = self._handler.CancelDelegationToken(args.req)
+    oprot.writeMessageBegin("CancelDelegationToken", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_RenewDelegationToken(self, seqid, iprot, oprot):
+    args = RenewDelegationToken_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = RenewDelegationToken_result()
+    result.success = self._handler.RenewDelegationToken(args.req)
+    oprot.writeMessageBegin("RenewDelegationToken", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
   def process_GetLog(self, seqid, iprot, oprot):
     args = GetLog_args()
     args.read(iprot)
@@ -2819,6 +2966,369 @@ class FetchResults_result(object):
   def __ne__(self, other):
     return not (self == other)
 
+class GetDelegationToken_args(object):
+  """
+  Attributes:
+   - req
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'req', (TGetDelegationTokenReq, TGetDelegationTokenReq.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, req=None,):
+    self.req = req
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.req = TGetDelegationTokenReq()
+          self.req.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('GetDelegationToken_args')
+    if self.req is not None:
+      oprot.writeFieldBegin('req', TType.STRUCT, 1)
+      self.req.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class GetDelegationToken_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (TGetDelegationTokenResp, TGetDelegationTokenResp.thrift_spec), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.STRUCT:
+          self.success = TGetDelegationTokenResp()
+          self.success.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('GetDelegationToken_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class CancelDelegationToken_args(object):
+  """
+  Attributes:
+   - req
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'req', (TCancelDelegationTokenReq, TCancelDelegationTokenReq.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, req=None,):
+    self.req = req
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.req = TCancelDelegationTokenReq()
+          self.req.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('CancelDelegationToken_args')
+    if self.req is not None:
+      oprot.writeFieldBegin('req', TType.STRUCT, 1)
+      self.req.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class CancelDelegationToken_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (TCancelDelegationTokenResp, TCancelDelegationTokenResp.thrift_spec), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.STRUCT:
+          self.success = TCancelDelegationTokenResp()
+          self.success.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('CancelDelegationToken_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class RenewDelegationToken_args(object):
+  """
+  Attributes:
+   - req
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'req', (TRenewDelegationTokenReq, TRenewDelegationTokenReq.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, req=None,):
+    self.req = req
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.req = TRenewDelegationTokenReq()
+          self.req.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('RenewDelegationToken_args')
+    if self.req is not None:
+      oprot.writeFieldBegin('req', TType.STRUCT, 1)
+      self.req.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class RenewDelegationToken_result(object):
+  """
+  Attributes:
+   - success
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (TRenewDelegationTokenResp, TRenewDelegationTokenResp.thrift_spec), None, ), # 0
+  )
+
+  def __init__(self, success=None,):
+    self.success = success
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.STRUCT:
+          self.success = TRenewDelegationTokenResp()
+          self.success.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('RenewDelegationToken_result')
+    if self.success is not None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
 class GetLog_args(object):
   """
   Attributes:

+ 7 - 0
apps/beeswax/gen-py/TCLIService/constants.py

@@ -23,6 +23,8 @@ PRIMITIVE_TYPES = set([
     15,
     16,
     17,
+    18,
+    19,
 ])
 COMPLEX_TYPES = set([
     10,
@@ -53,4 +55,9 @@ TYPE_NAMES = {
     15 : "DECIMAL",
     16 : "NULL",
     17 : "DATE",
+    18 : "VARCHAR",
+    19 : "CHAR",
 }
+CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength"
+PRECISION = "precision"
+SCALE = "scale"

+ 800 - 141
apps/beeswax/gen-py/TCLIService/ttypes.py

@@ -19,15 +19,24 @@ except:
 class TProtocolVersion(object):
   HIVE_CLI_SERVICE_PROTOCOL_V1 = 0
   HIVE_CLI_SERVICE_PROTOCOL_V2 = 1
+  HIVE_CLI_SERVICE_PROTOCOL_V3 = 2
+  HIVE_CLI_SERVICE_PROTOCOL_V4 = 3
+  HIVE_CLI_SERVICE_PROTOCOL_V5 = 4
 
   _VALUES_TO_NAMES = {
     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",
   }
 
   _NAMES_TO_VALUES = {
     "HIVE_CLI_SERVICE_PROTOCOL_V1": 0,
     "HIVE_CLI_SERVICE_PROTOCOL_V2": 1,
+    "HIVE_CLI_SERVICE_PROTOCOL_V3": 2,
+    "HIVE_CLI_SERVICE_PROTOCOL_V4": 3,
+    "HIVE_CLI_SERVICE_PROTOCOL_V5": 4,
   }
 
 class TTypeId(object):
@@ -49,6 +58,8 @@ class TTypeId(object):
   DECIMAL_TYPE = 15
   NULL_TYPE = 16
   DATE_TYPE = 17
+  VARCHAR_TYPE = 18
+  CHAR_TYPE = 19
 
   _VALUES_TO_NAMES = {
     0: "BOOLEAN_TYPE",
@@ -69,6 +80,8 @@ class TTypeId(object):
     15: "DECIMAL_TYPE",
     16: "NULL_TYPE",
     17: "DATE_TYPE",
+    18: "VARCHAR_TYPE",
+    19: "CHAR_TYPE",
   }
 
   _NAMES_TO_VALUES = {
@@ -90,6 +103,8 @@ class TTypeId(object):
     "DECIMAL_TYPE": 15,
     "NULL_TYPE": 16,
     "DATE_TYPE": 17,
+    "VARCHAR_TYPE": 18,
+    "CHAR_TYPE": 19,
   }
 
 class TStatusCode(object):
@@ -358,19 +373,167 @@ class TFetchOrientation(object):
   }
 
 
+class TTypeQualifierValue(object):
+  """
+  Attributes:
+   - i32Value
+   - stringValue
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'i32Value', None, None, ), # 1
+    (2, TType.STRING, 'stringValue', None, None, ), # 2
+  )
+
+  def __init__(self, i32Value=None, stringValue=None,):
+    self.i32Value = i32Value
+    self.stringValue = stringValue
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.I32:
+          self.i32Value = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.stringValue = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('TTypeQualifierValue')
+    if self.i32Value is not None:
+      oprot.writeFieldBegin('i32Value', TType.I32, 1)
+      oprot.writeI32(self.i32Value)
+      oprot.writeFieldEnd()
+    if self.stringValue is not None:
+      oprot.writeFieldBegin('stringValue', TType.STRING, 2)
+      oprot.writeString(self.stringValue)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class TTypeQualifiers(object):
+  """
+  Attributes:
+   - qualifiers
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.MAP, 'qualifiers', (TType.STRING,None,TType.STRUCT,(TTypeQualifierValue, TTypeQualifierValue.thrift_spec)), None, ), # 1
+  )
+
+  def __init__(self, qualifiers=None,):
+    self.qualifiers = qualifiers
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.MAP:
+          self.qualifiers = {}
+          (_ktype1, _vtype2, _size0 ) = iprot.readMapBegin() 
+          for _i4 in xrange(_size0):
+            _key5 = iprot.readString();
+            _val6 = TTypeQualifierValue()
+            _val6.read(iprot)
+            self.qualifiers[_key5] = _val6
+          iprot.readMapEnd()
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('TTypeQualifiers')
+    if self.qualifiers is not None:
+      oprot.writeFieldBegin('qualifiers', TType.MAP, 1)
+      oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.qualifiers))
+      for kiter7,viter8 in self.qualifiers.items():
+        oprot.writeString(kiter7)
+        viter8.write(oprot)
+      oprot.writeMapEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.qualifiers is None:
+      raise TProtocol.TProtocolException(message='Required field qualifiers is unset!')
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
 class TPrimitiveTypeEntry(object):
   """
   Attributes:
    - type
+   - typeQualifiers
   """
 
   thrift_spec = (
     None, # 0
     (1, TType.I32, 'type', None, None, ), # 1
+    (2, TType.STRUCT, 'typeQualifiers', (TTypeQualifiers, TTypeQualifiers.thrift_spec), None, ), # 2
   )
 
-  def __init__(self, type=None,):
+  def __init__(self, type=None, typeQualifiers=None,):
     self.type = type
+    self.typeQualifiers = typeQualifiers
 
   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:
@@ -386,6 +549,12 @@ class TPrimitiveTypeEntry(object):
           self.type = iprot.readI32();
         else:
           iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.typeQualifiers = TTypeQualifiers()
+          self.typeQualifiers.read(iprot)
+        else:
+          iprot.skip(ftype)
       else:
         iprot.skip(ftype)
       iprot.readFieldEnd()
@@ -400,6 +569,10 @@ class TPrimitiveTypeEntry(object):
       oprot.writeFieldBegin('type', TType.I32, 1)
       oprot.writeI32(self.type)
       oprot.writeFieldEnd()
+    if self.typeQualifiers is not None:
+      oprot.writeFieldBegin('typeQualifiers', TType.STRUCT, 2)
+      self.typeQualifiers.write(oprot)
+      oprot.writeFieldEnd()
     oprot.writeFieldStop()
     oprot.writeStructEnd()
 
@@ -584,11 +757,11 @@ class TStructTypeEntry(object):
       if fid == 1:
         if ftype == TType.MAP:
           self.nameToTypePtr = {}
-          (_ktype1, _vtype2, _size0 ) = iprot.readMapBegin() 
-          for _i4 in xrange(_size0):
-            _key5 = iprot.readString();
-            _val6 = iprot.readI32();
-            self.nameToTypePtr[_key5] = _val6
+          (_ktype10, _vtype11, _size9 ) = iprot.readMapBegin() 
+          for _i13 in xrange(_size9):
+            _key14 = iprot.readString();
+            _val15 = iprot.readI32();
+            self.nameToTypePtr[_key14] = _val15
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -605,9 +778,9 @@ class TStructTypeEntry(object):
     if self.nameToTypePtr is not None:
       oprot.writeFieldBegin('nameToTypePtr', TType.MAP, 1)
       oprot.writeMapBegin(TType.STRING, TType.I32, len(self.nameToTypePtr))
-      for kiter7,viter8 in self.nameToTypePtr.items():
-        oprot.writeString(kiter7)
-        oprot.writeI32(viter8)
+      for kiter16,viter17 in self.nameToTypePtr.items():
+        oprot.writeString(kiter16)
+        oprot.writeI32(viter17)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -656,11 +829,11 @@ class TUnionTypeEntry(object):
       if fid == 1:
         if ftype == TType.MAP:
           self.nameToTypePtr = {}
-          (_ktype10, _vtype11, _size9 ) = iprot.readMapBegin() 
-          for _i13 in xrange(_size9):
-            _key14 = iprot.readString();
-            _val15 = iprot.readI32();
-            self.nameToTypePtr[_key14] = _val15
+          (_ktype19, _vtype20, _size18 ) = iprot.readMapBegin() 
+          for _i22 in xrange(_size18):
+            _key23 = iprot.readString();
+            _val24 = iprot.readI32();
+            self.nameToTypePtr[_key23] = _val24
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -677,9 +850,9 @@ class TUnionTypeEntry(object):
     if self.nameToTypePtr is not None:
       oprot.writeFieldBegin('nameToTypePtr', TType.MAP, 1)
       oprot.writeMapBegin(TType.STRING, TType.I32, len(self.nameToTypePtr))
-      for kiter16,viter17 in self.nameToTypePtr.items():
-        oprot.writeString(kiter16)
-        oprot.writeI32(viter17)
+      for kiter25,viter26 in self.nameToTypePtr.items():
+        oprot.writeString(kiter25)
+        oprot.writeI32(viter26)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -916,11 +1089,11 @@ class TTypeDesc(object):
       if fid == 1:
         if ftype == TType.LIST:
           self.types = []
-          (_etype21, _size18) = iprot.readListBegin()
-          for _i22 in xrange(_size18):
-            _elem23 = TTypeEntry()
-            _elem23.read(iprot)
-            self.types.append(_elem23)
+          (_etype30, _size27) = iprot.readListBegin()
+          for _i31 in xrange(_size27):
+            _elem32 = TTypeEntry()
+            _elem32.read(iprot)
+            self.types.append(_elem32)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -937,8 +1110,8 @@ class TTypeDesc(object):
     if self.types is not None:
       oprot.writeFieldBegin('types', TType.LIST, 1)
       oprot.writeListBegin(TType.STRUCT, len(self.types))
-      for iter24 in self.types:
-        iter24.write(oprot)
+      for iter33 in self.types:
+        iter33.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -1090,11 +1263,11 @@ class TTableSchema(object):
       if fid == 1:
         if ftype == TType.LIST:
           self.columns = []
-          (_etype28, _size25) = iprot.readListBegin()
-          for _i29 in xrange(_size25):
-            _elem30 = TColumnDesc()
-            _elem30.read(iprot)
-            self.columns.append(_elem30)
+          (_etype37, _size34) = iprot.readListBegin()
+          for _i38 in xrange(_size34):
+            _elem39 = TColumnDesc()
+            _elem39.read(iprot)
+            self.columns.append(_elem39)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -1111,8 +1284,8 @@ class TTableSchema(object):
     if self.columns is not None:
       oprot.writeFieldBegin('columns', TType.LIST, 1)
       oprot.writeListBegin(TType.STRUCT, len(self.columns))
-      for iter31 in self.columns:
-        iter31.write(oprot)
+      for iter40 in self.columns:
+        iter40.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -1599,77 +1772,77 @@ class TColumn(object):
       if fid == 1:
         if ftype == TType.LIST:
           self.boolColumn = []
-          (_etype35, _size32) = iprot.readListBegin()
-          for _i36 in xrange(_size32):
-            _elem37 = TBoolValue()
-            _elem37.read(iprot)
-            self.boolColumn.append(_elem37)
+          (_etype44, _size41) = iprot.readListBegin()
+          for _i45 in xrange(_size41):
+            _elem46 = TBoolValue()
+            _elem46.read(iprot)
+            self.boolColumn.append(_elem46)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 2:
         if ftype == TType.LIST:
           self.byteColumn = []
-          (_etype41, _size38) = iprot.readListBegin()
-          for _i42 in xrange(_size38):
-            _elem43 = TByteValue()
-            _elem43.read(iprot)
-            self.byteColumn.append(_elem43)
+          (_etype50, _size47) = iprot.readListBegin()
+          for _i51 in xrange(_size47):
+            _elem52 = TByteValue()
+            _elem52.read(iprot)
+            self.byteColumn.append(_elem52)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 3:
         if ftype == TType.LIST:
           self.i16Column = []
-          (_etype47, _size44) = iprot.readListBegin()
-          for _i48 in xrange(_size44):
-            _elem49 = TI16Value()
-            _elem49.read(iprot)
-            self.i16Column.append(_elem49)
+          (_etype56, _size53) = iprot.readListBegin()
+          for _i57 in xrange(_size53):
+            _elem58 = TI16Value()
+            _elem58.read(iprot)
+            self.i16Column.append(_elem58)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 4:
         if ftype == TType.LIST:
           self.i32Column = []
-          (_etype53, _size50) = iprot.readListBegin()
-          for _i54 in xrange(_size50):
-            _elem55 = TI32Value()
-            _elem55.read(iprot)
-            self.i32Column.append(_elem55)
+          (_etype62, _size59) = iprot.readListBegin()
+          for _i63 in xrange(_size59):
+            _elem64 = TI32Value()
+            _elem64.read(iprot)
+            self.i32Column.append(_elem64)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 5:
         if ftype == TType.LIST:
           self.i64Column = []
-          (_etype59, _size56) = iprot.readListBegin()
-          for _i60 in xrange(_size56):
-            _elem61 = TI64Value()
-            _elem61.read(iprot)
-            self.i64Column.append(_elem61)
+          (_etype68, _size65) = iprot.readListBegin()
+          for _i69 in xrange(_size65):
+            _elem70 = TI64Value()
+            _elem70.read(iprot)
+            self.i64Column.append(_elem70)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 6:
         if ftype == TType.LIST:
           self.doubleColumn = []
-          (_etype65, _size62) = iprot.readListBegin()
-          for _i66 in xrange(_size62):
-            _elem67 = TDoubleValue()
-            _elem67.read(iprot)
-            self.doubleColumn.append(_elem67)
+          (_etype74, _size71) = iprot.readListBegin()
+          for _i75 in xrange(_size71):
+            _elem76 = TDoubleValue()
+            _elem76.read(iprot)
+            self.doubleColumn.append(_elem76)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 7:
         if ftype == TType.LIST:
           self.stringColumn = []
-          (_etype71, _size68) = iprot.readListBegin()
-          for _i72 in xrange(_size68):
-            _elem73 = TStringValue()
-            _elem73.read(iprot)
-            self.stringColumn.append(_elem73)
+          (_etype80, _size77) = iprot.readListBegin()
+          for _i81 in xrange(_size77):
+            _elem82 = TStringValue()
+            _elem82.read(iprot)
+            self.stringColumn.append(_elem82)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -1686,50 +1859,50 @@ class TColumn(object):
     if self.boolColumn is not None:
       oprot.writeFieldBegin('boolColumn', TType.LIST, 1)
       oprot.writeListBegin(TType.STRUCT, len(self.boolColumn))
-      for iter74 in self.boolColumn:
-        iter74.write(oprot)
+      for iter83 in self.boolColumn:
+        iter83.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.byteColumn is not None:
       oprot.writeFieldBegin('byteColumn', TType.LIST, 2)
       oprot.writeListBegin(TType.STRUCT, len(self.byteColumn))
-      for iter75 in self.byteColumn:
-        iter75.write(oprot)
+      for iter84 in self.byteColumn:
+        iter84.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.i16Column is not None:
       oprot.writeFieldBegin('i16Column', TType.LIST, 3)
       oprot.writeListBegin(TType.STRUCT, len(self.i16Column))
-      for iter76 in self.i16Column:
-        iter76.write(oprot)
+      for iter85 in self.i16Column:
+        iter85.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.i32Column is not None:
       oprot.writeFieldBegin('i32Column', TType.LIST, 4)
       oprot.writeListBegin(TType.STRUCT, len(self.i32Column))
-      for iter77 in self.i32Column:
-        iter77.write(oprot)
+      for iter86 in self.i32Column:
+        iter86.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.i64Column is not None:
       oprot.writeFieldBegin('i64Column', TType.LIST, 5)
       oprot.writeListBegin(TType.STRUCT, len(self.i64Column))
-      for iter78 in self.i64Column:
-        iter78.write(oprot)
+      for iter87 in self.i64Column:
+        iter87.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.doubleColumn is not None:
       oprot.writeFieldBegin('doubleColumn', TType.LIST, 6)
       oprot.writeListBegin(TType.STRUCT, len(self.doubleColumn))
-      for iter79 in self.doubleColumn:
-        iter79.write(oprot)
+      for iter88 in self.doubleColumn:
+        iter88.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.stringColumn is not None:
       oprot.writeFieldBegin('stringColumn', TType.LIST, 7)
       oprot.writeListBegin(TType.STRUCT, len(self.stringColumn))
-      for iter80 in self.stringColumn:
-        iter80.write(oprot)
+      for iter89 in self.stringColumn:
+        iter89.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -1915,11 +2088,11 @@ class TRow(object):
       if fid == 1:
         if ftype == TType.LIST:
           self.colVals = []
-          (_etype84, _size81) = iprot.readListBegin()
-          for _i85 in xrange(_size81):
-            _elem86 = TColumnValue()
-            _elem86.read(iprot)
-            self.colVals.append(_elem86)
+          (_etype93, _size90) = iprot.readListBegin()
+          for _i94 in xrange(_size90):
+            _elem95 = TColumnValue()
+            _elem95.read(iprot)
+            self.colVals.append(_elem95)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -1936,8 +2109,8 @@ class TRow(object):
     if self.colVals is not None:
       oprot.writeFieldBegin('colVals', TType.LIST, 1)
       oprot.writeListBegin(TType.STRUCT, len(self.colVals))
-      for iter87 in self.colVals:
-        iter87.write(oprot)
+      for iter96 in self.colVals:
+        iter96.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -1997,22 +2170,22 @@ class TRowSet(object):
       elif fid == 2:
         if ftype == TType.LIST:
           self.rows = []
-          (_etype91, _size88) = iprot.readListBegin()
-          for _i92 in xrange(_size88):
-            _elem93 = TRow()
-            _elem93.read(iprot)
-            self.rows.append(_elem93)
+          (_etype100, _size97) = iprot.readListBegin()
+          for _i101 in xrange(_size97):
+            _elem102 = TRow()
+            _elem102.read(iprot)
+            self.rows.append(_elem102)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 3:
         if ftype == TType.LIST:
           self.columns = []
-          (_etype97, _size94) = iprot.readListBegin()
-          for _i98 in xrange(_size94):
-            _elem99 = TColumn()
-            _elem99.read(iprot)
-            self.columns.append(_elem99)
+          (_etype106, _size103) = iprot.readListBegin()
+          for _i107 in xrange(_size103):
+            _elem108 = TColumn()
+            _elem108.read(iprot)
+            self.columns.append(_elem108)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -2033,15 +2206,15 @@ class TRowSet(object):
     if self.rows is not None:
       oprot.writeFieldBegin('rows', TType.LIST, 2)
       oprot.writeListBegin(TType.STRUCT, len(self.rows))
-      for iter100 in self.rows:
-        iter100.write(oprot)
+      for iter109 in self.rows:
+        iter109.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.columns is not None:
       oprot.writeFieldBegin('columns', TType.LIST, 3)
       oprot.writeListBegin(TType.STRUCT, len(self.columns))
-      for iter101 in self.columns:
-        iter101.write(oprot)
+      for iter110 in self.columns:
+        iter110.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -2109,10 +2282,10 @@ class TStatus(object):
       elif fid == 2:
         if ftype == TType.LIST:
           self.infoMessages = []
-          (_etype105, _size102) = iprot.readListBegin()
-          for _i106 in xrange(_size102):
-            _elem107 = iprot.readString();
-            self.infoMessages.append(_elem107)
+          (_etype114, _size111) = iprot.readListBegin()
+          for _i115 in xrange(_size111):
+            _elem116 = iprot.readString();
+            self.infoMessages.append(_elem116)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -2148,8 +2321,8 @@ class TStatus(object):
     if self.infoMessages is not None:
       oprot.writeFieldBegin('infoMessages', TType.LIST, 2)
       oprot.writeListBegin(TType.STRING, len(self.infoMessages))
-      for iter108 in self.infoMessages:
-        oprot.writeString(iter108)
+      for iter117 in self.infoMessages:
+        oprot.writeString(iter117)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.sqlState is not None:
@@ -2437,19 +2610,21 @@ class TOpenSessionReq(object):
 
   thrift_spec = (
     None, # 0
-    (1, TType.I32, 'client_protocol', None,     1, ), # 1
+    (1, TType.I32, 'client_protocol', None,     4, ), # 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
   )
 
-  def __init__(self, client_protocol=thrift_spec[1][4], username=None, password=None, configuration=None,):
+  def __init__(self, client_protocol=4, username=None, password=None, configuration=None,):
     self.client_protocol = client_protocol
     self.username = username
     self.password = password
     self.configuration = configuration
+    
 
   def read(self, iprot):
+    self.client_protocol = 4
     if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
       fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
       return
@@ -2476,11 +2651,11 @@ class TOpenSessionReq(object):
       elif fid == 4:
         if ftype == TType.MAP:
           self.configuration = {}
-          (_ktype110, _vtype111, _size109 ) = iprot.readMapBegin() 
-          for _i113 in xrange(_size109):
-            _key114 = iprot.readString();
-            _val115 = iprot.readString();
-            self.configuration[_key114] = _val115
+          (_ktype119, _vtype120, _size118 ) = iprot.readMapBegin() 
+          for _i122 in xrange(_size118):
+            _key123 = iprot.readString();
+            _val124 = iprot.readString();
+            self.configuration[_key123] = _val124
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -2490,6 +2665,7 @@ class TOpenSessionReq(object):
     iprot.readStructEnd()
 
   def write(self, oprot):
+    self.client_protocol = 4
     if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
       oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
       return
@@ -2509,15 +2685,16 @@ class TOpenSessionReq(object):
     if self.configuration is not None:
       oprot.writeFieldBegin('configuration', TType.MAP, 4)
       oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration))
-      for kiter116,viter117 in self.configuration.items():
-        oprot.writeString(kiter116)
-        oprot.writeString(viter117)
+      for kiter125,viter126 in self.configuration.items():
+        oprot.writeString(kiter125)
+        oprot.writeString(viter126)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
     oprot.writeStructEnd()
 
   def validate(self):
+    self.client_protocol = 4
     if self.client_protocol is None:
       raise TProtocol.TProtocolException(message='Required field client_protocol is unset!')
     return
@@ -2546,7 +2723,7 @@ class TOpenSessionResp(object):
   thrift_spec = (
     None, # 0
     (1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
-    (2, TType.I32, 'serverProtocolVersion', None,     1, ), # 2
+    (2, TType.I32, 'serverProtocolVersion', None,     4, ), # 2
     (3, TType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 3
     (4, TType.MAP, 'configuration', (TType.STRING,None,TType.STRING,None), None, ), # 4
   )
@@ -2586,11 +2763,11 @@ class TOpenSessionResp(object):
       elif fid == 4:
         if ftype == TType.MAP:
           self.configuration = {}
-          (_ktype119, _vtype120, _size118 ) = iprot.readMapBegin() 
-          for _i122 in xrange(_size118):
-            _key123 = iprot.readString();
-            _val124 = iprot.readString();
-            self.configuration[_key123] = _val124
+          (_ktype128, _vtype129, _size127 ) = iprot.readMapBegin() 
+          for _i131 in xrange(_size127):
+            _key132 = iprot.readString();
+            _val133 = iprot.readString();
+            self.configuration[_key132] = _val133
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -2619,9 +2796,9 @@ class TOpenSessionResp(object):
     if self.configuration is not None:
       oprot.writeFieldBegin('configuration', TType.MAP, 4)
       oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration))
-      for kiter125,viter126 in self.configuration.items():
-        oprot.writeString(kiter125)
-        oprot.writeString(viter126)
+      for kiter134,viter135 in self.configuration.items():
+        oprot.writeString(kiter134)
+        oprot.writeString(viter135)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -3093,11 +3270,11 @@ class TExecuteStatementReq(object):
       elif fid == 3:
         if ftype == TType.MAP:
           self.confOverlay = {}
-          (_ktype128, _vtype129, _size127 ) = iprot.readMapBegin() 
-          for _i131 in xrange(_size127):
-            _key132 = iprot.readString();
-            _val133 = iprot.readString();
-            self.confOverlay[_key132] = _val133
+          (_ktype137, _vtype138, _size136 ) = iprot.readMapBegin() 
+          for _i140 in xrange(_size136):
+            _key141 = iprot.readString();
+            _val142 = iprot.readString();
+            self.confOverlay[_key141] = _val142
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -3127,9 +3304,9 @@ class TExecuteStatementReq(object):
     if self.confOverlay is not None:
       oprot.writeFieldBegin('confOverlay', TType.MAP, 3)
       oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.confOverlay))
-      for kiter134,viter135 in self.confOverlay.items():
-        oprot.writeString(kiter134)
-        oprot.writeString(viter135)
+      for kiter143,viter144 in self.confOverlay.items():
+        oprot.writeString(kiter143)
+        oprot.writeString(viter144)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     if self.runAsync is not None:
@@ -3734,10 +3911,10 @@ class TGetTablesReq(object):
       elif fid == 5:
         if ftype == TType.LIST:
           self.tableTypes = []
-          (_etype139, _size136) = iprot.readListBegin()
-          for _i140 in xrange(_size136):
-            _elem141 = iprot.readString();
-            self.tableTypes.append(_elem141)
+          (_etype148, _size145) = iprot.readListBegin()
+          for _i149 in xrange(_size145):
+            _elem150 = iprot.readString();
+            self.tableTypes.append(_elem150)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -3770,8 +3947,8 @@ class TGetTablesReq(object):
     if self.tableTypes is not None:
       oprot.writeFieldBegin('tableTypes', TType.LIST, 5)
       oprot.writeListBegin(TType.STRING, len(self.tableTypes))
-      for iter142 in self.tableTypes:
-        oprot.writeString(iter142)
+      for iter151 in self.tableTypes:
+        oprot.writeString(iter151)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -4441,17 +4618,26 @@ class TGetOperationStatusResp(object):
   Attributes:
    - status
    - operationState
+   - sqlState
+   - errorCode
+   - errorMessage
   """
 
   thrift_spec = (
     None, # 0
     (1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
     (2, TType.I32, 'operationState', None, None, ), # 2
+    (3, TType.STRING, 'sqlState', None, None, ), # 3
+    (4, TType.I32, 'errorCode', None, None, ), # 4
+    (5, TType.STRING, 'errorMessage', None, None, ), # 5
   )
 
-  def __init__(self, status=None, operationState=None,):
+  def __init__(self, status=None, operationState=None, sqlState=None, errorCode=None, errorMessage=None,):
     self.status = status
     self.operationState = operationState
+    self.sqlState = sqlState
+    self.errorCode = errorCode
+    self.errorMessage = errorMessage
 
   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:
@@ -4473,6 +4659,21 @@ class TGetOperationStatusResp(object):
           self.operationState = iprot.readI32();
         else:
           iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.sqlState = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.I32:
+          self.errorCode = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 5:
+        if ftype == TType.STRING:
+          self.errorMessage = iprot.readString();
+        else:
+          iprot.skip(ftype)
       else:
         iprot.skip(ftype)
       iprot.readFieldEnd()
@@ -4491,6 +4692,18 @@ class TGetOperationStatusResp(object):
       oprot.writeFieldBegin('operationState', TType.I32, 2)
       oprot.writeI32(self.operationState)
       oprot.writeFieldEnd()
+    if self.sqlState is not None:
+      oprot.writeFieldBegin('sqlState', TType.STRING, 3)
+      oprot.writeString(self.sqlState)
+      oprot.writeFieldEnd()
+    if self.errorCode is not None:
+      oprot.writeFieldBegin('errorCode', TType.I32, 4)
+      oprot.writeI32(self.errorCode)
+      oprot.writeFieldEnd()
+    if self.errorMessage is not None:
+      oprot.writeFieldBegin('errorMessage', TType.STRING, 5)
+      oprot.writeString(self.errorMessage)
+      oprot.writeFieldEnd()
     oprot.writeFieldStop()
     oprot.writeStructEnd()
 
@@ -5081,6 +5294,452 @@ class TFetchResultsResp(object):
   def __ne__(self, other):
     return not (self == other)
 
+class TGetDelegationTokenReq(object):
+  """
+  Attributes:
+   - sessionHandle
+   - owner
+   - renewer
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1
+    (2, TType.STRING, 'owner', None, None, ), # 2
+    (3, TType.STRING, 'renewer', None, None, ), # 3
+  )
+
+  def __init__(self, sessionHandle=None, owner=None, renewer=None,):
+    self.sessionHandle = sessionHandle
+    self.owner = owner
+    self.renewer = renewer
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.sessionHandle = TSessionHandle()
+          self.sessionHandle.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.owner = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.renewer = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('TGetDelegationTokenReq')
+    if self.sessionHandle is not None:
+      oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1)
+      self.sessionHandle.write(oprot)
+      oprot.writeFieldEnd()
+    if self.owner is not None:
+      oprot.writeFieldBegin('owner', TType.STRING, 2)
+      oprot.writeString(self.owner)
+      oprot.writeFieldEnd()
+    if self.renewer is not None:
+      oprot.writeFieldBegin('renewer', TType.STRING, 3)
+      oprot.writeString(self.renewer)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.sessionHandle is None:
+      raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!')
+    if self.owner is None:
+      raise TProtocol.TProtocolException(message='Required field owner is unset!')
+    if self.renewer is None:
+      raise TProtocol.TProtocolException(message='Required field renewer is unset!')
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class TGetDelegationTokenResp(object):
+  """
+  Attributes:
+   - status
+   - delegationToken
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
+    (2, TType.STRING, 'delegationToken', None, None, ), # 2
+  )
+
+  def __init__(self, status=None, delegationToken=None,):
+    self.status = status
+    self.delegationToken = delegationToken
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.status = TStatus()
+          self.status.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.delegationToken = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('TGetDelegationTokenResp')
+    if self.status is not None:
+      oprot.writeFieldBegin('status', TType.STRUCT, 1)
+      self.status.write(oprot)
+      oprot.writeFieldEnd()
+    if self.delegationToken is not None:
+      oprot.writeFieldBegin('delegationToken', TType.STRING, 2)
+      oprot.writeString(self.delegationToken)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.status is None:
+      raise TProtocol.TProtocolException(message='Required field status is unset!')
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class TCancelDelegationTokenReq(object):
+  """
+  Attributes:
+   - sessionHandle
+   - delegationToken
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1
+    (2, TType.STRING, 'delegationToken', None, None, ), # 2
+  )
+
+  def __init__(self, sessionHandle=None, delegationToken=None,):
+    self.sessionHandle = sessionHandle
+    self.delegationToken = delegationToken
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.sessionHandle = TSessionHandle()
+          self.sessionHandle.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.delegationToken = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('TCancelDelegationTokenReq')
+    if self.sessionHandle is not None:
+      oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1)
+      self.sessionHandle.write(oprot)
+      oprot.writeFieldEnd()
+    if self.delegationToken is not None:
+      oprot.writeFieldBegin('delegationToken', TType.STRING, 2)
+      oprot.writeString(self.delegationToken)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.sessionHandle is None:
+      raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!')
+    if self.delegationToken is None:
+      raise TProtocol.TProtocolException(message='Required field delegationToken is unset!')
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class TCancelDelegationTokenResp(object):
+  """
+  Attributes:
+   - status
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, status=None,):
+    self.status = status
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.status = TStatus()
+          self.status.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('TCancelDelegationTokenResp')
+    if self.status is not None:
+      oprot.writeFieldBegin('status', TType.STRUCT, 1)
+      self.status.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.status is None:
+      raise TProtocol.TProtocolException(message='Required field status is unset!')
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class TRenewDelegationTokenReq(object):
+  """
+  Attributes:
+   - sessionHandle
+   - delegationToken
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1
+    (2, TType.STRING, 'delegationToken', None, None, ), # 2
+  )
+
+  def __init__(self, sessionHandle=None, delegationToken=None,):
+    self.sessionHandle = sessionHandle
+    self.delegationToken = delegationToken
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.sessionHandle = TSessionHandle()
+          self.sessionHandle.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.delegationToken = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('TRenewDelegationTokenReq')
+    if self.sessionHandle is not None:
+      oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1)
+      self.sessionHandle.write(oprot)
+      oprot.writeFieldEnd()
+    if self.delegationToken is not None:
+      oprot.writeFieldBegin('delegationToken', TType.STRING, 2)
+      oprot.writeString(self.delegationToken)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.sessionHandle is None:
+      raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!')
+    if self.delegationToken is None:
+      raise TProtocol.TProtocolException(message='Required field delegationToken is unset!')
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class TRenewDelegationTokenResp(object):
+  """
+  Attributes:
+   - status
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, status=None,):
+    self.status = status
+
+  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:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.status = TStatus()
+          self.status.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('TRenewDelegationTokenResp')
+    if self.status is not None:
+      oprot.writeFieldBegin('status', TType.STRUCT, 1)
+      self.status.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.status is None:
+      raise TProtocol.TProtocolException(message='Required field status is unset!')
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
 class TGetLogReq(object):
   """
   Attributes:

+ 77 - 5
apps/beeswax/src/beeswax/api.py

@@ -33,9 +33,12 @@ import beeswax.models
 from beeswax.forms import QueryForm
 from beeswax.design import HQLdesign
 from beeswax.server import dbms
-from beeswax.server.dbms import expand_exception, get_query_server_config
+from beeswax.server.dbms import expand_exception, get_query_server_config,\
+  QueryServerException
 from beeswax.views import authorized_get_design, authorized_get_history, make_parameterization_form,\
-                          safe_get_design, save_design, massage_columns_for_json, _get_query_handle_and_state
+                          safe_get_design, save_design, massage_columns_for_json, _get_query_handle_and_state,\
+  _parse_out_hadoop_jobs
+from desktop.lib.i18n import force_unicode
 
 
 LOG = logging.getLogger(__name__)
@@ -48,8 +51,13 @@ def error_handler(view_fn):
     except Http404, e:
       raise e
     except Exception, e:
+      if not hasattr(e, 'message') or not e.message:
+        message = _("Unknown exception.")
+      else:
+        message = force_unicode(e.message, strings_only=True, errors='replace')
       response = {
-        'error': str(e)
+        'error': str(e),
+        'message': message,
       }
       return HttpResponse(json.dumps(response), mimetype="application/json", status=500)
   return decorator
@@ -103,6 +111,7 @@ def parameters(request, design_id=None):
   return HttpResponse(json.dumps(response), mimetype="application/json")
 
 
+@error_handler
 def execute_directly(request, query, design, query_server, tablename=None, **kwargs):
   if design is not None:
     design = authorized_get_design(request, design.id)
@@ -123,9 +132,72 @@ def execute_directly(request, query, design, query_server, tablename=None, **kwa
   return HttpResponse(json.dumps(response), mimetype="application/json")
 
 
+@error_handler
+def watch_query_refresh_json(request, id):
+  query_history = authorized_get_history(request, id, must_exist=True)
+  db = dbms.get(request.user, query_history.get_query_server_config())
+  handle, state = _get_query_handle_and_state(query_history)
+  query_history.save_state(state)
+
+  # Show popup message if error, might be better in error tab instead
+  if query_history.is_failure():
+    res = db.get_operation_status(handle)
+    if hasattr(res, 'errorMessage') and res.errorMessage:
+      message = res.errorMessage
+    else:
+      message = ''
+    raise QueryServerException(Exception('Bad status for request %s:\n%s' % (id, res)), message=message)
+
+  # Multi query if more statements
+  try:
+    if not query_history.is_finished() and query_history.is_success() and not query_history.has_results:
+      db.execute_next_statement(query_history)
+      handle, state = _get_query_handle_and_state(query_history)
+  except Exception, ex:
+    LOG.exception(ex)
+    handle, state = _get_query_handle_and_state(query_history)
+
+  try:
+    log = db.get_log(handle)
+  except Exception, ex:
+    log = str(ex)
+
+  jobs = _parse_out_hadoop_jobs(log)
+  job_urls = dict([(job, reverse('jobbrowser.views.single_job', kwargs=dict(job=job))) for job in jobs])
+
+  result = {
+    'log': log,
+    'jobs': jobs,
+    'jobUrls': job_urls,
+    'isSuccess': query_history.is_finished() or (query_history.is_success() and query_history.has_results),
+    'isFailure': query_history.is_failure()
+  }
+
+  return HttpResponse(json.dumps(result), mimetype="application/json")
+
+
+def close_operation(request, query_id):
+  response = {'status': -1, 'message': ''}
+
+  if request.method != 'POST':
+    response['message'] = _('A POST request is required.')
+  else:
+    try:
+      query_history = authorized_get_history(request, query_id, must_exist=True)
+      db = dbms.get(request.user, query_history.get_query_server_config())
+      db.close_operation(query_history.get_handle())
+      _get_query_handle_and_state(query_history)
+      response = {'status': 0}
+    except Exception, e:
+      response = {'message': unicode(e)}
+
+  return HttpResponse(json.dumps(response), mimetype="application/json")
+
+
+@error_handler
 def explain_directly(request, query, design, query_server):
   explanation = dbms.get(request.user, query_server).explain(query)
-  
+
   response = {
     'status': 0,
     'explanation': explanation.textual
@@ -140,7 +212,7 @@ def execute(request, query_id=None):
 
   if request.method != 'POST':
     response['message'] = _('A POST request is required.')
-  
+
   app_name = get_app_name(request)
   query_server = get_query_server_config(app_name)
   query_type = beeswax.models.SavedQuery.TYPES_MAPPING[app_name]

+ 4 - 0
apps/beeswax/src/beeswax/server/dbms.py

@@ -314,6 +314,10 @@ class HiveServer2Dbms(object):
     return self.client.get_state(handle)
 
 
+  def get_operation_status(self, handle):
+    return self.client.get_operation_status(handle)
+
+
   def execute_and_wait(self, query, timeout_sec=30.0, sleep_interval=0.5):
     """
     Run query and check status until it finishes or timeouts.

+ 5 - 0
apps/beeswax/src/beeswax/server/hive_server2_lib.py

@@ -653,6 +653,11 @@ class HiveServerClientCompatible(object):
     return HiveServerQueryHistory.STATE_MAP[res.operationState]
 
 
+  def get_operation_status(self, handle):
+    operationHandle = handle.get_rpc_handle()
+    return self._client.get_operation_status(operationHandle)
+
+
   def use(self, query):
     data = self._client.execute_query(query)
     self._client.close_operation(data.operation_handle)

+ 2 - 2
apps/beeswax/src/beeswax/templates/execute.mako

@@ -141,7 +141,7 @@ ${layout.menubar(section='query')}
           % endif
           " rel="tooltip" data-original-title="${_("If checked, you will receive an email notification when the query completes.")}">
             <input data-bind="checked: query.email" type="checkbox"/>
-            ${_("Email me on completion.")}
+            ${_("Email me on completion")}
           </label>
         </li>
         % if app_name == 'impala':
@@ -1489,7 +1489,7 @@ ko.applyBindings(viewModel);
 
 // Server error handling.
 $(document).on('server.error', function (e, data) {
-  $(document).trigger('error', "${_('Server error occured: ')}" + data.error);
+  $(document).trigger('error', "${_('Server error occured: ')}" + data.message ? data.message : data.error);
 });
 $(document).on('server.unmanageable_error', function (e, responseText) {
   $(document).trigger('error', "${_('Unmanageable server error occured: ')}" + responseText);

+ 1 - 1
apps/beeswax/src/beeswax/tests.py

@@ -386,7 +386,7 @@ for x in sys.stdin:
   def test_explain_query(self):
     c = self.client
     response = _make_query(c, "SELECT KITTENS ARE TASTY", submission_type="Explain")
-    assert_true("ParseException" in response.context["error_message"])
+    assert_true("ParseException line" in json.loads(response.content)["message"])
     CREATE_TABLE = "CREATE TABLE test_explain (foo INT, bar STRING);"
     response = _make_query(c, CREATE_TABLE)
     wait_for_query_to_finish(c, response)

+ 3 - 3
apps/beeswax/src/beeswax/urls.py

@@ -21,9 +21,7 @@ urlpatterns = patterns('beeswax.views',
   url(r'^$', 'index', name='index'),
 
   url(r'^execute/(?P<design_id>\d+)?$', 'execute_query', name='execute_query'),
-  url(r'^watch/(?P<id>\d+)$', 'watch_query', name='watch_query'),
-  url(r'^watch/json/(?P<id>\d+)$', 'watch_query_refresh_json', name='watch_query_refresh_json'),
-  url(r'^close_operation/(?P<query_id>\d+)?$', 'close_operation', name='close_operation'),
+  url(r'^watch/(?P<id>\d+)$', 'watch_query', name='watch_query'),  
   url(r'^results/(?P<id>\d+)/(?P<first_row>\d+)$', 'view_results', name='view_results'),
   url(r'^download/(?P<id>\d+)/(?P<format>\w+)$', 'download', name='download'),
   url(r'^save_results/(?P<id>\d+)$', 'save_results', name='save_results'),
@@ -66,4 +64,6 @@ urlpatterns += patterns(
   url(r'^api/query/(?P<query_id>\d+)?$', 'save_query', name='api_save_query'),
   url(r'^api/query/(?P<query_id>\d+)/get$', 'fetch_saved_query', name='api_fetch_saved_query'),
   url(r'^api/query/(?P<query_id>\d+)/cancel$', 'cancel_query', name='api_cancel_query'),
+  url(r'^watch/json/(?P<id>\d+)$', 'watch_query_refresh_json', name='watch_query_refresh_json'),
+  url(r'^close_operation/(?P<query_id>\d+)?$', 'close_operation', name='close_operation'),
 )

+ 1 - 56
apps/beeswax/src/beeswax/views.py

@@ -501,58 +501,6 @@ def watch_query(request, id):
               })
 
 
-
-def watch_query_refresh_json(request, id):
-  query_history = authorized_get_history(request, id, must_exist=True)
-  db = dbms.get(request.user, query_history.get_query_server_config())
-  handle, state = _get_query_handle_and_state(query_history)
-  query_history.save_state(state)
-
-  try:
-    if not query_history.is_finished() and query_history.is_success() and not query_history.has_results:
-      db.execute_next_statement(query_history)
-      handle, state = _get_query_handle_and_state(query_history)
-  except Exception, ex:
-    LOG.exception(ex)
-    handle, state = _get_query_handle_and_state(query_history)
-
-  try:
-    log = db.get_log(handle)
-  except Exception, ex:
-    log = str(ex)
-
-  jobs = _parse_out_hadoop_jobs(log)
-  job_urls = dict([(job, reverse('jobbrowser.views.single_job', kwargs=dict(job=job))) for job in jobs])
-
-  result = {
-    'log': log,
-    'jobs': jobs,
-    'jobUrls': job_urls,
-    'isSuccess': query_history.is_finished() or (query_history.is_success() and query_history.has_results),
-    'isFailure': query_history.is_failure()
-  }
-
-  return HttpResponse(json.dumps(result), mimetype="application/json")
-
-
-def close_operation(request, query_id):
-  response = {'status': -1, 'message': ''}
-
-  if request.method != 'POST':
-    response['message'] = _('A POST request is required.')
-  else:
-    try:
-      query_history = authorized_get_history(request, query_id, must_exist=True)
-      db = dbms.get(request.user, query_history.get_query_server_config())
-      db.close_operation(query_history.get_handle())
-      _get_query_handle_and_state(query_history)
-      response = {'status': 0}
-    except Exception, e:
-      response = {'message': unicode(e)}
-
-  return HttpResponse(json.dumps(response), mimetype="application/json")
-
-
 def view_results(request, id, first_row=0):
   """
   Returns the view for the results of the QueryHistory with the given id.
@@ -1124,10 +1072,7 @@ def _get_query_handle_and_state(query_history):
   if query_server['server_name'] == 'impala' and not handle.has_result_set:
     state = QueryHistory.STATE.available
   else:
-    try:
-      state = dbms.get(query_history.owner, query_history.get_query_server_config()).get_state(handle)
-    except QueryServerException, e:
-      raise PopupException(_("Failed to contact Server to check query status."), detail=e)
+    state = dbms.get(query_history.owner, query_history.get_query_server_config()).get_state(handle)
 
   if state is None:
     raise PopupException(_("Failed to contact Server to check query status."))

+ 120 - 21
apps/beeswax/thrift/TCLIService.thrift

@@ -39,9 +39,18 @@ namespace cpp apache.hive.service.cli.thrift
 // added to the end of this list every time a change is made.
 enum TProtocolVersion {
   HIVE_CLI_SERVICE_PROTOCOL_V1,
-
+  
   // V2 adds support for asynchronous execution
   HIVE_CLI_SERVICE_PROTOCOL_V2
+
+  // V3 add varchar type, primitive type qualifiers
+  HIVE_CLI_SERVICE_PROTOCOL_V3
+
+  // V4 add decimal precision/scale, char type
+  HIVE_CLI_SERVICE_PROTOCOL_V4
+
+  // V5 adds error details when GetOperationStatus returns in error state
+  HIVE_CLI_SERVICE_PROTOCOL_V5
 }
 
 enum TTypeId {
@@ -62,9 +71,11 @@ enum TTypeId {
   USER_DEFINED_TYPE,
   DECIMAL_TYPE,
   NULL_TYPE,
-  DATE_TYPE
+  DATE_TYPE,
+  VARCHAR_TYPE,
+  CHAR_TYPE
 }
-
+  
 const set<TTypeId> PRIMITIVE_TYPES = [
   TTypeId.BOOLEAN_TYPE,
   TTypeId.TINYINT_TYPE,
@@ -79,6 +90,8 @@ const set<TTypeId> PRIMITIVE_TYPES = [
   TTypeId.DECIMAL_TYPE,
   TTypeId.NULL_TYPE
   TTypeId.DATE_TYPE
+  TTypeId.VARCHAR_TYPE
+  TTypeId.CHAR_TYPE
 ]
 
 const set<TTypeId> COMPLEX_TYPES = [
@@ -112,6 +125,8 @@ const map<TTypeId,string> TYPE_NAMES = {
   TTypeId.DECIMAL_TYPE: "DECIMAL",
   TTypeId.NULL_TYPE: "NULL"
   TTypeId.DATE_TYPE: "DATE"
+  TTypeId.VARCHAR_TYPE: "VARCHAR"
+  TTypeId.CHAR_TYPE: "CHAR"
 }
 
 // Thrift does not support recursively defined types or forward declarations,
@@ -159,11 +174,29 @@ const map<TTypeId,string> TYPE_NAMES = {
 
 typedef i32 TTypeEntryPtr
 
+// Valid TTypeQualifiers key names
+const string CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength"
+
+// Type qualifier key name for decimal
+const string PRECISION = "precision"
+const string SCALE = "scale"
+
+union TTypeQualifierValue {
+  1: optional i32 i32Value
+  2: optional string stringValue
+}
+
+// Type qualifiers for primitive type.
+struct TTypeQualifiers {
+  1: required map <string, TTypeQualifierValue> qualifiers
+}
+
 // Type entry for a primitive type.
 struct TPrimitiveTypeEntry {
   // The primitive type token. This must satisfy the condition
   // that type is in the PRIMITIVE_TYPES set.
   1: required TTypeId type
+  2: optional TTypeQualifiers typeQualifiers
 }
 
 // Type entry for an ARRAY type.
@@ -217,7 +250,7 @@ struct TColumnDesc {
 
   // The type descriptor for this column
   2: required TTypeDesc typeDesc
-
+  
   // The ordinal position of this column in the schema
   3: required i32 position
 
@@ -364,7 +397,6 @@ enum TOperationState {
   PENDING_STATE,
 }
 
-
 // A string identifier. This is interpreted literally.
 typedef string TIdentifier
 
@@ -458,7 +490,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_V2
+  1: required TProtocolVersion client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V5
 
   // Username and password for authentication.
   // Depending on the authentication scheme being used,
@@ -477,7 +509,7 @@ struct TOpenSessionResp {
   1: required TStatus status
 
   // The protocol version that the server is using.
-  2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V2
+  2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V5
 
   // Session Handle
   3: optional TSessionHandle sessionHandle
@@ -599,7 +631,7 @@ struct TExecuteStatementReq {
   // is executed. These properties apply to this statement
   // only and will not affect the subsequent state of the Session.
   3: optional map<string, string> confOverlay
-
+  
   // Execute asynchronously when runAsync is true
   4: optional bool runAsync = false
 }
@@ -625,13 +657,13 @@ struct TGetTypeInfoReq {
 struct TGetTypeInfoResp {
   1: required TStatus status
   2: optional TOperationHandle operationHandle
-}
+}  
 
 
 // GetCatalogs()
 //
-// Returns the list of catalogs (databases)
-// Results are ordered by TABLE_CATALOG
+// Returns the list of catalogs (databases) 
+// Results are ordered by TABLE_CATALOG 
 //
 // Resultset columns :
 // col1
@@ -652,7 +684,7 @@ struct TGetCatalogsResp {
 
 // GetSchemas()
 //
-// Retrieves the schema names available in this database.
+// Retrieves the schema names available in this database. 
 // The results are ordered by TABLE_CATALOG and TABLE_SCHEM.
 // col1
 // name: TABLE_SCHEM
@@ -741,9 +773,9 @@ struct TGetTablesResp {
 
 // GetTableTypes()
 //
-// Returns the table types available in this database.
-// The results are ordered by table type.
-//
+// Returns the table types available in this database. 
+// The results are ordered by table type. 
+// 
 // col1
 // name: TABLE_TYPE
 // type: STRING
@@ -764,8 +796,8 @@ struct TGetTableTypesResp {
 // Returns a list of columns in the specified tables.
 // The information is returned as a result set which can be fetched
 // using the OperationHandle provided in the response.
-// Results are ordered by TABLE_CAT, TABLE_SCHEM, TABLE_NAME,
-// and ORDINAL_POSITION.
+// Results are ordered by TABLE_CAT, TABLE_SCHEM, TABLE_NAME, 
+// and ORDINAL_POSITION. 
 //
 // Result Set Columns are the same as those for the ODBC CLIColumns
 // function.
@@ -861,7 +893,7 @@ struct TGetFunctionsResp {
   1: required TStatus status
   2: optional TOperationHandle operationHandle
 }
-
+  
 
 // GetOperationStatus()
 //
@@ -874,6 +906,16 @@ struct TGetOperationStatusReq {
 struct TGetOperationStatusResp {
   1: required TStatus status
   2: optional TOperationState operationState
+
+  // If operationState is ERROR_STATE, then the following fields may be set
+  // sqlState as defined in the ISO/IEF CLI specification
+  3: optional string sqlState
+
+  // Internal error code
+  4: optional i32 errorCode
+
+  // Error message
+  5: optional string errorMessage
 }
 
 
@@ -956,7 +998,7 @@ struct TFetchResultsReq {
   // The fetch orientation. For V1 this must be either
   // FETCH_NEXT or FETCH_FIRST. Defaults to FETCH_NEXT.
   2: required TFetchOrientation orientation = TFetchOrientation.FETCH_NEXT
-
+  
   // Max number of rows that should be returned in
   // the rowset.
   3: required i64 maxRows
@@ -975,6 +1017,57 @@ struct TFetchResultsResp {
   3: optional TRowSet results
 }
 
+// GetDelegationToken()
+// Retrieve delegation token for the current user
+struct  TGetDelegationTokenReq {
+  // session handle
+  1: required TSessionHandle sessionHandle
+
+  // userid for the proxy user
+  2: required string owner
+
+  // designated renewer userid
+  3: required string renewer
+}
+
+struct TGetDelegationTokenResp {
+  // status of the request
+  1: required TStatus status
+
+  // delegation token string
+  2: optional string delegationToken
+}
+
+// CancelDelegationToken()
+// Cancel the given delegation token
+struct TCancelDelegationTokenReq {
+  // session handle
+  1: required TSessionHandle sessionHandle
+
+  // delegation token to cancel
+  2: required string delegationToken
+}
+
+struct TCancelDelegationTokenResp {
+  // status of the request
+  1: required TStatus status
+}
+
+// RenewDelegationToken()
+// Renew the given delegation token
+struct TRenewDelegationTokenReq {
+  // session handle
+  1: required TSessionHandle sessionHandle
+
+  // delegation token to renew
+  2: required string delegationToken
+}
+
+struct TRenewDelegationTokenResp {
+  // status of the request
+  1: required TStatus status
+}
+
 // GetLog()
 //
 // Fetch operation log from the server corresponding to
@@ -1016,14 +1109,20 @@ service TCLIService {
   TGetFunctionsResp GetFunctions(1:TGetFunctionsReq req);
 
   TGetOperationStatusResp GetOperationStatus(1:TGetOperationStatusReq req);
-
+  
   TCancelOperationResp CancelOperation(1:TCancelOperationReq req);
 
   TCloseOperationResp CloseOperation(1:TCloseOperationReq req);
 
   TGetResultSetMetadataResp GetResultSetMetadata(1:TGetResultSetMetadataReq req);
-
+ 
   TFetchResultsResp FetchResults(1:TFetchResultsReq req);
 
+  TGetDelegationTokenResp GetDelegationToken(1:TGetDelegationTokenReq req);
+
+  TCancelDelegationTokenResp CancelDelegationToken(1:TCancelDelegationTokenReq req);
+
+  TRenewDelegationTokenResp RenewDelegationToken(1:TRenewDelegationTokenReq req);
+
   TGetLogResp GetLog(1:TGetLogReq req);
 }