time_zone: Time zone string for data types that require a time zone. Default to "America/New_York".
verbose: Boolean indicating whether messages should be printed. Default to TRUE.
Details
We construct the arrays-of-primitive-types table by putting two different values of the same type and a NULL value in an array. In this way, the three values of the same type appear together in the source code and therefore are easier to compare. For integer values, we use the theoretical lower bound (i.e., minimum value) and the theoretical upper bound (i.e., maximum value) as the two values. The field names are taken from the Presto data types they represent.
Here's the complete primitive type values included in the table
['2 4:5:6.500' DAY TO SECOND, '3 7:8:9.600' DAY TO SECOND, null]
We construct the maps-of-primitive-types table by first creating a table with ARRAYs of all primitive data types. We then use the MAP() function to create the MAPs from ARRAYs.
We construct the primitive-types table by first creating a table with ARRAYs of all primitive data types. We then use Presto's UNNEST() function to expand the arrays into three separate rows. Each supported Presto data type has three rows in the table so that the resulting R data frame is distinctly different from a simple named list.
We construct the primitive-rows table by first creating a table with all primitive data types. We then use Presto's CAST(ROW() AS ROW())
function to create the ROW column.
We construct the array-of-rows table by first creating a table with a ROW type column that includes all 17 supported primitive data types. We then use the ARRAY[] function to construct the 2-element ARRAY(ROW)
column.
We construct the array-of-maps table by first creating a table a primitive MAP table and then calling the ARRAY[] function to create the ARRAY(MAP) columns.