Github user huaxingao commented on the pull request:

    https://github.com/apache/spark/pull/9773#issuecomment-157490181
  
    hiveContext.table("db_name.table") works but
    hiveContext.read.table("db_name.table")
    throws an org.apache.spark.sql.catalyst.analysis.NoSuchTableException
    
    In hiveContext.table("db_name.table"), it goes through 
SqlParser.parseTableIdentifier(tableName)
    and the table name "db_name.table" got resolved to 'db_name'.'table', and 
later, when trying to get the the qualified table name, the database name is 
resolved to db_name, and table name is table, and it can get the qualified 
table name OK.
    
    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.


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

Reply via email to