You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/06/15 20:40:00 UTC

[GitHub] [arrow] nealrichardson opened a new pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

nealrichardson opened a new pull request #7441:
URL: https://github.com/apache/arrow/pull/7441


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] nealrichardson commented on a change in pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

Posted by GitBox <gi...@apache.org>.
nealrichardson commented on a change in pull request #7441:
URL: https://github.com/apache/arrow/pull/7441#discussion_r440978082



##########
File path: r/vignettes/arrow.Rmd
##########
@@ -86,7 +88,73 @@ to other applications and services that use Arrow. One example is Spark: the
 move data to and from Spark, yielding [significant performance
 gains](http://arrow.apache.org/blog/2019/01/25/r-spark-improvements/).
 
-# Class structure and package conventions
+# Internals
+
+## Mapping of R <--> Arrow types
+
+Arrow has a rich data type system that includes direct parallels with R's data types and much more.
+
+In the tables, entries with a `-` are not currently implemented.
+
+### R to Arrow
+
+| R type                   | Arrow type |
+|--------------------------|------------|
+| logical                  | boolean    |
+| integer                  | int32      |
+| double ("numeric")       | float64    |
+| character                | utf8       |
+| factor                   | dictionary |
+| raw                      | uint8      |
+| Date                     | date32     |
+| POSIXct                  | timestamp  |
+| POSIXlt                  | -          |
+| data.frame               | struct     |
+| list^+^                  | list       |
+| bit64::integer64         | int64      |
+| difftime                 | time32     |
+| vctrs::vctrs_unspecified | null       |
+
+^+^: Only lists where all elements are the same type are able to be translated to Arrow list type (which is a "list of" some type).
+
+### Arrow to R
+
+| Arrow type        | R type                   |
+|-------------------|--------------------------|
+| boolean           | logical                  |
+| int8              | integer                  |
+| int16             | integer                  |
+| int32             | integer                  |
+| int64             | bit64::integer64         |
+| uint8             | integer                  |
+| uint16            | integer                  |
+| uint32            | double                   |
+| uint64            | -                        |
+| float16           | -                   |
+| float32           | double                   |
+| float64           | double                   |
+| utf8              | character                |
+| binary            | -                        |
+| fixed_size_binary | -                        |
+| date32            | Date                     |
+| date64            | POSIXct                  |
+| time32            | hms::difftime            |
+| time64            | hms::difftime            |
+| timestamp         | POSIXct                  |
+| duration          | -                        |
+| decimal           | double                   |
+| dictionary        | factor                   |

Review comment:
       I don't understand the question, but I should make a footnote that dictionary values are coerced to string in order to be read as R factor (JIRA outstanding for making that configurable)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] nealrichardson commented on a change in pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

Posted by GitBox <gi...@apache.org>.
nealrichardson commented on a change in pull request #7441:
URL: https://github.com/apache/arrow/pull/7441#discussion_r441079053



##########
File path: r/src/array_to_vector.cpp
##########
@@ -418,6 +418,7 @@ class Converter_Struct : public Converter {
   std::vector<std::shared_ptr<Converter>> converters;
 };
 
+// Shouldn't this cast before dividing? Otherwise we're doing integer division

Review comment:
       I made the change and tests pass, so let's go with it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] nealrichardson closed pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

Posted by GitBox <gi...@apache.org>.
nealrichardson closed pull request #7441:
URL: https://github.com/apache/arrow/pull/7441


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] github-actions[bot] commented on pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #7441:
URL: https://github.com/apache/arrow/pull/7441#issuecomment-644380381


   https://issues.apache.org/jira/browse/ARROW-3446


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] fsaintjacques commented on a change in pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

Posted by GitBox <gi...@apache.org>.
fsaintjacques commented on a change in pull request #7441:
URL: https://github.com/apache/arrow/pull/7441#discussion_r441004282



##########
File path: r/src/array_to_vector.cpp
##########
@@ -418,6 +418,7 @@ class Converter_Struct : public Converter {
   std::vector<std::shared_ptr<Converter>> converters;
 };
 
