Return-Path: X-Original-To: apmail-spark-reviews-archive@minotaur.apache.org Delivered-To: apmail-spark-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F238D197E0 for ; Sun, 24 Apr 2016 11:15:13 +0000 (UTC) Received: (qmail 50609 invoked by uid 500); 24 Apr 2016 11:15:13 -0000 Delivered-To: apmail-spark-reviews-archive@spark.apache.org Received: (qmail 50583 invoked by uid 500); 24 Apr 2016 11:15:13 -0000 Mailing-List: contact reviews-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@spark.apache.org Received: (qmail 50569 invoked by uid 99); 24 Apr 2016 11:15:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Apr 2016 11:15:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BAED8DFD7B; Sun, 24 Apr 2016 11:15:12 +0000 (UTC) From: hvanhovell To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org References: In-Reply-To: Subject: [GitHub] spark pull request: [SPARK-14857] [SQL] Table/Database Name Valida... Content-Type: text/plain Message-Id: <20160424111512.BAED8DFD7B@git1-us-west.apache.org> Date: Sun, 24 Apr 2016 11:15:12 +0000 (UTC) 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