googleapis / googleapis/google-cloud-java

[java-spanner-jdbc] Spanner: Unknown type: INTERVAL when reading from ResultSet

未关闭
#12,273 0 条评论 0 个 reaction 已指派 1 人 已被 @olavloite 认领 在 GitHub 查看
api: spanner
主要语言
Java
星标
2.1k
派生
1.2k
平均合并
1 天 23 小时
30 天内合并 PR
154

描述

#### Environment details

2. OS type and version: Microsoft Windows [Version 10.0.26100.7171]
3. Java version: openjdk version "21.0.7" 2025-04-15 LTS
4. version(s): I'm working with the spanner emulator: https://github.com/GoogleCloudPlatform/cloud-spanner-emulator and JDBC driver version: `com.google.cloud:google-cloud-spanner-jdbc:2.34.0`

#### Code example

```java
ResultSet rs = connection.createStatement().executeQuery("select interval 1 day");
rs.next();
println(rs.getObject(1).getClass());
```

The same happens when reading the type with `ResultSet::getString`. Internally, a string value is available, and it is in an expected format, so I would assume that at least the string value should be accessible:

Image

#### Stack trace
```
com.google.cloud.spanner.jdbc.JdbcSqlExceptionFactory$JdbcSqlExceptionImpl: INVALID_ARGUMENT: Unknown type: INTERVAL
at com.google.cloud.spanner.jdbc.JdbcSqlExceptionFactory.of(JdbcSqlExceptionFactory.java:247)
at com.google.cloud.spanner.jdbc.JdbcResultSet.getObject(JdbcResultSet.java:837)
at com.google.cloud.spanner.jdbc.JdbcResultSet.getObject(JdbcResultSet.java:796)
at org.jooq.testscripts.JDBC.main(JDBC.java:42)
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。