Github user chenghao-intel commented on a diff in the pull request:
https://github.com/apache/spark/pull/4014#discussion_r23510200
--- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala ---
@@ -627,29 +627,71 @@
https://cwiki.apache.org/confluence/display/Hive/Enhanced+Aggregation%2C+Cube%2C
case Token("TOK_SELEXPR",
Token("TOK_TRANSFORM",
Token("TOK_EXPLIST", inputExprs) ::
- Token("TOK_SERDE", Nil) ::
+ Token("TOK_SERDE", inputSerdeClause) ::
Token("TOK_RECORDWRITER", writerClause) ::
// TODO: Need to support other types of (in/out)put
Token(script, Nil) ::
- Token("TOK_SERDE", serdeClause) ::
+ Token("TOK_SERDE", outputSerdeClause) ::
Token("TOK_RECORDREADER", readerClause) ::
- outputClause :: Nil) :: Nil) =>
-
- val output = outputClause match {
- case Token("TOK_ALIASLIST", aliases) =>
- aliases.map { case Token(name, Nil) =>
AttributeReference(name, StringType)() }
- case Token("TOK_TABCOLLIST", attributes) =>
- attributes.map { case Token("TOK_TABCOL", Token(name, Nil)
:: dataType :: Nil) =>
- AttributeReference(name, nodeToDataType(dataType))() }
+ outputClause) :: Nil) =>
+
+ val (output, schemaLess) = outputClause match {
+ case Token("TOK_ALIASLIST", aliases) :: Nil =>
+ (aliases.map { case Token(name, Nil) =>
AttributeReference(name, StringType)() },
+ false)
+ case Token("TOK_TABCOLLIST", attributes) :: Nil =>
+ (attributes.map { case Token("TOK_TABCOL", Token(name,
Nil) :: dataType :: Nil) =>
+ AttributeReference(name, nodeToDataType(dataType))() },
false)
+ case Nil =>
+ (List(AttributeReference("key", StringType)(),
+ AttributeReference("value", StringType)()), true)
}
+
+ val (inputRowFormat, inputSerdeClass, inputSerdeProps) =
inputSerdeClause match {
--- End diff --
I still have some concerns about the SerDe / RowFormat stuff parsing,
instead of rewriting them, probably reuse the existed code is preferred, do you
think the following link will be helpful?
https://github.com/apache/hive/blob/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java#L1711
https://github.com/apache/hive/blob/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java#L10785
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]