spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jayadevanmurali <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-12982][SQL] Add table name validation i...
Date Sat, 30 Jan 2016 09:03:29 GMT
Github user jayadevanmurali commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10983#discussion_r51342667
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala ---
    @@ -747,7 +747,7 @@ class SQLContext private[sql](
        * only during the lifetime of this instance of SQLContext.
        */
       private[sql] def registerDataFrameAsTable(df: DataFrame, tableName: String): Unit =
{
    -    catalog.registerTable(TableIdentifier(tableName), df.logicalPlan)
    +    catalog.registerTable(SqlParser.parseTableIdentifier(tableName), df.logicalPlan)
    --- End diff --
    
    Ok I can see the variable definition at line 211 of SqlContext.scala
    @transient
     protected[sql] val sqlParser = new SparkSQLParser(getSQLDialect().parse(_))
    
    But this varable is not used anywhare.All methods  use Sqlarser.parseTableIdentifier()
for example  @Experimental
    def createExternalTable(
    tableName: String,
    source: String,
    options: Map[String, String]): DataFrame = {
    **val tableIdent = SqlParser.parseTableIdentifier(tableName)**
    val cmd =
    CreateTableUsing(
    tableIdent,
    userSpecifiedSchema = None,
    source,
    temporary = false,
    options,
    allowExisting = false,
    managedIfNoPath = false)
    executePlan(cmd).toRdd
    table(tableIdent)
    }
    
    Correct me if am wrong.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message