[ 
https://issues.apache.org/jira/browse/TRAFODION-2498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15886403#comment-15886403
 ] 

ASF GitHub Bot commented on TRAFODION-2498:
-------------------------------------------

Github user robertamarton commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/979#discussion_r103294768
  
    --- Diff: core/sql/executor/ExExeUtilMisc.cpp ---
    @@ -2509,3 +2509,128 @@ 
ExExeUtilHiveTruncatePrivateState::ExExeUtilHiveTruncatePrivateState()
     ExExeUtilHiveTruncatePrivateState::~ExExeUtilHiveTruncatePrivateState()
     {
     };
    +
    +////////////////////////////////////////////////////////////////
    +// Constructor for class ExExeUtilHiveQueryTdb
    +///////////////////////////////////////////////////////////////
    +ex_tcb * ExExeUtilHiveQueryTdb::build(ex_globals * glob)
    +{
    +  ExExeUtilTcb * exe_util_tcb;
    +
    +  exe_util_tcb = new(glob->getSpace()) ExExeUtilHiveQueryTcb(*this, glob);
    +  exe_util_tcb->registerSubtasks();
    +
    +  return (exe_util_tcb);
    +}
    +
    +
    +////////////////////////////////////////////////////////////////
    +// Constructor for class ExExeUtilHiveQueryTcb
    +///////////////////////////////////////////////////////////////
    +ExExeUtilHiveQueryTcb::ExExeUtilHiveQueryTcb(
    +     const ComTdbExeUtilHiveQuery & exe_util_tdb,
    +     ex_globals * glob)
    +     : ExExeUtilTcb( exe_util_tdb, NULL, glob)
    +{
    +  // Allocate the private state in each entry of the down queue
    +  qparent_.down->allocatePstate(this);
    +
    +  step_ = INITIAL_;
    +}
    +
    +ExExeUtilHiveQueryTcb::~ExExeUtilHiveQueryTcb()
    +{
    +}
    +
    +//////////////////////////////////////////////////////
    +// work() for ExExeUtilHiveQueryTsb
    +//////////////////////////////////////////////////////
    +short ExExeUtilHiveQueryTcb::work()
    +{
    +  short rc = 0;
    +  Lng32 cliRC = 0;
    +
    +  // if no parent request, return
    +  if (qparent_.down->isEmpty())
    +    return WORK_OK;
    +
    +  // if no room in up queue, won't be able to return data/status.
    +  // Come back later.
    +  if (qparent_.up->isFull())
    +    return WORK_OK;
    +
    +  ex_queue_entry * pentry_down = qparent_.down->getHeadEntry();
    +  ExExeUtilPrivateState & pstate = *((ExExeUtilPrivateState*) 
pentry_down->pstate);
    +
    +  while (1)
    +    {
    +      switch (step_)
    +        {
    +        case INITIAL_:
    +          {
    +            step_ = PROCESS_QUERY_;
    +          }
    +          break;
    +          
    --- End diff --
    
    If authorization is enabled, need a check to make sure that the current 
user has the authority to manage hive tables.   Need to determine if the 
currently connected user has admin privileges in Hive.  If not, should not 
allow the operation.  If this is too difficult, then just prevent create, 
alter, and drops of Hive tables when authorization is enabled.
    When Sentry is enabled, then return an error - Sentry enabled hive tables 
are only managed by Hive.  We could, in the future, call Sentry to see if the 
currently connected user has admin privileges and allow these operations.


> Add support to run hive DDL commands from trafodion interface
> -------------------------------------------------------------
>
>                 Key: TRAFODION-2498
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2498
>             Project: Apache Trafodion
>          Issue Type: New Feature
>            Reporter: Anoop Sharma
>            Assignee: Anoop Sharma
>            Priority: Minor
>
> Currently, native hive DDL (create/drop/alter of tables/views) need to be 
> done from a hive shell/commandline interface.
> After creating them, they can then be accessed from trafodion 
> using a 3-part name where the first(catalog) part is "hive".
> This jira is to enhance trafodion so hive ddl statements can be issued
> from any trafodion interface (sqlci, trafci, odbc/jdbc..).
> It provides one interface to do hive ddl and trafodion operations.
> This is also useful in developing test suites that can issue hive 
> ddl commands from traf interface without having to switch to a different hive 
> interface.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to