GitHub user gatorsmile opened a pull request: https://github.com/apache/spark/pull/13283
[SPARK-15515] [SPARK-15514] [SQL] Error Handling in Running SQL Directly On Files #### What changes were proposed in this pull request? This PR is to address the following issues: - **ISSUE 1:** For ORC source format, we are reporting the strange error message when we did not enable Hive support: ```SQL SQL Example: select id from `org.apache.spark.sql.hive.orc`.`file_path` Error Message: Table or view not found: `org.apache.spark.sql.hive.orc`.`file_path` ``` Instead, we should issue the error message like: ``` Desired Error Message: The ORC data source must be used with Hive support enabled ``` - **ISSUE 2:** For the Avro format, we still report the error message like: The example query is like ```SQL SQL Example: select id from `avro`.`file_path` select id from `com.databricks.spark.avro`.`file_path` Error Message: Table or view not found: `com.databricks.spark.avro`.`file_path` ``` The desired message should be like: ``` Desired Error Message: Failed to find data source: avro. Please use Spark package http://sparkpackages.org/package/databricks/spark-avro" ``` - **ISSUE 3:** Unable to detect incompatibility libraries for Spark 2.0 in Data Source Resolution. ```SQL SQL Example: select id from `org.apache.spark.sql.sources.HadoopFsRelationProvider`.`file_path` Error Message: Table or view not found: `org.apache.spark.sql.sources.HadoopFsRelationProvider`.`file_path` ``` The desired message should be like: ``` Desired Error Message: org.apache.spark.sql.sources.HadoopFsRelationProvider is removed in Spark 2.0. Please check if your library is compatible with Spark 2.0 ``` #### How was this patch tested? Added test cases to cover all the above issues You can merge this pull request into a Git repository by running: $ git pull https://github.com/gatorsmile/spark runSQLAgainstFile Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/13283.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 #13283 ---- commit 948340b15e504effcbc160deeb2e859a31714f39 Author: gatorsmile <gatorsm...@gmail.com> Date: 2016-05-24T21:52:01Z fix. ---- --- 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