Description Usage Arguments Note Author(s) See Also Examples
Remove key-value pairs from a data connection
1 | removeData(conn, keys)
|
conn |
a kvConnection object |
keys |
a list of keys indicating which k/v pairs to remove |
This is generally not recommended for HDFS as it writes a new file each time it is called, and can result in more individual files than Hadoop likes to deal with.
Ryan Hafen
removeData
, localDiskConn
, hdfsConn
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # connect to empty localDisk directory
conn <- localDiskConn(file.path(tempdir(), "irisSplit"), autoYes = TRUE)
# add some data
addData(conn, list(list("1", iris[1:10,])))
addData(conn, list(list("2", iris[11:90,])))
addData(conn, list(list("3", iris[91:110,])))
addData(conn, list(list("4", iris[111:150,])))
# represent it as a distributed data frame
irisDdf <- ddf(conn, update = TRUE)
irisDdf
# remove data for keys "1" and "2"
removeData(conn, list("1", "2"))
# look at result with updated attributes (reset = TRUE removes previous attrs)
irisDdf <- ddf(conn, reset = TRUE, update = TRUE)
irisDdf
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.