GitHub user gatorsmile opened a pull request: https://github.com/apache/spark/pull/12993
[SPARK-15217] [SQL] Always Case Insensitive in HiveSessionState #### What changes were proposed in this pull request? In a `HiveSessionState`, which is a given `SparkSession` backed by Hive, the analysis should not be case sensitive because the underlying Hive Metastore is case insensitive. For example, ```SQL CREATE TABLE tab1 (C1 int); SELECT C1 FROM tab1 ``` In the current implementation, we will get the following error because the column name is always stored in lower case. ``` cannot resolve '`C1`' given input columns: [c1]; line 1 pos 7 org.apache.spark.sql.AnalysisException: cannot resolve '`C1`' given input columns: [c1]; line 1 pos 7 ``` This PR is to always use case insensitive analysis in `HiveSessionState`, no matter whether users set `spark.sql.caseSensitive` to true or false. #### How was this patch tested? Added the related test cases. You can merge this pull request into a Git repository by running: $ git pull https://github.com/gatorsmile/spark caseSensitive Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/12993.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 #12993 ---- commit d7d96c34fde79d7078b27733f553deda6bb39fd4 Author: gatorsmile <gatorsm...@gmail.com> Date: 2016-05-09T00:35:43Z case insensitive in 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org