Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-12850

[R] is.nan() evaluates to null on Arrow null values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.0.0
    • 5.0.0
    • R
    • None

    Description

      > is.nan(NA_real_)
      [1] FALSE 
      
      > as.vector(is.nan(Scalar$create(NA_real_)))
      [1] NA
      

      There is a discrepancy here between the FALSE result in R and the null result in Arrow (which results in NA_logical_ when converted to an R vector).

      I don't think the is_nan C++ kernel should change here because this is just a quirk of R. For example, NumPy and pandas is consistent with the Arrow C++:

      > np.isnan(pd.NA)
      <NA>
      

      We could maybe consider adding a boolean option to the is_nan C++ kernel to control whether to consider nulls as NaN.

      Attachments

        Issue Links

          Activity

            People

              icook Ian Cook
              icook Ian Cook
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: