New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-11778] [SQL]:parse table name before it is passed to lookupRelation #9773
Conversation
hiveContext.table("db_name.table") works but In hiveContext.table("db_name.table"), it goes through SqlParser.parseTableIdentifier(tableName) In hiveContext.read.table("db_name.table"), it doesn't go through SQLParser to parse the table name, so the table name "db_name.table" remain as is. Later, when trying to get the the qualified table name, the database name resolved as default, and table name is "db_name.table", it can't get the qualified table name correctly. |
Test cases please for any bug fix. Look at |
ok to test |
Test build #46106 has finished for PR 9773 at commit
|
I will add a test case. |
Test build #46242 has finished for PR 9773 at commit
|
If we can get a test case soon we can still include this in Spark 1.6. Also please make the title: |
test case added. Could you please take a look? Thanks a lot!! |
Test build #46279 has finished for PR 9773 at commit
|
Test build #46285 has finished for PR 9773 at commit
|
// There was a bug in DataFrameFrameReader.table and it has problem for table with schema name, | ||
// Before fix, it throw Exceptionorg.apache.spark.sql.catalyst.analysis.NoSuchTableException | ||
test("table name with schema") { | ||
hiveContext.read.table("usrdb.test") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I think I was unclear. I don't think we should put this in HiveDataFrameAnalyticsSuite
since it has nothing to do with analytics. I was just suggesting to use this as a model. Lets just make a separate generic HiveDataFrameSuite
since this is pretty core functionality.
While we are at it. I'm also not a huge fan of using beforeAll and afterAll for test setup for a single test since it means the state is spread out across the file (sorry for the bad example). I would just do it all in the test block.
For the description in the comments, its customary to link to the JIRA.
I'm going to go ahead and merge this since I want it in 1.6. It would be great if you could address comments in a follow up PR. Thanks! |
…tion Fix a bug in DataFrameReader.table (table with schema name such as "db_name.table" doesn't work) Use SqlParser.parseTableIdentifier to parse the table name before lookupRelation. Author: Huaxin Gao <huaxing@oc0558782468.ibm.com> Closes #9773 from huaxingao/spark-11778. (cherry picked from commit 4700074) Signed-off-by: Michael Armbrust <michael@databricks.com>
Fix a bug in DataFrameReader.table (table with schema name such as "db_name.table" doesn't work)
Use SqlParser.parseTableIdentifier to parse the table name before lookupRelation.