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

    https://github.com/apache/spark/pull/3847#discussion_r22376322
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/sources/ddl.scala ---
    @@ -70,13 +73,33 @@ private[sql] class DDLParser extends 
StandardTokenParsers with PackratParsers wi
        * CREATE TEMPORARY TABLE avroTable
        * USING org.apache.spark.sql.avro
        * OPTIONS (path "../hive/src/test/resources/data/files/episodes.avro")
    +   * OR,
    +   * For other external datasources not only a kind of file like:avro, 
parquet, json, but a cluster database, like: cassandra an hbase etc...
    +   * DDL like this:
    +   * CREATE TEMPORARY TABLE cassandraTable
    +   * USING org.apache.spark.sql.cassandra
    +   * WITH SERDEPROP("serialization.format"="1", 
"cassandra.columns.mapping"="key,data")
    +   * TBLPROPERTIES("cassandra.keyspace.name" = "cassandra_keyspace")
        */
       protected lazy val createTable: Parser[LogicalPlan] =
    -    CREATE ~ TEMPORARY ~ TABLE ~> ident ~ (USING ~> className) ~ (OPTIONS 
~> options) ^^ {
    -      case tableName ~ provider ~ opts =>
    -        CreateTableUsing(tableName, provider, opts)
    +    CREATE ~ TEMPORARY ~ TABLE ~> ident ~ (USING ~> className) ~
    +      (OPTIONS ~> options).? ~ (WITH ~ SERDEPROP ~> properties).? ~
    +      (TBLPROP ~> properties).? ^^ {
    +      case tableName ~ provider ~ opts ~ serdeprop ~ tblprop =>
    +        val optionParams = opts.getOrElse(Map[String,String]())
    +        val serdeParams = serdeprop.getOrElse(Map[String,String]())
    +        val tblParams = tblprop.getOrElse(Map[String,String]())
    +        //TODO: in order to not break current interface, simple union 
them, if interface changes, also change this
    --- End diff --
    
    exceeds limitation of line length


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

Reply via email to