You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gatorsmile <gi...@git.apache.org> on 2016/04/22 22:16:26 UTC

[GitHub] spark pull request: [SPARK-14857] [SQL] [WIP] Table/Database Name ...

GitHub user gatorsmile opened a pull request:

    https://github.com/apache/spark/pull/12618

    [SPARK-14857] [SQL] [WIP] Table/Database Name Validation in SessionCatalog

    #### What changes were proposed in this pull request?
    Their PR is to validate the database/table names before storing these information in `ExternalCatalog`. 
    
    This PR is part of the efforts to reduce the dependencies on Hive meta-store for catching any illegal inputs. 
    
    For example, if users use `backstick` to quote the table/database names containing illegal characters, these names are allowed by Spark Parser, but Hive metastore does not allow them. We need to catch them in SessionCatalog and issue an appropriate error message. We are facing the same issues for creating data source tables (e.g., from dataframes).
    ```
    CREATE TABLE `tab:1`  ...
    ```
    
    This PR enforces the name rules of Spark SQL for `table`/`database`/`view`: `only can contain alphanumeric and underscore characters.` Different from Hive, we allow the names with starting underscore characters. 
    
    When the `ExternalCatalog` is Hive Metastore, we use `MetaStoreUtils.validateName` to check its validity. **Question**: should we enforce both? My guess is Yes.
    
    In the future PRs, we will continue the work on validation of function/column names. 
    
    #### How was this patch tested?
    Todo: add more test cases for ensuring the coverage.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gatorsmile/spark nameValidation

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/12618.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #12618
    
----
commit 1ca5fccc1ab92e6a26cef1ae424cce98a4761c30
Author: gatorsmile <ga...@gmail.com>
Date:   2016-04-21T12:23:50Z

    fix.

commit 6f9143c1e9a46f7442106a159841158e266574bc
Author: gatorsmile <ga...@gmail.com>
Date:   2016-04-21T17:48:04Z

    rollback

commit 2696f8e69fbc0f31e49c2f00a2d771948be9a4b6
Author: gatorsmile <ga...@gmail.com>
Date:   2016-04-22T16:57:29Z

    Merge remote-tracking branch 'upstream/master' into nameValidation

commit 56f25b17b727c835869996e739315c65c27b1b0c
Author: gatorsmile <ga...@gmail.com>
Date:   2016-04-22T17:23:27Z

    code cleaning

commit ea977c1a41ac4be40b9d000bcf12745fe439fe96
Author: gatorsmile <ga...@gmail.com>
Date:   2016-04-22T19:49:02Z

    Also enforce checking in SessionCatalog

commit f2d6ad7d5b5715642df20819fb9f63a89fa03ef0
Author: gatorsmile <ga...@gmail.com>
Date:   2016-04-22T20:14:28Z

    remove unnecessary test case.

