apache/arrow-java
Flight JDBC Driver not setting parameter correctly when parameter type is DATE<MILLISECOND>
オープン
#477 opened on 2025/01/03
Type: bughelp wanted
Repository metrics
- Stars
- (89 個のスター)
- PR merge metrics
- (PR metrics pending)
説明
Describe the bug, including details regarding any error messages, version, and platform.
Arrow Version 17.0.0
When executing a prepared statement using the Arrow Flight JDBC driver, the driver sets the value for date parameters as DAYS since unix epoch, even when the parameter type returned by the server is DATE(MILLISECONDS).
The parameter converter below sets the same value regardless of the type. This results in the server receiving an unexpected parameter value.
Properties props = new Properties();
String connection = "jdbc:arrow-flight-sql://xx:xx/?useEncryption=false";
String query = "select date from T where date = ?";
try (Connection con = DriverManager.getConnection(connection, props);
PreparedStatement ps = con.prepareStatement(query)) {
ps.setDate(1, Date.valueOf(LocalDate.of(2000, 1, 1)), null);
try (ResultSet rs = ps.executeQuery()) {
rs.next();
}
}
Component(s)
Java