[jira] [Updated] (CARBONDATA-3696) Avoid list db's all Tables to check if table exists in the db

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (CARBONDATA-3696) Avoid list db's all Tables to check if table exists in the db

Akash R Nilugal (Jira)

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

ShuMing Li updated CARBONDATA-3696:
-----------------------------------
    Description:
I found a lot of `listTables` of the db to check if table exists like this:
{code:java}
sparkSession.sessionState.catalog.listTables(databaseName)
  .exists(_.table.equalsIgnoreCase(tableName){code}
This may affect performances if there are lots of tables in one database.

 

In `spark`, we can check this by `tableExists` function. 

  was:
I found a lot of `listTables` of the db to check if table exists like this:
{code:java}
sparkSession.sessionState.catalog.listTables(databaseName)
  .exists(_.table.equalsIgnoreCase(tableName){code}
This may affect performances if there are lots of tables in one database.

 

In `spark`, we can check this by `tableExists` function.


> Avoid list db's all Tables to check if table exists in the db
> -------------------------------------------------------------
>
>                 Key: CARBONDATA-3696
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-3696
>             Project: CarbonData
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.6.1
>            Reporter: ShuMing Li
>            Priority: Minor
>
> I found a lot of `listTables` of the db to check if table exists like this:
> {code:java}
> sparkSession.sessionState.catalog.listTables(databaseName)
>   .exists(_.table.equalsIgnoreCase(tableName){code}
> This may affect performances if there are lots of tables in one database.
>  
> In `spark`, we can check this by `tableExists` function. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)