dosubot[bot] commented on issue #28743:
URL: https://github.com/apache/superset/issues/28743#issuecomment-2136116686
<!-- Greeting -->
@Miosp Hello there! I'm a bot that can help you with bugs, questions, and
contributing. I'm here to assist you while you wait for a human maintainer.
<!-- Answer -->
To resolve the issue where tables are not displayed in the SQL Lab when
connecting Apache Kyuubi to Superset using the Hive connector through PyHive,
ensure that the "Expose database in SQL Lab" option is enabled in the database
settings. This setting allows the database to be queried in SQL Lab.
Here is the relevant code snippet that shows how to enable this option:
```tsx
<IndeterminateCheckbox
id="expose_in_sqllab"
indeterminate={false}
checked={!!db?.expose_in_sqllab}
onChange={onInputChange}
labelText={t('Expose database in SQL Lab')}
/>
<InfoTooltip
tooltip={t('Allow this database to be queried in SQL Lab')}
/>
```
Make sure that the `expose_in_sqllab` property is set to `true` for the
database configuration. This can be done through the Superset UI in the
database settings under the "SQL Lab" section
<sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/src/features/databases/DatabaseModal/ExtraOptions.tsx)</sup>.
Additionally, ensure that the Hive engine specification is correctly
configured in Superset. The `HiveEngineSpec` class in
`superset/db_engine_specs/hive.py` should be properly set up to handle the
connection and data fetching. This includes methods for fetching data, handling
cursor operations, and managing schema and table information. If there are any
issues with the Hive engine specification, it could also lead to tables not
being displayed in SQL Lab
<sup>[[2]](https://github.com/apache/superset/blob/master/superset/db_engine_specs/hive.py)</sup>.
Moreover, Superset handles schema and table caching through properties
defined in the `Database` class. Specifically, it uses the
`metadata_cache_timeout` property to manage cache timeouts for catalog, schema,
and table metadata. These properties are:
- `catalog_cache_enabled` and `catalog_cache_timeout`
- `schema_cache_enabled` and `schema_cache_timeout`
- `table_cache_enabled` and `table_cache_timeout`
These caching mechanisms can affect the visibility of tables in SQL Lab. If
the cache is enabled and the timeout is set, the metadata (including schema and
table information) will be cached for the specified duration. This means that
any changes to the schema or tables in the database may not be immediately
visible in SQL Lab until the cache expires or is refreshed
<sup>[[3]](https://github.com/apache/superset/blob/master/superset/models/core.py)</sup>.
Lastly, there is a known issue with the `SHOW TABLES` command when used with
Apache Kyuubi. Specifically, the `SHOW TABLES` command does not work as
expected with Apache Kyuubi, which might be contributing to the problem
<sup>[[2]](https://github.com/apache/superset/blob/master/superset/db_engine_specs/hive.py)</sup>.
<!-- Dosu Comment Footer -->
<details open>
<summary>
#### Details
</summary>
**About Dosu**
This response is meant to be useful and save you time. It is **not meant to
be a precise solution**, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is
irrelevant.
</details>
*To continue the conversation, mention @dosu.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]