Upload$insert_rows
Upload$insert_rows(rows, update_schema=FALSE) → list<insertRows response>
Parameters:
Returns:
Examples
library(redivis)
dataset <- redivis$user("user_name")$dataset("dataset_name", version="next")
table <- dataset$table("table_name")
# Providing a schema with the initial request is optional (but recommended).
# If not set, schema will be inferred based on the first batch of rows.
schema <- list(
list(name = "var1", type = "string"),
list(name = "var2", type = "integer"),
list(name = "var3", type = "dateTime")
)
# Construct a data.frame to send (or alternatively, a stringified JSON array of objects)
rows <- data.frame(
var1 = c("hello", "world"),
var2 = c(1, 2),
var3 = c(NA, "2020-01-01T00:00:00.123")
)
upload <- table$upload(name="my_stream")
# Create, or get a reference to an exisiting upload named "my_stream"
upload.create(type="stream", schema=schema, if_not_exists=True)
insert_response = upload.insert_rows(rows)
# See REST API / uploads / insertRows
print(insert_response)Last updated
Was this helpful?

