spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hvanhovell <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...
Date Sun, 24 Apr 2016 11:15:12 GMT
Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r60842895
  
    --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionCatalog.scala ---
    @@ -75,6 +77,33 @@ private[sql] class HiveSessionCatalog(
       // | Methods and fields for interacting with HiveMetastoreCatalog |
       // ----------------------------------------------------------------
     
    +  override def validateName(name: String): Boolean = {
    +    super.validateName(name)
    +    // Since we are saving metadata to metastore, we need to check if metastore supports
    +    // the table name and database name we have for this query. MetaStoreUtils.validateName
    +    // is the method used by Hive to check if a table name or a database name is valid
for
    +    // the metastore.
    +    MetaStoreUtils.validateName(name)
    +  }
    +
    +  override def validateDatabaseName(dbName: Option[String]): Unit = {
    +    if (dbName.isDefined) validateDatabaseName(dbName.get)
    +  }
    +
    +  override def validateDatabaseName(dbName: String): Unit = {
    +    if (!validateName(dbName)) {
    +      throw new AnalysisException(s"Database name '$dbName' is not a valid name for metastore.
" +
    --- End diff --
    
    The only difference is the term 'Metastore' right? I am not use if this warrants an override.


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