Adding Partition by API

Solved!
Bader
Level 3
Adding Partition by API

I tried to add Partition by UI it works fine with no issue when I added dataset.  

Currently i'm would like to do the same by using python api. Could you please help :  

 

client = dataiku.api_client()

project = client.get_project("Test")

import_definition = project.init_tables_import("testdb", "testschema","testtable")

prepared_import =import_definition.prepare()

future = prepared_import.execute().

 

I would like add Partition before creating the dataset. 

0 Kudos
1 Solution
Clément_Stenac
Dataiker

Hi,

It is not possible to do this at import time. You may modify the settings of a dataset after  creation in order to make it partitioned.

For that, we advise you to create the dataset, use get_definition() in a notebook, then partition it, use get_definition() again in the notebook to see the differences that are needed to make a dataset partitioned, and then to apply that to your dataset. You'll mostly need to change the partitioningScheme part of the dataset definition.

View solution in original post

0 Kudos
2 Replies
Clément_Stenac
Dataiker

Hi,

It is not possible to do this at import time. You may modify the settings of a dataset after  creation in order to make it partitioned.

For that, we advise you to create the dataset, use get_definition() in a notebook, then partition it, use get_definition() again in the notebook to see the differences that are needed to make a dataset partitioned, and then to apply that to your dataset. You'll mostly need to change the partitioningScheme part of the dataset definition.

0 Kudos
Bader
Level 3
Author

Could you please provide example 

 

 

0 Kudos

Labels

?
Labels (2)
A banner prompting to get Dataiku