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

    https://github.com/apache/spark/pull/4158#discussion_r23444732
  
    --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala ---
    @@ -633,14 +633,28 @@ 
https://cwiki.apache.org/confluence/display/Hive/Enhanced+Aggregation%2C+Cube%2C
                        Token(script, Nil) ::
                        Token("TOK_SERDE", serdeClause) ::
                        Token("TOK_RECORDREADER", readerClause) ::
    -                   outputClause :: Nil) :: Nil) =>
    +                   outputClause) :: Nil) =>
     
    +            // TODO the output should be bind with the output clause or 
RecordReader
                 val output = outputClause match {
    -              case Token("TOK_ALIASLIST", aliases) =>
    +              case Token("TOK_ALIASLIST", aliases) :: Nil =>
                     aliases.map { case Token(name, Nil) => 
AttributeReference(name, StringType)() }
    -              case Token("TOK_TABCOLLIST", attributes) =>
    +              case Token("TOK_TABCOLLIST", attributes) :: Nil =>
                     attributes.map { case Token("TOK_TABCOL", Token(name, Nil) 
:: dataType :: Nil) =>
                       AttributeReference(name, nodeToDataType(dataType))() }
    +              case Nil => // Not specified the output field names, let it 
be the same as input
    +                (0 to inputExprs.length - 1).map { idx =>
    +                  // Keep the same as Hive does, the first field names is 
"key", and second is
    +                  // "value", however, Hive seems gives null string for 
the rest of the
    --- End diff --
    
    According to Hive manual, there should be only two outputs `key` and 
`value` when no output schema is defined. So I am not sure if it is a bug 
because it is explictly described in the manual. I suppose that it is a 
well-known and expected behavior?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to