How to select partition on R Jupyter Notebook.
Hello,
If I want to use a date range as partition on dkuReadDataset for a R Jupyter Notebook, how would it be?
dkuReadDataset("SourceData", partitions="?" )
Like partitions ="2021-01-01/2021/06/01" ?
https://doc.dataiku.com/dss/api/8.0/R/dataiku/reference/dkuReadDataset.html
Answers
-
Sarina Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 317 Dataiker
Hi @CD
,
You can get the available partition values in an R notebook using the dkuListDatasetPartitions method. For example, on my dataset with two partitions:Then you can simply pass an exact partition value to the dkuReadDataset function, like this:
transactions_copy <- dkuReadDataset("transactions_copy", partitions='2018')
If you want to specify multiple partitions, you can specify them in the same way that you would specify them in a recipe when selecting partitions. So they can be comma-separated to specify explicit values, or slash-separated to specify a range:# this will return the explicit partitons 2017-03 and 2017-07 transactions_copy <- dkuReadDataset("transactions_copy", partitions="2017-03,2017-07") # this will return the range of partitions between 2017-03 and 2017-07 transactions_copy <- dkuReadDataset("transactions_copy", partitions="2017-03/2017-07")
Let me know if you have any questions about this.
Thank you,
Sarina