----


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61499/
    Test PASSed.


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    **[Test build #61202 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61202/consoleFull)** for PR 12618 at commit [`54a7fc4`](https://github.com/apache/spark/commit/54a7fc4ef590e6d5c7c4a4e29d176546a06e7767).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218036052
  
    **[Test build #58194 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58194/consoleFull)** for PR 12618 at commit [`8e6ef75`](https://github.com/apache/spark/commit/8e6ef756eeeea9553df627f389a98f6a952a5bb9).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-214120097
  
    Merged build finished. Test FAILed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r62550663
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -93,6 +95,41 @@ class SessionCatalog(
       }
     
       /**
    +   * Checks if the given name conforms the Hive standard ("[a-zA-z_0-9]+"),
    +   * i.e. if this name only contains characters, numbers, and _.
    +   *
    +   * This method is intended to have the same behavior of
    +   * org.apache.hadoop.hive.metastore.MetaStoreUtils.validateName.
    +   */
    +  protected[this] def validateName(name: String): Boolean = {
    +    validName.pattern.matcher(name).matches()
    +  }
    +
    +  /**
    +   * Validate database names
    +   */
    +  def validateDatabaseName(dbName: Option[String]): Unit = {
    --- End diff --
    
    this one isn't very useful... I would just remove it.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] [WIP] Table/Database Name ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213601352
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/56730/
    Test PASSed.


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    **[Test build #60859 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60859/consoleFull)** for PR 12618 at commit [`fa9272e`](https://github.com/apache/spark/commit/fa9272ed308c16310b4c780b51beb7e123ac8df3).


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r65272254
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -190,7 +247,7 @@ class SessionCatalog(
        * by users.
        */
       def getDefaultDBPath(db: String): String = {
    -    val database = formatDatabaseName(db)
    +    val database = formatDatabaseName(db, nameCheck = false)
    --- End diff --
    
    why false in all these places?


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r65272047
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -71,6 +71,8 @@ class SessionCatalog(
       @GuardedBy("this")
       protected val tempTables = new mutable.HashMap[String, LogicalPlan]
     
    +  protected[this] val validName = "([\\w_]+)".r
    --- End diff --
    
    private. Please keep as many things private as possible


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-220752109
  
    **[Test build #59056 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59056/consoleFull)** for PR 12618 at commit [`24de533`](https://github.com/apache/spark/commit/24de533367037e4fe188ec71bcd0466f96389b2c).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218660290
  
    @hvanhovell Could you check if the latest changes resolve all your comments? 


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-217561687
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-219325097
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r62598308
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -93,6 +95,41 @@ class SessionCatalog(
       }
     
       /**
    +   * Checks if the given name conforms the Hive standard ("[a-zA-z_0-9]+"),
    +   * i.e. if this name only contains characters, numbers, and _.
    +   *
    +   * This method is intended to have the same behavior of
    +   * org.apache.hadoop.hive.metastore.MetaStoreUtils.validateName.
    +   */
    +  protected[this] def validateName(name: String): Boolean = {
    +    validName.pattern.matcher(name).matches()
    +  }
    +
    +  /**
    +   * Validate database names
    +   */
    +  def validateDatabaseName(dbName: Option[String]): Unit = {
    +    if (dbName.isDefined) validateDatabaseName(dbName.get)
    +  }
    +
    +  def validateDatabaseName(dbName: String): Unit = {
    +    if (!validateName(dbName)) {
    +      throw new AnalysisException(s"Database name '$dbName' is not a valid name. " +
    +        s"Valid database names only contain characters, numbers and _.")
    +    }
    +  }
    +
    +  /**
    +   * Validate table names
    +   */
    --- End diff --
    
    Sure, will do it.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218068414
  
    **[Test build #58212 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58212/consoleFull)** for PR 12618 at commit [`a4b2622`](https://github.com/apache/spark/commit/a4b2622c2e11d212931b47af81c19aebfcd01dfa).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218047607
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58194/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r62550588
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -93,6 +95,41 @@ class SessionCatalog(
       }
     
       /**
    +   * Checks if the given name conforms the Hive standard ("[a-zA-z_0-9]+"),
    +   * i.e. if this name only contains characters, numbers, and _.
    +   *
    +   * This method is intended to have the same behavior of
    +   * org.apache.hadoop.hive.metastore.MetaStoreUtils.validateName.
    +   */
    +  protected[this] def validateName(name: String): Boolean = {
    --- End diff --
    
    why is this protected? They should all be strictly `private`


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-214132079
  
    **[Test build #56880 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56880/consoleFull)** for PR 12618 at commit [`57ac708`](https://github.com/apache/spark/commit/57ac7086647670d2d6c74bfced898b6b5f3bb8eb).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r60842416
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -78,29 +78,66 @@ class SessionCatalog(
         if (conf.caseSensitiveAnalysis) name else name.toLowerCase
       }
     
    +  /**
    +   * Validate names
    +   */
    +  protected[this] def validateName(name: String): Boolean = {
    +    val validName = "([_A-Za-z0-9]+)".r
    --- End diff --
    
    This compiles a regex every time the method gets invoked. Can you move this into an object or the class body?


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r60824199
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -78,29 +78,66 @@ class SessionCatalog(
         if (conf.caseSensitiveAnalysis) name else name.toLowerCase
       }
     
    +  /**
    +   * Validate names
    +   */
    +  protected[this] def validateName(name: String): Boolean = {
    +    val validName = "([_A-Za-z0-9]*)".r
    --- End diff --
    
    Hi, @gatorsmile . This should be `"([_A-Za-z0-9]+)".r`.



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


[GitHub] spark pull request: [SPARK-14857] [SQL] [WIP] Table/Database Name ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213600958
  
    **[Test build #56730 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56730/consoleFull)** for PR 12618 at commit [`995f407`](https://github.com/apache/spark/commit/995f4070231f4ae02bdcf4e6cf84dd20191b1c33).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r62707415
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -365,7 +421,9 @@ class SessionCatalog(
       def lookupRelation(name: TableIdentifier, alias: Option[String] = None): LogicalPlan = {
         synchronized {
           val db = formatDatabaseName(name.database.getOrElse(currentDb))
    +      validateDatabaseName(db)
    --- End diff --
    
    Sure, let me try to combine them with an extra flag.


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    **[Test build #61202 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61202/consoleFull)** for PR 12618 at commit [`54a7fc4`](https://github.com/apache/spark/commit/54a7fc4ef590e6d5c7c4a4e29d176546a06e7767).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] [WIP] Table/Database Name ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213577101
  
    Merged build finished. Test FAILed.


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    **[Test build #60859 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60859/consoleFull)** for PR 12618 at commit [`fa9272e`](https://github.com/apache/spark/commit/fa9272ed308c16310b4c780b51beb7e123ac8df3).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/12618
  
    @gatorsmile Why don't we do name validation in so many places? Many of them don't seem to have anything to do with specifying datasource paths. Can you try to keep the behavior as consistent as possible? (If there are valid reasons for `nameCheck = false` then we should add a comment)


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-217561689
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58024/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by yhuai <gi...@git.apache.org>.
Github user yhuai commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218048161
  
    Yea, let's be consistent on what we allow for table and db names. We have a utility function `CreateDataSourceTableUtils.validateName`, which does the same check as hive.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r65271997
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -293,19 +345,18 @@ class SessionCatalog(
           holdDDLTime: Boolean,
           inheritTableSpecs: Boolean,
           isSkewedStoreAsSubdir: Boolean): Unit = {
    -    val db = formatDatabaseName(name.database.getOrElse(getCurrentDatabase))
    -    val table = formatTableName(name.table)
    +    val (db, table) = formatTableName(name)
         requireDbExists(db)
         requireTableExists(TableIdentifier(table, Some(db)))
         externalCatalog.loadPartition(db, table, loadPath, partition, isOverwrite, holdDDLTime,
           inheritTableSpecs, isSkewedStoreAsSubdir)
       }
     
       def defaultTablePath(tableIdent: TableIdentifier): String = {
    -    val dbName = formatDatabaseName(tableIdent.database.getOrElse(getCurrentDatabase))
    -    val dbLocation = getDatabaseMetadata(dbName).locationUri
    +    val (db, table) = formatTableName(tableIdent, nameCheck = false)
    --- End diff --
    
    why false here?


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r62641866
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -130,19 +158,29 @@ class SessionCatalog(
         if (dbName == "default") {
           throw new AnalysisException(s"Can not drop default database")
         }
    +    validateDatabaseName(dbName)
         externalCatalog.dropDatabase(dbName, ignoreIfNotExists, cascade)
       }
     
       def alterDatabase(dbDefinition: CatalogDatabase): Unit = {
         val dbName = formatDatabaseName(dbDefinition.name)
    +    validateDatabaseName(dbName)
         externalCatalog.alterDatabase(dbDefinition.copy(name = dbName))
       }
     
       def getDatabaseMetadata(db: String): CatalogDatabase = {
         val dbName = formatDatabaseName(db)
    +    validateDatabaseName(dbName)
         externalCatalog.getDatabase(dbName)
       }
     
    + /**
    +  * Return whether a database with the specified name exists.
    +  *
    +  * We do not validate if names are following the naming rules when checking if database exists.
    --- End diff --
    
    This is more a comment than documentation. Move it into the method?


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218371327
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218047605
  
    Merged build finished. Test PASSed.


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    uh, sorry for the late response. Will do it ASAP. Thanks!


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    **[Test build #61499 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61499/consoleFull)** for PR 12618 at commit [`54a7fc4`](https://github.com/apache/spark/commit/54a7fc4ef590e6d5c7c4a4e29d176546a06e7767).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-214164002
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/56880/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218371154
  
    **[Test build #58325 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58325/consoleFull)** for PR 12618 at commit [`3788e86`](https://github.com/apache/spark/commit/3788e86830c0608c064eb421f34d565d110649f1).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by hvanhovell <gi...@git.apache.org>.
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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-221123110
  
    retest this please


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218083872
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58212/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-214163999
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-214119972
  
    **[Test build #56869 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56869/consoleFull)** for PR 12618 at commit [`55dd8f4`](https://github.com/apache/spark/commit/55dd8f491dcc8548b23bcdcc3eac45f223a3795f).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-214100543
  
    **[Test build #56869 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56869/consoleFull)** for PR 12618 at commit [`55dd8f4`](https://github.com/apache/spark/commit/55dd8f491dcc8548b23bcdcc3eac45f223a3795f).


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60859/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-220751991
  
    retest this please


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-222338094
  
    **[Test build #59571 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59571/consoleFull)** for PR 12618 at commit [`fa9272e`](https://github.com/apache/spark/commit/fa9272ed308c16310b4c780b51beb7e123ac8df3).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    **[Test build #61499 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61499/consoleFull)** for PR 12618 at commit [`54a7fc4`](https://github.com/apache/spark/commit/54a7fc4ef590e6d5c7c4a4e29d176546a06e7767).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r60842882
  
    --- 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)
    --- End diff --
    
    `super.validateName(Name)`? I don't think we need this - we are not using its results anyway.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r60828506
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -78,29 +78,66 @@ class SessionCatalog(
         if (conf.caseSensitiveAnalysis) name else name.toLowerCase
       }
     
    +  /**
    +   * Validate names
    +   */
    +  protected[this] def validateName(name: String): Boolean = {
    +    val validName = "([_A-Za-z0-9]*)".r
    --- End diff --
    
    Thanks for catching it! Although the name `___` is weird, but it is allowable. Any reason we should stop users using it?


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213946062
  
    @gatorsmile this looks pretty solid. I have one question though. Do we want to restrain all table and database names used in a catalog to just alphanumeric characters and underscores? Or just those we use in the Hive metastore/catalog?
    
    @yhuai any thoughts about this?


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-222338132
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r62550699
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -93,6 +95,41 @@ class SessionCatalog(
       }
     
       /**
    +   * Checks if the given name conforms the Hive standard ("[a-zA-z_0-9]+"),
    +   * i.e. if this name only contains characters, numbers, and _.
    +   *
    +   * This method is intended to have the same behavior of
    +   * org.apache.hadoop.hive.metastore.MetaStoreUtils.validateName.
    +   */
    +  protected[this] def validateName(name: String): Boolean = {
    +    validName.pattern.matcher(name).matches()
    +  }
    +
    +  /**
    +   * Validate database names
    +   */
    +  def validateDatabaseName(dbName: Option[String]): Unit = {
    +    if (dbName.isDefined) validateDatabaseName(dbName.get)
    +  }
    +
    +  def validateDatabaseName(dbName: String): Unit = {
    +    if (!validateName(dbName)) {
    +      throw new AnalysisException(s"Database name '$dbName' is not a valid name. " +
    +        s"Valid database names only contain characters, numbers and _.")
    +    }
    +  }
    +
    +  /**
    +   * Validate table names
    +   */
    --- End diff --
    
    can you delete this comment; it doesn't add any value


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-217561447
  
    **[Test build #58024 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58024/consoleFull)** for PR 12618 at commit [`2131252`](https://github.com/apache/spark/commit/213125253319b07bb63a910c4bc422c7f4617e16).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] [WIP] Table/Database Name ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213577072
  
    **[Test build #56729 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56729/consoleFull)** for PR 12618 at commit [`f2d6ad7`](https://github.com/apache/spark/commit/f2d6ad7d5b5715642df20819fb9f63a89fa03ef0).
     * This patch **fails MiMa tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-214948316
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/57065/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213756371
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/56800/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213678647
  
    Merged build finished. Test PASSed.


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    retest this please


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218360331
  
    **[Test build #58325 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58325/consoleFull)** for PR 12618 at commit [`3788e86`](https://github.com/apache/spark/commit/3788e86830c0608c064eb421f34d565d110649f1).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r65272406
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -759,15 +804,15 @@ class SessionCatalog(
       }
     
       protected def failFunctionLookup(name: String): Nothing = {
    -    throw new NoSuchFunctionException(db = currentDb, func = name)
    +    throw new NoSuchFunctionException(db = getCurrentDatabase, func = name)
    --- End diff --
    
    why change these?


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


[GitHub] spark pull request: [SPARK-14857] [SQL] [WIP] Table/Database Name ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213576407
  
    **[Test build #56730 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56730/consoleFull)** for PR 12618 at commit [`995f407`](https://github.com/apache/spark/commit/995f4070231f4ae02bdcf4e6cf84dd20191b1c33).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218371328
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58325/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] [WIP] Table/Database Name ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213577103
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/56729/
    Test FAILed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r60842896
  
    --- 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. " +
    +        s"Metastore only accepts database name containing characters, numbers and _.")
    +    }
    +  }
    +
    +  override def validateTableName(tableName: String): Unit = {
    +    if (!validateName(tableName)) {
    +      throw new AnalysisException(s"Table name '$tableName' is not a valid name for metastore. " +
    --- End diff --
    
    Same here.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r60846156
  
    --- 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 --
    
    Yeah, I can remove them. To external users, they do not care it. : )


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-214948104
  
    **[Test build #57065 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/57065/consoleFull)** for PR 12618 at commit [`9d7c8b2`](https://github.com/apache/spark/commit/9d7c8b20bd5aaccfae0014042f35e7cfebb5e598).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r62642250
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -387,6 +445,10 @@ class SessionCatalog(
        * exists in that particular database instead. In that case, even if there is a temporary
        * table with the same name, we will return false if the specified database does not
        * contain the table.
    +   *
    +   * We do not validate if names are following the naming rules when checking if table exists.
    --- End diff --
    
    Move this into a comment.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218050854
  
    This PR removes `CreateDataSourceTableUtils.validateName`. We move it to `SessionCatalog`. Let me know if we need to make any change here. 
    
    Thanks! @yhuai @andrewor14 


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r62707441
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -130,19 +158,29 @@ class SessionCatalog(
         if (dbName == "default") {
           throw new AnalysisException(s"Can not drop default database")
         }
    +    validateDatabaseName(dbName)
         externalCatalog.dropDatabase(dbName, ignoreIfNotExists, cascade)
       }
     
       def alterDatabase(dbDefinition: CatalogDatabase): Unit = {
         val dbName = formatDatabaseName(dbDefinition.name)
    +    validateDatabaseName(dbName)
         externalCatalog.alterDatabase(dbDefinition.copy(name = dbName))
       }
     
       def getDatabaseMetadata(db: String): CatalogDatabase = {
         val dbName = formatDatabaseName(db)
    +    validateDatabaseName(dbName)
         externalCatalog.getDatabase(dbName)
       }
     
    + /**
    +  * Return whether a database with the specified name exists.
    +  *
    +  * We do not validate if names are following the naming rules when checking if database exists.
    --- End diff --
    
    Yeah, will do. 


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-221138381
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r62598323
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -93,6 +95,41 @@ class SessionCatalog(
       }
     
       /**
    +   * Checks if the given name conforms the Hive standard ("[a-zA-z_0-9]+"),
    +   * i.e. if this name only contains characters, numbers, and _.
    +   *
    +   * This method is intended to have the same behavior of
    +   * org.apache.hadoop.hive.metastore.MetaStoreUtils.validateName.
    +   */
    +  protected[this] def validateName(name: String): Boolean = {
    +    validName.pattern.matcher(name).matches()
    +  }
    +
    +  /**
    +   * Validate database names
    +   */
    +  def validateDatabaseName(dbName: Option[String]): Unit = {
    --- End diff --
    
    Sure will do it. Thanks!


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213667639
  
    **[Test build #56781 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56781/consoleFull)** for PR 12618 at commit [`bfe536e`](https://github.com/apache/spark/commit/bfe536eaba938be18253aeb71eb79a56f69856ce).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213743088
  
    @hvanhovell It is ready to review. Thanks!
    
    This is partially related to what we discussed in https://github.com/apache/spark/pull/12537


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213678602
  
    **[Test build #56781 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56781/consoleFull)** for PR 12618 at commit [`bfe536e`](https://github.com/apache/spark/commit/bfe536eaba938be18253aeb71eb79a56f69856ce).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    Merged build finished. Test PASSed.


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-219325051
  
    **[Test build #58622 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58622/consoleFull)** for PR 12618 at commit [`24de533`](https://github.com/apache/spark/commit/24de533367037e4fe188ec71bcd0466f96389b2c).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-214931161
  
    **[Test build #57065 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/57065/consoleFull)** for PR 12618 at commit [`9d7c8b2`](https://github.com/apache/spark/commit/9d7c8b20bd5aaccfae0014042f35e7cfebb5e598).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r65272201
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -164,8 +215,14 @@ class SessionCatalog(
         externalCatalog.getDatabase(dbName)
       }
     
    + /**
    +  * Return whether a database with the specified name exists.
    +  */
       def databaseExists(db: String): Boolean = {
    -    val dbName = formatDatabaseName(db)
    +   // We do not validate if names are following the naming rules when checking if database exists.
    +   // Running SQL on files directly could break the rules. For example,
    +   //   select id from `org.apache.spark.sql.parquet`.`path/to/parquet/files` as p
    --- End diff --
    
    bad indentation


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218083672
  
    **[Test build #58212 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58212/consoleFull)** for PR 12618 at commit [`a4b2622`](https://github.com/apache/spark/commit/a4b2622c2e11d212931b47af81c19aebfcd01dfa).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-217952310
  
    > Do we want to restrain all table and database names used in a catalog to just alphanumeric characters and underscores? Or just those we use in the Hive metastore/catalog?
    
    It's probably better to be consistent


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-220758879
  
    **[Test build #59056 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59056/consoleFull)** for PR 12618 at commit [`24de533`](https://github.com/apache/spark/commit/24de533367037e4fe188ec71bcd0466f96389b2c).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request #12618: [SPARK-14857] [SQL] Table/Database Name Validatio...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile closed the pull request at:

    https://github.com/apache/spark/pull/12618


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-214948315
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213756118
  
    **[Test build #56800 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56800/consoleFull)** for PR 12618 at commit [`d7532d4`](https://github.com/apache/spark/commit/d7532d422ed202fae5ab1334577bce7689ed2dea).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r60846142
  
    --- 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)
    --- End diff --
    
    Ok, will remove it. My original idea is to enforce the name validation rules of Spark, even if, in the future, the `MetaStoreUtils.validateName` has different rules.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-214163860
  
    **[Test build #56880 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56880/consoleFull)** for PR 12618 at commit [`57ac708`](https://github.com/apache/spark/commit/57ac7086647670d2d6c74bfced898b6b5f3bb8eb).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-217542372
  
    **[Test build #58024 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58024/consoleFull)** for PR 12618 at commit [`2131252`](https://github.com/apache/spark/commit/213125253319b07bb63a910c4bc422c7f4617e16).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] [WIP] Table/Database Name ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213575373
  
    **[Test build #56729 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56729/consoleFull)** for PR 12618 at commit [`f2d6ad7`](https://github.com/apache/spark/commit/f2d6ad7d5b5715642df20819fb9f63a89fa03ef0).


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    The changes in this PR becomes completely out-of-dated. Will resubmit a new PR for it. Thanks!


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-221138243
  
    **[Test build #59161 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59161/consoleFull)** for PR 12618 at commit [`24de533`](https://github.com/apache/spark/commit/24de533367037e4fe188ec71bcd0466f96389b2c).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213678648
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/56781/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r65272233
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -180,7 +237,7 @@ class SessionCatalog(
       def getCurrentDatabase: String = synchronized { currentDb }
     
       def setCurrentDatabase(db: String): Unit = {
    -    val dbName = formatDatabaseName(db)
    +    val dbName = formatDatabaseName(db, nameCheck = false)
    --- End diff --
    
    why false here?


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r62642222
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -365,7 +421,9 @@ class SessionCatalog(
       def lookupRelation(name: TableIdentifier, alias: Option[String] = None): LogicalPlan = {
         synchronized {
           val db = formatDatabaseName(name.database.getOrElse(currentDb))
    +      validateDatabaseName(db)
    --- End diff --
    
    MINOR: So `formatDatabaseName` and `validateDatabaseName` are used alot together. Shouldn't they be in the same method? Same goes for `formatTableName` and `validateTableName`.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-219317682
  
    **[Test build #58622 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58622/consoleFull)** for PR 12618 at commit [`24de533`](https://github.com/apache/spark/commit/24de533367037e4fe188ec71bcd0466f96389b2c).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-221138384
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59161/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-217952164
  
    Looks OK


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218083870
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-221123850
  
    **[Test build #59161 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59161/consoleFull)** for PR 12618 at commit [`24de533`](https://github.com/apache/spark/commit/24de533367037e4fe188ec71bcd0466f96389b2c).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-220758921
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59056/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213743041
  
    **[Test build #56800 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56800/consoleFull)** for PR 12618 at commit [`d7532d4`](https://github.com/apache/spark/commit/d7532d422ed202fae5ab1334577bce7689ed2dea).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213756370
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-218047473
  
    **[Test build #58194 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58194/consoleFull)** for PR 12618 at commit [`8e6ef75`](https://github.com/apache/spark/commit/8e6ef756eeeea9553df627f389a98f6a952a5bb9).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r60842867
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -78,29 +78,66 @@ class SessionCatalog(
         if (conf.caseSensitiveAnalysis) name else name.toLowerCase
       }
     
    +  /**
    +   * Validate names
    +   */
    +  protected[this] def validateName(name: String): Boolean = {
    +    val validName = "([_A-Za-z0-9]+)".r
    --- End diff --
    
    Minor: `"[\w_]+"` is shorter.... `MetaStoreUtils.validateName` also uses this.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r65272445
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -849,7 +894,7 @@ class SessionCatalog(
        * List all matching functions in the specified database, including temporary functions.
        */
       def listFunctions(db: String, pattern: String): Seq[FunctionIdentifier] = {
    -    val dbName = formatDatabaseName(db)
    +    val dbName = formatDatabaseName(db, nameCheck = false)
    --- End diff --
    
    why false here


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r60846069
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -78,29 +78,66 @@ class SessionCatalog(
         if (conf.caseSensitiveAnalysis) name else name.toLowerCase
       }
     
    +  /**
    +   * Validate names
    +   */
    +  protected[this] def validateName(name: String): Boolean = {
    +    val validName = "([_A-Za-z0-9]+)".r
    --- End diff --
    
    Sure, will do it!


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r60824241
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -78,29 +78,66 @@ class SessionCatalog(
         if (conf.caseSensitiveAnalysis) name else name.toLowerCase
       }
     
    +  /**
    +   * Validate names
    +   */
    +  protected[this] def validateName(name: String): Boolean = {
    +    val validName = "([_A-Za-z0-9]*)".r
    --- End diff --
    
    Hmm. Mine also seems not enough since it still allows a strange name like `___`. I'm sure you'll find a good pattern for this. :)


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


[GitHub] spark pull request: [SPARK-14857] [SQL] [WIP] Table/Database Name ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-213601348
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-214100950
  
    @hvanhovell @yhuai I hit and address a related issue. 
    
    Running SQL on files directly could break the rules. For example,
    ```SQL
      select id from `org.apache.spark.sql.parquet`.`path/to/parquet/files` as p
    ```
    
    This was resolved by an `Analyzer` rule: `ResolveDataSource`. Thus, it should not exist after finishing `Analyzer`. Thus, it is ok to keep enforcing the existing naming rule, if we do not validate the names in `databaseExists` and `tableExists`. 


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-222338133
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59571/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-220758920
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r62707458
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -387,6 +445,10 @@ class SessionCatalog(
        * exists in that particular database instead. In that case, even if there is a temporary
        * table with the same name, we will return false if the specified database does not
        * contain the table.
    +   *
    +   * We do not validate if names are following the naming rules when checking if table exists.
    --- End diff --
    
    Yeah, will do. Thanks!


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61202/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r65272109
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -87,19 +89,68 @@ class SessionCatalog(
     
       /**
        * Format table name, taking into account case sensitivity.
    +   * Verify the name validity if nameCheck is true.
    +   */
    +  protected[this] def formatTableName(
    +      name: TableIdentifier,
    +      nameCheck: Boolean = true): (String, String) = {
    --- End diff --
    
    need to comment on what is returned


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-219325105
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58622/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-222335855
  
    **[Test build #59571 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59571/consoleFull)** for PR 12618 at commit [`fa9272e`](https://github.com/apache/spark/commit/fa9272ed308c16310b4c780b51beb7e123ac8df3).


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12618#issuecomment-214120098
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/56869/
    Test FAILed.


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


[GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12618#discussion_r62598343
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -93,6 +95,41 @@ class SessionCatalog(
       }
     
       /**
    +   * Checks if the given name conforms the Hive standard ("[a-zA-z_0-9]+"),
    +   * i.e. if this name only contains characters, numbers, and _.
    +   *
    +   * This method is intended to have the same behavior of
    +   * org.apache.hadoop.hive.metastore.MetaStoreUtils.validateName.
    +   */
    +  protected[this] def validateName(name: String): Boolean = {
    --- End diff --
    
    Sure, will do this. Thanks!


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


[GitHub] spark issue #12618: [SPARK-14857] [SQL] Table/Database Name Validation in Se...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/12618
  
    Could you please review this PR again? @andrewor14 @hvanhovell @yhuai  Thank you!


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