Open Yury-Fridlyand opened 1 year ago
getColumnTypeName for timestamp depends whether cursor feature is active
getColumnTypeName
Steps to reproduce the behavior:
curl -s -H 'Content-Type: application/json' -XPUT "http://localhost:9200/date_type_index?pretty" -d '{"mappings": {"properties": {"release_date": {"type": "date" }}}}' curl -s -H 'Content-Type: application/json' -XPOST "http://localhost:9200/date_type_index/_doc?pretty" -d '{"release_date": "2022-11-16"}'
Connection conn = driver.connect(connStr, properties); Statement stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); ResultSet rs = stmt.executeQuery("select * from date_type_index"); ResultSetMetaData rsmd = rs.getMetaData(); String typeName = rsmd.getColumnTypeName("release_date");
typeName
TIMESTAMP
Connection conn = driver.connect(connStr, properties); Statement stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); stmt.setFetchSize(5); ResultSet rs = stmt.executeQuery("select * from date_type_index"); ResultSetMetaData rsmd = rs.getMetaData(); String typeName = rsmd.getColumnTypeName("release_date");
DATE
It should be always timestamp since SQL plugin reports this type:
{ "schema": [ { "name": "release_date", "type": "timestamp" } ], "datarows": [ [ "2022-11-16 00:00:00" ] ], "total": 1, "size": 1, "status": 200 }
main
N/A
Thanks @akuzin1 for reporting that
What is the bug?
getColumnTypeName
for timestamp depends whether cursor feature is activeHow can one reproduce the bug?
Steps to reproduce the behavior:
typeName
isTIMESTAMP
typeName
isDATE
What is the expected behavior?
It should be always timestamp since SQL plugin reports this type:
What is your host/environment?
main
Do you have any screenshots?
N/A
Do you have any additional context?
Thanks @akuzin1 for reporting that