aws-samples / aws-samples/dbt-glue
dbt-glue fails to find source table in Glue when TableType key not present
- Dominant language
- Python
- Stars
- 147
- Forks
- 96
- Avg merge
- 7h 4m
- Merged PRs (30d)
- 5
Description
### Describe the bug
When a source glue table does not contain the "TableType" key, dbt-glue throws an error when attempting to connect to it:
```
AnalysisException: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fetch table . TableType cannot be null for table:
```
### Steps To Reproduce
1. Create a table in Glue without the TableType key. I am not sure if this can be done manually; however, AWS AppFlow currently leaves out the TableType key when it creates Glue tables.
2. Set this table as a source in dbt
3. call dbt run
### Expected behavior
Glue tables without a TableType key work in Glue, so the adaptor should fall back to some default when this key is not present. For example, the default could be "EXTERNAL_TABLE".
### System information
**The output of `dbt --version`:**
```
Core:
- installed: 1.9.3
- latest: 1.9.3 - Up to date!
Plugins:
- glue: 1.9.2 - Up to date!
- spark: 1.9.2 - Up to date!
```
Windows 11, 64bit
Python 3.13.1
Contributor guide
Research direction
Start by reproducing the failure with dbt run using an AWS Glue source table created without the TableType key, then trace the dbt-glue adapter's source-table handling. Done means the adapter can connect to such a Glue table without the reported TableType cannot be null error; no specific file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100