+// Shouldn't this cast before dividing? Otherwise we're doing integer division

Review comment:
       Correct, you lose the fractional part, but yes we can revise that. I have no preference, it's probably better to preserve precision.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] nealrichardson commented on a change in pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

Posted by GitBox <gi...@apache.org>.
nealrichardson commented on a change in pull request #7441:
URL: https://github.com/apache/arrow/pull/7441#discussion_r441013359



##########
File path: r/vignettes/arrow.Rmd
##########
@@ -86,7 +88,73 @@ to other applications and services that use Arrow. One example is Spark: the
 move data to and from Spark, yielding [significant performance
 gains](http://arrow.apache.org/blog/2019/01/25/r-spark-improvements/).
 
-# Class structure and package conventions
+# Internals
+
+## Mapping of R <--> Arrow types
+
+Arrow has a rich data type system that includes direct parallels with R's data types and much more.
+
+In the tables, entries with a `-` are not currently implemented.
+
+### R to Arrow
+
+| R type                   | Arrow type |
+|--------------------------|------------|
+| logical                  | boolean    |
+| integer                  | int32      |
+| double ("numeric")       | float64    |
+| character                | utf8       |
+| factor                   | dictionary |
+| raw                      | uint8      |
+| Date                     | date32     |
+| POSIXct                  | timestamp  |
+| POSIXlt                  | -          |
+| data.frame               | struct     |
+| list^+^                  | list       |
+| bit64::integer64         | int64      |
+| difftime                 | time32     |
+| vctrs::vctrs_unspecified | null       |
+
+^+^: Only lists where all elements are the same type are able to be translated to Arrow list type (which is a "list of" some type).
+
+### Arrow to R
+
+| Arrow type        | R type                   |
+|-------------------|--------------------------|
+| boolean           | logical                  |
+| int8              | integer                  |
+| int16             | integer                  |
+| int32             | integer                  |
+| int64             | bit64::integer64         |
+| uint8             | integer                  |
+| uint16            | integer                  |
+| uint32            | double                   |

Review comment:
       Perhaps we could. The `bit64::integer64` class we use for int64 only supports signed integers, so `uint32` could fit in that, though `uint64` could not (cf. https://jira.apache.org/jira/browse/ARROW-9031).
   
   I would also like to [pull int64, uint32, and uint64 into an R integer](https://jira.apache.org/jira/browse/ARROW-9083) if they are in bounds (32-bit signed).
   
   In any case, this PR is merely documenting the status quo, so if we want to change uint32 behavior, let's open a new JIRA.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] fsaintjacques commented on a change in pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

Posted by GitBox <gi...@apache.org>.
fsaintjacques commented on a change in pull request #7441:
URL: https://github.com/apache/arrow/pull/7441#discussion_r441010286



##########
File path: r/vignettes/arrow.Rmd
##########
@@ -86,7 +88,73 @@ to other applications and services that use Arrow. One example is Spark: the
 move data to and from Spark, yielding [significant performance
 gains](http://arrow.apache.org/blog/2019/01/25/r-spark-improvements/).
 
-# Class structure and package conventions
+# Internals
+
+## Mapping of R <--> Arrow types
+
+Arrow has a rich data type system that includes direct parallels with R's data types and much more.
+
+In the tables, entries with a `-` are not currently implemented.
+
+### R to Arrow
+
+| R type                   | Arrow type |
+|--------------------------|------------|
+| logical                  | boolean    |
+| integer                  | int32      |
+| double ("numeric")       | float64    |
+| character                | utf8       |
+| factor                   | dictionary |
+| raw                      | uint8      |
+| Date                     | date32     |
+| POSIXct                  | timestamp  |
+| POSIXlt                  | -          |
+| data.frame               | struct     |
+| list^+^                  | list       |
+| bit64::integer64         | int64      |
+| difftime                 | time32     |
+| vctrs::vctrs_unspecified | null       |
+
+^+^: Only lists where all elements are the same type are able to be translated to Arrow list type (which is a "list of" some type).
+
+### Arrow to R
+
+| Arrow type        | R type                   |
+|-------------------|--------------------------|
+| boolean           | logical                  |
+| int8              | integer                  |
+| int16             | integer                  |
+| int32             | integer                  |
+| int64             | bit64::integer64         |
+| uint8             | integer                  |
+| uint16            | integer                  |
+| uint32            | double                   |

Review comment:
       @romainfrancois, why not using the same as int64_t?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] nealrichardson commented on a change in pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

Posted by GitBox <gi...@apache.org>.
nealrichardson commented on a change in pull request #7441:
URL: https://github.com/apache/arrow/pull/7441#discussion_r440976677



##########
File path: r/src/array_to_vector.cpp
##########
@@ -418,6 +418,7 @@ class Converter_Struct : public Converter {
   std::vector<std::shared_ptr<Converter>> converters;
 };
 
+// Shouldn't this cast before dividing? Otherwise we're doing integer division

Review comment:
       I would think we'd be more interested in fidelity of the data transformation than raw speed. Assuming I understand what the operators are doing, isn't `float(1234 / 1000)` a lot different from `float(1234) / 1000`? 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] nealrichardson commented on a change in pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

Posted by GitBox <gi...@apache.org>.
nealrichardson commented on a change in pull request #7441:
URL: https://github.com/apache/arrow/pull/7441#discussion_r440977529



##########
File path: r/vignettes/arrow.Rmd
##########
@@ -86,7 +88,73 @@ to other applications and services that use Arrow. One example is Spark: the
 move data to and from Spark, yielding [significant performance
 gains](http://arrow.apache.org/blog/2019/01/25/r-spark-improvements/).
 
-# Class structure and package conventions
+# Internals
+
+## Mapping of R <--> Arrow types
+
+Arrow has a rich data type system that includes direct parallels with R's data types and much more.
+
+In the tables, entries with a `-` are not currently implemented.
+
+### R to Arrow
+
+| R type                   | Arrow type |
+|--------------------------|------------|
+| logical                  | boolean    |
+| integer                  | int32      |
+| double ("numeric")       | float64    |
+| character                | utf8       |
+| factor                   | dictionary |
+| raw                      | uint8      |
+| Date                     | date32     |
+| POSIXct                  | timestamp  |
+| POSIXlt                  | -          |
+| data.frame               | struct     |
+| list^+^                  | list       |
+| bit64::integer64         | int64      |
+| difftime                 | time32     |
+| vctrs::vctrs_unspecified | null       |
+
+^+^: Only lists where all elements are the same type are able to be translated to Arrow list type (which is a "list of" some type).
+
+### Arrow to R
+
+| Arrow type        | R type                   |
+|-------------------|--------------------------|
+| boolean           | logical                  |
+| int8              | integer                  |
+| int16             | integer                  |
+| int32             | integer                  |
+| int64             | bit64::integer64         |
+| uint8             | integer                  |
+| uint16            | integer                  |
+| uint32            | double                   |

Review comment:
       It's "real" ;) https://github.com/apache/arrow/blob/master/r/src/array_to_vector.cpp#L717-L720




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] nealrichardson commented on a change in pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

Posted by GitBox <gi...@apache.org>.
nealrichardson commented on a change in pull request #7441:
URL: https://github.com/apache/arrow/pull/7441#discussion_r441074458



##########
File path: r/vignettes/arrow.Rmd
##########
@@ -86,7 +88,73 @@ to other applications and services that use Arrow. One example is Spark: the
 move data to and from Spark, yielding [significant performance
 gains](http://arrow.apache.org/blog/2019/01/25/r-spark-improvements/).
 
-# Class structure and package conventions
+# Internals
+
+## Mapping of R <--> Arrow types
+
+Arrow has a rich data type system that includes direct parallels with R's data types and much more.
+
+In the tables, entries with a `-` are not currently implemented.
+
+### R to Arrow
+
+| R type                   | Arrow type |
+|--------------------------|------------|
+| logical                  | boolean    |
+| integer                  | int32      |
+| double ("numeric")       | float64    |
+| character                | utf8       |
+| factor                   | dictionary |
+| raw                      | uint8      |
+| Date                     | date32     |
+| POSIXct                  | timestamp  |
+| POSIXlt                  | -          |
+| data.frame               | struct     |
+| list^+^                  | list       |
+| bit64::integer64         | int64      |
+| difftime                 | time32     |
+| vctrs::vctrs_unspecified | null       |
+
+^+^: Only lists where all elements are the same type are able to be translated to Arrow list type (which is a "list of" some type).
+
+### Arrow to R
+
+| Arrow type        | R type                   |
+|-------------------|--------------------------|
+| boolean           | logical                  |
+| int8              | integer                  |
+| int16             | integer                  |
+| int32             | integer                  |
+| int64             | bit64::integer64         |
+| uint8             | integer                  |
+| uint16            | integer                  |
+| uint32            | double                   |

Review comment:
       Expanded https://jira.apache.org/jira/browse/ARROW-9083 to cover uint{32,64}. I'm going to proceed with this PR as is and will happily revise the docs if we change the implementation. 
   
   Thanks for the discussion--shining a light on things like this is a big reason I picked up the documentation task.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] fsaintjacques commented on a change in pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

Posted by GitBox <gi...@apache.org>.
fsaintjacques commented on a change in pull request #7441:
URL: https://github.com/apache/arrow/pull/7441#discussion_r440846641



##########
File path: r/vignettes/arrow.Rmd
##########
@@ -86,7 +88,73 @@ to other applications and services that use Arrow. One example is Spark: the
 move data to and from Spark, yielding [significant performance
 gains](http://arrow.apache.org/blog/2019/01/25/r-spark-improvements/).
 
-# Class structure and package conventions
+# Internals
+
+## Mapping of R <--> Arrow types
+
+Arrow has a rich data type system that includes direct parallels with R's data types and much more.
+
+In the tables, entries with a `-` are not currently implemented.
+
+### R to Arrow
+
+| R type                   | Arrow type |
+|--------------------------|------------|
+| logical                  | boolean    |
+| integer                  | int32      |
+| double ("numeric")       | float64    |
+| character                | utf8       |
+| factor                   | dictionary |
+| raw                      | uint8      |
+| Date                     | date32     |
+| POSIXct                  | timestamp  |
+| POSIXlt                  | -          |
+| data.frame               | struct     |
+| list^+^                  | list       |
+| bit64::integer64         | int64      |
+| difftime                 | time32     |
+| vctrs::vctrs_unspecified | null       |
+
+^+^: Only lists where all elements are the same type are able to be translated to Arrow list type (which is a "list of" some type).
+
+### Arrow to R
+
+| Arrow type        | R type                   |
+|-------------------|--------------------------|
+| boolean           | logical                  |
+| int8              | integer                  |
+| int16             | integer                  |
+| int32             | integer                  |
+| int64             | bit64::integer64         |
+| uint8             | integer                  |
+| uint16            | integer                  |
+| uint32            | double                   |

Review comment:
       I'm curious about the double, is it a copy-paste error, or does it really cast to double.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] fsaintjacques commented on a change in pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

Posted by GitBox <gi...@apache.org>.
fsaintjacques commented on a change in pull request #7441:
URL: https://github.com/apache/arrow/pull/7441#discussion_r441010615



##########
File path: r/vignettes/arrow.Rmd
##########
@@ -86,7 +88,73 @@ to other applications and services that use Arrow. One example is Spark: the
 move data to and from Spark, yielding [significant performance
 gains](http://arrow.apache.org/blog/2019/01/25/r-spark-improvements/).
 
-# Class structure and package conventions
+# Internals
+
+## Mapping of R <--> Arrow types
+
+Arrow has a rich data type system that includes direct parallels with R's data types and much more.
+
+In the tables, entries with a `-` are not currently implemented.
+
+### R to Arrow
+
+| R type                   | Arrow type |
+|--------------------------|------------|
+| logical                  | boolean    |
+| integer                  | int32      |
+| double ("numeric")       | float64    |
+| character                | utf8       |
+| factor                   | dictionary |
+| raw                      | uint8      |
+| Date                     | date32     |
+| POSIXct                  | timestamp  |
+| POSIXlt                  | -          |
+| data.frame               | struct     |
+| list^+^                  | list       |
+| bit64::integer64         | int64      |
+| difftime                 | time32     |
+| vctrs::vctrs_unspecified | null       |
+
+^+^: Only lists where all elements are the same type are able to be translated to Arrow list type (which is a "list of" some type).
+
+### Arrow to R
+
+| Arrow type        | R type                   |
+|-------------------|--------------------------|
+| boolean           | logical                  |
+| int8              | integer                  |
+| int16             | integer                  |
+| int32             | integer                  |
+| int64             | bit64::integer64         |
+| uint8             | integer                  |
+| uint16            | integer                  |
+| uint32            | double                   |
+| uint64            | -                        |
+| float16           | -                   |
+| float32           | double                   |
+| float64           | double                   |
+| utf8              | character                |
+| binary            | -                        |
+| fixed_size_binary | -                        |
+| date32            | Date                     |
+| date64            | POSIXct                  |
+| time32            | hms::difftime            |
+| time64            | hms::difftime            |
+| timestamp         | POSIXct                  |
+| duration          | -                        |
+| decimal           | double                   |
+| dictionary        | factor                   |

Review comment:
       Yes, I meant as a footnote that we only support some sub-types.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] fsaintjacques commented on a change in pull request #7441: ARROW-3446: [R] Document mapping of Arrow <-> R types

Posted by GitBox <gi...@apache.org>.
fsaintjacques commented on a change in pull request #7441:
URL: https://github.com/apache/arrow/pull/7441#discussion_r440846823



##########
File path: r/vignettes/arrow.Rmd
##########
@@ -86,7 +88,73 @@ to other applications and services that use Arrow. One example is Spark: the
 move data to and from Spark, yielding [significant performance
 gains](http://arrow.apache.org/blog/2019/01/25/r-spark-improvements/).
 
-# Class structure and package conventions
+# Internals
+
+## Mapping of R <--> Arrow types
+
+Arrow has a rich data type system that includes direct parallels with R's data types and much more.
+
+In the tables, entries with a `-` are not currently implemented.
+
+### R to Arrow
+
+| R type                   | Arrow type |
+|--------------------------|------------|
+| logical                  | boolean    |
+| integer                  | int32      |
+| double ("numeric")       | float64    |
+| character                | utf8       |
+| factor                   | dictionary |
+| raw                      | uint8      |
+| Date                     | date32     |
+| POSIXct                  | timestamp  |
+| POSIXlt                  | -          |
+| data.frame               | struct     |
+| list^+^                  | list       |
+| bit64::integer64         | int64      |
+| difftime                 | time32     |
+| vctrs::vctrs_unspecified | null       |
+
+^+^: Only lists where all elements are the same type are able to be translated to Arrow list type (which is a "list of" some type).
+
+### Arrow to R
+
+| Arrow type        | R type                   |
+|-------------------|--------------------------|
+| boolean           | logical                  |
+| int8              | integer                  |
+| int16             | integer                  |
+| int32             | integer                  |
+| int64             | bit64::integer64         |
+| uint8             | integer                  |
+| uint16            | integer                  |
+| uint32            | double                   |
+| uint64            | -                        |
+| float16           | -                   |

Review comment:
       Align.

##########
File path: r/vignettes/arrow.Rmd
##########
@@ -86,7 +88,73 @@ to other applications and services that use Arrow. One example is Spark: the
 move data to and from Spark, yielding [significant performance
 gains](http://arrow.apache.org/blog/2019/01/25/r-spark-improvements/).
 
-# Class structure and package conventions
+# Internals
+
+## Mapping of R <--> Arrow types
+
+Arrow has a rich data type system that includes direct parallels with R's data types and much more.
+
+In the tables, entries with a `-` are not currently implemented.
+
+### R to Arrow
+
+| R type                   | Arrow type |
+|--------------------------|------------|
+| logical                  | boolean    |
+| integer                  | int32      |
+| double ("numeric")       | float64    |
+| character                | utf8       |
+| factor                   | dictionary |
+| raw                      | uint8      |
+| Date                     | date32     |
+| POSIXct                  | timestamp  |
+| POSIXlt                  | -          |
+| data.frame               | struct     |
+| list^+^                  | list       |
+| bit64::integer64         | int64      |
+| difftime                 | time32     |
+| vctrs::vctrs_unspecified | null       |
+
+^+^: Only lists where all elements are the same type are able to be translated to Arrow list type (which is a "list of" some type).
+
+### Arrow to R
+
+| Arrow type        | R type                   |
+|-------------------|--------------------------|
+| boolean           | logical                  |
+| int8              | integer                  |
+| int16             | integer                  |
+| int32             | integer                  |
+| int64             | bit64::integer64         |
+| uint8             | integer                  |
+| uint16            | integer                  |
+| uint32            | double                   |

Review comment:
       I'm curious about the double, is it a copy-paste error, or it really casts to double.

##########
File path: r/vignettes/arrow.Rmd
##########
@@ -86,7 +88,73 @@ to other applications and services that use Arrow. One example is Spark: the
 move data to and from Spark, yielding [significant performance
 gains](http://arrow.apache.org/blog/2019/01/25/r-spark-improvements/).
 
-# Class structure and package conventions
+# Internals
+
+## Mapping of R <--> Arrow types
+
+Arrow has a rich data type system that includes direct parallels with R's data types and much more.
+
+In the tables, entries with a `-` are not currently implemented.
+
+### R to Arrow
+
+| R type                   | Arrow type |
+|--------------------------|------------|
+| logical                  | boolean    |
+| integer                  | int32      |
+| double ("numeric")       | float64    |
+| character                | utf8       |
+| factor                   | dictionary |
+| raw                      | uint8      |
+| Date                     | date32     |
+| POSIXct                  | timestamp  |
+| POSIXlt                  | -          |
+| data.frame               | struct     |
+| list^+^                  | list       |
+| bit64::integer64         | int64      |
+| difftime                 | time32     |
+| vctrs::vctrs_unspecified | null       |
+
+^+^: Only lists where all elements are the same type are able to be translated to Arrow list type (which is a "list of" some type).
+
+### Arrow to R
+
+| Arrow type        | R type                   |
+|-------------------|--------------------------|
+| boolean           | logical                  |
+| int8              | integer                  |
+| int16             | integer                  |
+| int32             | integer                  |
+| int64             | bit64::integer64         |
+| uint8             | integer                  |
+| uint16            | integer                  |
+| uint32            | double                   |
+| uint64            | -                        |
+| float16           | -                   |
+| float32           | double                   |
+| float64           | double                   |
+| utf8              | character                |
+| binary            | -                        |
+| fixed_size_binary | -                        |
+| date32            | Date                     |
+| date64            | POSIXct                  |
+| time32            | hms::difftime            |
+| time64            | hms::difftime            |
+| timestamp         | POSIXct                  |
+| duration          | -                        |
+| decimal           | double                   |
+| dictionary        | factor                   |

Review comment:
       The factor is only for primitive type?

##########
File path: r/src/array_to_vector.cpp
##########
@@ -418,6 +418,7 @@ class Converter_Struct : public Converter {
   std::vector<std::shared_ptr<Converter>> converters;
 };
 
+// Shouldn't this cast before dividing? Otherwise we're doing integer division

Review comment:
       Depends what you want, integer division is much faster than floating division.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org