parquetize (version 0.5.7)

get_partitions: get unique values from table's column

Description

This function allows you to extract unique values from a table's column to use as partitions.

Internally, this function does "SELECT DISTINCT(`mycolumn`) FROM `mytable`;"

Usage

get_partitions(conn, table, column)

Value

a vector with unique values for the column of the table

Arguments

conn

A `DBIConnection` object, as return by `DBI::dbConnect`

table

a DB table name

column

a column name for the table passed in param

Examples

Run this code
dbi_connection <- DBI::dbConnect(RSQLite::SQLite(),
  system.file("extdata","iris.sqlite",package = "parquetize"))

get_partitions(dbi_connection, "iris", "Species")

Run the code above in your browser using DataLab