You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by zellerh <gi...@git.apache.org> on 2018/04/18 21:47:43 UTC

[GitHub] trafodion pull request #1525: [TRAFODION-3028] Support CONTROL QUERY SHAPE (...

GitHub user zellerh opened a pull request:

    https://github.com/apache/trafodion/pull/1525

    [TRAFODION-3028] Support CONTROL QUERY SHAPE (CQS) for Hive insert

    Adding fast_extract() and hive_insert() CQS operator syntax to be able to force shapes of Hive insert statements.
    
    Example:
    
    control query shape hive_insert(cut);
    explain insert into hive.hive.t values(1,1);
    
    Note: I don't think this fix works for UNLOAD, since that seems to be
    an "ExeUtil" statement that gets executed in two phases.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zellerh/trafodion bug/R23a

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafodion/pull/1525.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1525
    
----
commit 81fadbc34683b33875892ded7a92d84793cc73c4
Author: Hans Zeller <hz...@...>
Date:   2018-04-18T21:38:03Z

    [TRAFODION-3028] Support CONTROL QUERY SHAPE (CQS) for Hive insert
    
    Adding fast_extract() and hive_insert() CQS operator syntax to be able to force shapes of Hive insert statements.
    
    Example:
    
    control query shape hive_insert(cut);
    explain insert into hive.hive.t values(1,1);
    
    Note: I don't think this fix works for UNLOAD, since that seems to be
    an "ExeUtil" statement that gets executed in two phases.

----


---

[GitHub] trafodion pull request #1525: [TRAFODION-3028] Support CONTROL QUERY SHAPE (...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1525#discussion_r182604451
  
    --- Diff: core/sql/common/ExprNode.cpp ---
    @@ -737,6 +737,16 @@ NABoolean OperatorType::match(OperatorTypeEnum wildcard) const
     	      return FALSE;
     	    }
     
    +        case REL_ANY_EXTRACT:
    +	  switch (op_)
    +	    {
    +	    case REL_FAST_EXTRACT:
    --- End diff --
    
    It's counterintuitive to me that a Hive Insert (or any Insert) is considered an Extract. "Extract" to me has the connotation of pulling something out, while "Insert" to me has the connotation of putting something in. Perhaps "Extract" in this context is in reference to a Trafodion object? But would a Hive Insert always be taking data from a Trafodion object? Or might we support Insert/Select from one Hive object to another?


---

[GitHub] trafodion pull request #1525: [TRAFODION-3028] Support CONTROL QUERY SHAPE (...

Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1525#discussion_r182605678
  
    --- Diff: core/sql/common/ExprNode.cpp ---
    @@ -737,6 +737,16 @@ NABoolean OperatorType::match(OperatorTypeEnum wildcard) const
     	      return FALSE;
     	    }
     
    +        case REL_ANY_EXTRACT:
    +	  switch (op_)
    +	    {
    +	    case REL_FAST_EXTRACT:
    --- End diff --
    
    Yes, this is for historical reasons. Khaled originally implemented a "fast extract" operator that would take the output of a query and store it in a delimited HDFS file.
    
    Later, when we wanted to implement insert into Hive tables, someone recognized that the fast extract operator did something very similar, so they enhanced it and internally used it to implement Hive inserts. We could try to hide this by avoiding the term "FAST_EXTRACT", and in fact this is done in EXPLAIN, but SHOWSHAPE still shows this heritage.



---

[GitHub] trafodion pull request #1525: [TRAFODION-3028] Support CONTROL QUERY SHAPE (...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1525#discussion_r182605944
  
    --- Diff: core/sql/common/ExprNode.cpp ---
    @@ -737,6 +737,16 @@ NABoolean OperatorType::match(OperatorTypeEnum wildcard) const
     	      return FALSE;
     	    }
     
    +        case REL_ANY_EXTRACT:
    +	  switch (op_)
    +	    {
    +	    case REL_FAST_EXTRACT:
    --- End diff --
    
    Thank you for the explanation. It's fine as it is.


---

[GitHub] trafodion pull request #1525: [TRAFODION-3028] Support CONTROL QUERY SHAPE (...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/trafodion/pull/1525


---