The NaN value is not supported for the numeric data type in Aster ODBC, and, as a result, will return in this error message:
Error in taQuery(queryStr) : HY000 40321 [AsterData][Support] (40321) String value 'NaN' resulted in an invalid numeric.
If users encounter this error message, one of these two methods can be used to resolve the issue:
- Add "as.double = TRUE" to the function call for the SQL based statistics functions (ta.max, ta.colMaxs, ta.min, ta.colMins, ta.sum, ta.colSums, ta.mean, ta.colMeans, ta.rowSums, ta.rowMeans, ta.colVars, and ta.sd). For example:
> ta.sd(tadf, as.double = TRUE) id val 8.225975 NaN
- Add "NumericAndDecimalAsDouble=1" under DSN in the odbc.ini file. For example:
[AsterDSN] Driver=/home/beehive/work/multibranch/build/lib/libAsterDriver.so SERVER=153.65.179.60 PORT=2406 DATABASE=beehive UID=beehive PWD=beehive ByteaAsVarchar=1 NumericAndDecimalAsDouble=1