[Java] Some questions about the metadata api of jdbc
- 主要语言
- Java
- 星标
- 94
- 派生
- 152
- 平均合并
- 3 天 16 小时
- 30 天内合并 PR
- 11
描述
### Describe the usage question you have. Please include as many useful details as possible.
When I call the `getTables` interface, I get an error
```
java.sql.SQLException: Failed to transform VectorSchemaRoot.
at org.apache.arrow.driver.jdbc.ArrowFlightJdbcFlightStreamResultSet.executeForCurrentFlightStream(ArrowFlightJdbcFlightStreamResultSet.java:150)
at org.apache.arrow.driver.jdbc.ArrowFlightJdbcFlightStreamResultSet.execute(ArrowFlightJdbcFlightStreamResultSet.java:139)
at org.apache.arrow.driver.jdbc.ArrowFlightJdbcFlightStreamResultSet.fromFlightInfo(ArrowFlightJdbcFlightStreamResultSet.java:105)
at org.apache.arrow.driver.jdbc.ArrowDatabaseMetadata.getTables(ArrowDatabaseMetadata.java:902)
```
My server returns the result as follows
```
SELECT
TABLE_TENANT as TABLE_CAT,
TABLE_DATABASE as TABLE_SCHEM,
TABLE_NAME,
TABLE_TYPE
FROM
INFORMATION_SCHEMA.TABLES
WHERE TABLE_TENANT = 'cnosdb' AND TABLE_DATABASE LIKE 'public' AND TABLE_NAME LIKE '%' AND TABLE_TYPE IN ('TABLE')
ORDER BY
TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
```
By the code, I found that
- Convert `catalog_name` to `TABLE_CAT` in the `ArrowDatabaseMetadata.getCatalogs` api.
- Convert `db_schema_name` to `TABLE_SCHEM` in the `ArrowDatabaseMetadata.getSchemas` api.
- ......
For the above, can I think that the ResultSet Schema of my `getSchemas` implementation must be `db_schema_name`, `catalog_name` instead of `TABLE_SCHEM`, `TABLE_CATALOG`. The same goes for other API?
### Component(s)
Java
贡献指南
调研方向
从 ArrowDatabaseMetadata.getTables、getSchemas 和 getCatalogs 开始,然后跟踪 ArrowFlightJdbcFlightStreamResultSet.executeForCurrentFlightStream 中的 schema 转换。将返回的列与 JDBC 元数据契约进行比较,并确定 getTables 结果无法转换的原因。完成标准是记录预期的 schema,并确认解决路径。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- api, databases
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100