NaN Values Are Not Supported for Numeric Data Type - Aster R

Teradata Aster® R User GuideUpdate 3

Product
Aster R
Release Number
7.00.02.01
Published
December 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
fop1497542774450.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
fbp1477004286096
lifecycle
previous
Product Category
Software

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