R write.dataset error

Tags
Dataiker, Alpha Tester Posts: 535 Dataiker
edited July 2024 in Using Dataiku

Here is my 2 lines R code (recipes)


ctg <- read.dataset("testIn")
write.dataset(ctg,"testOut")

I have the following messages and error:


[1] "Start writing table to file ..."
[1] "Done writing table to file ..."
Error in write.dataset(ctg, "testOrder") :
Unable to write dataset TRAININGPA.testOrder : RuntimeException: Session doesn't exist

Do you know where is the problem ?

Thanks

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Alpha Tester, Dataiker Alumni Posts: 190 ✭✭✭✭✭✭✭✭
    edited July 2024

    Hi,

    For recipes:

    In a general way, to work with R recipes, you would need to configure R first, then a basic R recipe would be:


    library(dataiku)

    # Input dataset
    data <- read.dataset("name_dataset_in")

    # Output dataset
    write.dataset_with_schema(data,"name_dataset_out")

    For notebooks:

    It works the same way than for recipes (I also recommend using dataset_with_schema()).

    But, you need to create the output dataset first.

    Also, you should write in a managed dataset, it would prevent from some problems.

    To create a manage dataset, click on the "all dataset types..." when you create a new dataset, then you will get this screen:

    Read more about managed datasets.

  • Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 1 ✭✭✭✭
    The problem only appears in notebook case. It runs inside a recipe.

    Thanks.

    Pascal
  • Alpha Tester, Dataiker Alumni Posts: 190 ✭✭✭✭✭✭✭✭
    I updated my answer according to the details you provided. If it still does not help you, we will need the logs of your instance.

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.