Skip to contents

Parse Arrow format strings

Usage

parse_format(format)

Arguments

format

A format string.

Value

A list() with elements:

  • format: The input string

  • abbreviation: The short name of the type

  • spec: The parsing pattern for the type

  • description: The human-readable name of the type

  • args: A list() of key/value pairs of type arguments

Examples

parse_format("i")
#> $format
#> [1] "i"
#> 
#> $abbreviation
#> [1] "i"
#> 
#> $spec
#> [1] "i"
#> 
#> $description
#> [1] "int32"
#> 
#> $args
#> named list()
#> 
parse_format("w:128")
#> $format
#> [1] "w:128"
#> 
#> $abbreviation
#> [1] "w"
#> 
#> $spec
#> [1] "w:{n_bytes}"
#> 
#> $description
#> [1] "fixed-width binary"
#> 
#> $args
#> $args$n_bytes
#> [1] 128
#> 
#> 
parse_format("+ud:1,2,3")
#> $format
#> [1] "+ud:1,2,3"
#> 
#> $abbreviation
#> [1] "+ud"
#> 
#> $spec
#> [1] "+ud:{type_ids}"
#> 
#> $description
#> [1] "dense union with type ids"
#> 
#> $args
#> $args$type_ids
#> [1] 1 2 3
#> 
#>