def load_after_create(request, database):
 tablename = request.REQUEST.get('table')
 path = request.REQUEST.get('path')
 if ((not tablename) or (not path)):
  msg = _('Internal error: Missing needed parameter to load data into table.')
  LOG.error(msg)
  raise PopupException(msg)
 LOG.debug(('Auto loading data from %s into table %s' % (path, tablename)))
 hql = ("LOAD DATA INPATH '%s' INTO TABLE `%s.%s`" % (path, database, tablename))
 query = hql_query(hql)
 on_success_url = reverse('metastore:describe_table', kwargs={'database': database, 'table': tablename})
 try:
  return execute_directly(request, query, on_success_url=on_success_url)
 except Exception as e:
  message = 'The table data could not be loaded'
  LOG.exception(message)
  detail = (e.message if (hasattr(e, 'message') and e.message) else None)
  raise PopupException(_(message), detail=detail)

def load_after_create ( request , database ) : tablename = request . REQUEST . get ( 'table' ) path = request . REQUEST . get ( 'path' ) if ( ( not tablename ) or ( not path ) ) : msg = _ ( 'Internal error: Missing needed parameter to load data into table.' ) LOG . error ( msg ) raise PopupException ( msg ) LOG . debug ( ( 'Auto loading data from %s into table %s' % ( path , tablename ) ) ) hql = ( "LOAD DATA INPATH '%s' INTO TABLE `%s.%s`" % ( path , database , tablename ) ) query = hql_query ( hql ) on_success_url = reverse ( 'metastore:describe_table' , kwargs = { 'database' : database , 'table' : tablename } ) try : return execute_directly ( request , query , on_success_url = on_success_url ) except Exception as e : message = 'The table data could not be loaded' LOG . exception ( message ) detail = ( e . message if ( hasattr ( e , 'message' ) and e . message ) else None ) raise PopupException ( _ ( message ) , detail = detail )
automatically load data into a newly created table .