Performs a hash lookup on a string column of a materialized block. Returns all rows where the column value matches one of the query keys. Hash indices are built lazily on first use and cached for subsequent calls.
Arguments
- block
A
vectra_blockfrommaterialize().- column
Character scalar. Name of the string column to match against.
- keys
Character vector. Query values to look up.
- ci
Logical. Case-insensitive matching (default
FALSE).
Value
A data.frame with column query_idx (1-based position in keys)
plus all columns from the block, for each (query, block_row) match pair.
Examples
# \donttest{
f <- tempfile(fileext = ".vtr")
df <- data.frame(taxonID = 1:2,
canonicalName = c("Quercus robur", "Pinus sylvestris"))
write_vtr(df, f)
blk <- materialize(tbl(f))
hits <- block_lookup(blk, "canonicalName", c("Quercus robur"))
ci_hits <- block_lookup(blk, "canonicalName", c("quercus robur"), ci = TRUE)
unlink(f)
# }