aws / aws/amazon-documentdb-jdbc-driver
[BUG] NULL Columns passed as VARCHAR to Calcite, ResultSetMetadata for queries reports NULL columns as VARCHAR
- Dominant language
- Java
- Stars
- 17
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
## Environment
- DocumentDB JDBC driver version: 1.4.4
- DocumentDB server version: n/a
- OS: [e.g. MacOS Big Sur 11.5.1, Windows 10 64-bit]: n/a
- BI Tool or client name: n/a
- BI Tool or client version: n/a
- Java version (if known): n/a
---
## Problem Description
1. Steps to reproduce:
- For SELECT fieldNull where DatabaseMetaData would report fieldNull as NULL, ResultSetMetadata is reporting the same field as VARCHAR when used in a query.
3. Expected behaviour:
- column metadata should report `NULL`
5. Actual behaviour:
- column metadata should report `VARCHAR`
7. Error message/stack trace:
8. Any other details that can be helpful:
- Test that changing the mapping [here](https://github.com/aws/amazon-documentdb-jdbc-driver/blob/b651fc290097a7ce909c9e2e4bf73a70b9058e6f/src/main/java/software/amazon/documentdb/jdbc/calcite/adapter/DocumentDbTable.java#L239) does not break existing tests.
- Test possible effects on cached query results in BI Tools (mainly target Tableau) if we add this fix.
- Confirm that NULL over VARCHAR is the right behaviour for this case.
---
## Screenshots
- If applicable, add screenshots to help explain your problem.
---
## JDBC log
- Add related JDBC log entries here.
Contributor guide
Research direction
Inspect the mapping in src/main/java/software/amazon/documentdb/jdbc/calcite/adapter/DocumentDbTable.java at the linked location, then run the existing test suite to check for regressions. Validate ResultSetMetadata for SELECT fieldNull and consider the stated effects on cached BI-tool results, especially Tableau; done means NULL columns are reported correctly without breaking existing tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100