Observed
While working on adding TIME64 support for CDC pipes, we run the following logic to query a table:
rows, rowsErr = ch.Query("select <col1>, <col2>, <col3>, ... from <table>")
row := make([]any, 0, numColumns)
for _, ty:= range colTypes {
row = append(row, reflect.New(ty.ScanType()).Interface())
}
for rows.Next() {
if err := rows.Scan(row...); err != nil {
...
}
}
this is failing with: clickhouse [ScanRow]: (t) converting Time64 to *time.Time is unsupported
I then tried the workaround by scanning it into *time.Duration.
typeName := ty.DatabaseTypeName()
if dbTypeName == "Time64(6)" {
row = append(row, new(time.Duration))
}
It successfully scanned this time, however the precision is in millisecond instead of the expected microseconds. Not sure if this is a bug or if it's an issue in how it's used.
Expected behaviour
- ScanType() should match ScanRow()
- no loss in precision during scan
Code example
see above
Error log
clickhouse [ScanRow]: (t) converting Time64 to *time.Time is unsupported
Details
Environment
Observed
While working on adding TIME64 support for CDC pipes, we run the following logic to query a table:
this is failing with:
clickhouse [ScanRow]: (t) converting Time64 to *time.Time is unsupportedI then tried the workaround by scanning it into
*time.Duration.It successfully scanned this time, however the precision is in millisecond instead of the expected microseconds. Not sure if this is a bug or if it's an issue in how it's used.
Expected behaviour
Code example
see above
Error log
Details
Environment
clickhouse-goversion: 2.42.0database/sqlcompatible driverCREATE TABLEstatements for tables involved: