With the current options we run into errors or undesirable behaviour. In the case where we set missing values to return a default value, it's not clear to the end user whether a value was missing or if it's actually the default value. This is undesirable because the end user can't differentiate between real data and missing data. In the other case where an empty string is returned, when we Scan the Rows returned we hit a conversion error https://cs.opensource.google/go/go/+/refs/tags/go1.20.4:src/database/sql/sql.go;l=3253 if the type of the column isn't a string.
Currently missing values return an empty string or default zero value https://github.com/uber/athenadriver#missing-value-handling, or an error is raised.
Can an additional configuration option be set to allow the user to allow nil values? Something like
Config.SetMissingAsNil(true)
? And addIsMissingAsNil()
here: https://github.com/uber/athenadriver/blob/7f6d139d7c52e8502338c79a5dd4b46b2b5fadde/go/config.go#L301-L308It can be checked here and
return nil, nil
ifdriverConfig.IsMissingAsNil()
is true: https://github.com/uber/athenadriver/blob/7f6d139d7c52e8502338c79a5dd4b46b2b5fadde/go/rows.go#L275With the current options we run into errors or undesirable behaviour. In the case where we set missing values to return a default value, it's not clear to the end user whether a value was missing or if it's actually the default value. This is undesirable because the end user can't differentiate between real data and missing data. In the other case where an empty string is returned, when we
Scan
the Rows returned we hit a conversion error https://cs.opensource.google/go/go/+/refs/tags/go1.20.4:src/database/sql/sql.go;l=3253 if the type of the column isn't astring
.