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

    https://github.com/apache/spark/pull/10649#discussion_r49128910
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/CatalystQl.scala ---
    @@ -58,26 +51,35 @@ private[sql] class CatalystQl(val conf: ParserConf = 
SimpleParserConf()) {
             throw new AnalysisException(e.getMessage)
           case e: NotImplementedError =>
             throw new AnalysisException(
    -          s"""
    -             |Unsupported language features in query: $sql
    -             |${getAst(sql).treeString}
    +          s"""== Unsupported language features in query ==
    +             |== SQL ==
    +             |$sql
    +             |== AST ==
    +             |${ast.treeString}
    +             |== Error ==
                  |$e
    +             |== Stacktrace ==
                  |${e.getStackTrace.head}
               """.stripMargin)
         }
       }
     
    -  protected def createPlan(sql: String, tree: ASTNode): LogicalPlan = 
nodeToPlan(tree)
    -
    -  def parseDdl(ddl: String): Seq[Attribute] = {
    -    val tree = getAst(ddl)
    -    assert(tree.text == "TOK_CREATETABLE", "Only CREATE TABLE supported.")
    -    val tableOps = tree.children
    -    val colList = tableOps
    -      .find(_.text == "TOK_TABCOLLIST")
    -      .getOrElse(sys.error("No columnList!"))
    -
    -    colList.children.map(nodeToAttribute)
    +  /** Creates LogicalPlan for a given SQL string. */
    +  def createPlan(sql: String): LogicalPlan =
    --- End diff --
    
    but no big deal.


---
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