How to select partition on R Jupyter Notebook.

CD Registered Posts: 5 ✭✭✭✭


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" ?


  • Sarina
    Sarina Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer Posts: 315 Dataiker
    edited July 17

    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:

    Screen Shot 2021-07-08 at 4.31.01 PM.png

    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,

Setup Info
      Help me…