[ 
https://issues.apache.org/jira/browse/SPARK-17831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Saif Addin Ellafi updated SPARK-17831:
--------------------------------------
    Description: 
So, I am writing a general spark api to use a Hive Metastore.

In case I want to work with temporary tables, I optionally request the client 
to provide a database ("default" if not provided).

The problem is, that if I register a temp table as "default.some_table", the 
table is going to be named exactly "default.some_table" and no such table 
exceptions arise when trying to access such tables from sqlContext.table() or 
sqlContext.isCache().

Workaround is to not provide default keyword but it is proving some unnecessary 
logic: Check if a table is temporary, and if so, not prepend the database name

Any chance this could be fixed to allow storing temporary tables in some 
database? or ignore it at all when trying to access it?

Saif

  was:
So, I am writing a general spark api to use a Hive Metastore.

In case I want to work with temporary tables, I optionally request the client 
to provide a database ("default" if not provided).

The problem is, that if I register a temp table as "default.some_table", the 
table is going to be named exactly "default.some_table" and no such table 
exceptions arise when trying to access such tables from sqlContext.table() or 
sqlContext.isCache().

Workaround is to not provide default keyword but it is proving some unnecessary 
logic.

Any chance this could be fixed to allow storing temporary tables in some 
database? or ignore it at all when trying to access it?

Saif


> registerTempTable is ignoring database clarifications
> -----------------------------------------------------
>
>                 Key: SPARK-17831
>                 URL: https://issues.apache.org/jira/browse/SPARK-17831
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.6.0
>         Environment: Linux
>            Reporter: Saif Addin Ellafi
>            Priority: Minor
>
> So, I am writing a general spark api to use a Hive Metastore.
> In case I want to work with temporary tables, I optionally request the client 
> to provide a database ("default" if not provided).
> The problem is, that if I register a temp table as "default.some_table", the 
> table is going to be named exactly "default.some_table" and no such table 
> exceptions arise when trying to access such tables from sqlContext.table() or 
> sqlContext.isCache().
> Workaround is to not provide default keyword but it is proving some 
> unnecessary logic: Check if a table is temporary, and if so, not prepend the 
> database name
> Any chance this could be fixed to allow storing temporary tables in some 
> database? or ignore it at all when trying to access it?
> Saif



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to