项目作者: Azure

项目描述 :
R package for interfacing with Azure table storage
高级语言: R
项目地址: git://github.com/Azure/AzureTableStor.git
创建时间: 2020-10-21T13:47:01Z
项目社区:https://github.com/Azure/AzureTableStor

开源协议:Other

下载


" class="reference-link">AzureTableStor

CRAN
Downloads
R-CMD-check

An R interface to the Azure table storage service, building on the functionality provided by AzureStor.

Table storage is excellent for flexible datasets—web app user data, address books, device information, and other metadata—and lets you build cloud applications without locking down the data model to particular schemas. Because different rows in the same table can have a different structure—for example, order information in one row, and customer information in another—you can evolve your application and table schema without taking it offline. The table storage service is available both as part of general Azure storage, and as an optional API in Azure Cosmos DB.

The primary repo for this package is at https://github.com/Azure/AzureTableStor; please submit issues and PRs there. It is also mirrored at the Cloudyr org at https://github.com/cloudyr/AzureTableStor. You can install the development version of the package with devtools::install_github("Azure/AzureTableStor").

Example

  1. library(AzureTableStor)
  2. # storage account endpoint
  3. endp <- table_endpoint("https://mystorageacct.table.core.windows.net", key="mykey")
  4. # Cosmos DB w/table API endpoint
  5. endp <- table_endpoint("https://mycosmosdb.table.cosmos.azure.com:443", key="mykey")
  6. create_storage_table(endp, "mytable")
  7. list_storage_tables(endp)
  8. tab <- storage_table(endp, "mytable")
  9. insert_table_entity(tab, list(
  10. RowKey="row1",
  11. PartitionKey="partition1",
  12. firstname="Bill",
  13. lastname="Gates"
  14. ))
  15. get_table_entity(tab, "row1", "partition1")
  16. # specifying the entity as JSON text instead of a list
  17. update_table_entity(tab,
  18. '{
  19. "RowKey": "row1",
  20. "PartitionKey": "partition1",
  21. "firstname": "Satya",
  22. "lastname": "Nadella
  23. }')
  24. # we can import to the same table as above: table storage doesn't enforce a schema
  25. import_table_entities(tab, mtcars,
  26. row_key=row.names(mtcars),
  27. partition_key=as.character(mtcars$cyl))
  28. list_table_entities(tab)
  29. list_table_entities(tab, filter="firstname eq 'Satya'")
  30. list_table_entities(tab, filter="RowKey eq 'Toyota Corolla'")