You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Saif Addin Ellafi (JIRA)" <ji...@apache.org> on 2016/10/07 22:02:20 UTC

[jira] [Updated] (SPARK-17831) registerTempTable is ignoring database clarifications

     [ 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org