[ 
https://issues.apache.org/jira/browse/SPARK-12013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15029140#comment-15029140
 ] 

Xiao Li commented on SPARK-12013:
---------------------------------

I am not sure whether we should add such an interface. Let [~rxin] [~marmbrus] 
give a suggestion.  

IMO, the simplest way is to run the following code. It will return a sequence. 
If needed, you can convert it to an array, by calling toArray
hiveContext.runSqlHive("SHOW DATABASES")




> Add a Hive context method to retrieve the database Names
> --------------------------------------------------------
>
>                 Key: SPARK-12013
>                 URL: https://issues.apache.org/jira/browse/SPARK-12013
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 1.5.2
>            Reporter: Jose Antonio
>            Priority: Minor
>              Labels: features, sql
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> As the HiveContext method tableNames() add a new method to retrieve the 
> database names.
> Currently one hace to make a show databases  and  get a dataframe.colllect()
> This is very slow since it can be queried quickly just by asking the Hive 
> metastore.



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