Sometimes you can 'hit the wall' in case your project has wrong DATATYPES. Projects made by "GoodData CLTool" can has DATATYPES out of allowed rang - for instance DECIMAL(16,2) (limit is 15,6). In this case, our GoodData Writer (and also CloudConnect) can't modify anything, because Project API validate whole project and test DATATYPES before pushing modifications to ldm/manage. How to hack it?
- Go to
https://secure.gooddata.com/gdc/projects/$PID/model/view and follow poll link => you'll get JSON with whole LDM definition:
LDM definition{ "projectModelView" : { "model" : { "projectModel" : { "datasets" : [ { "dataset" : { "identifier" : "dataset.sf_user", "title" : "SF_User", "anchor" : { "attribute" : { "identifier" : "attr.sf_user.id", "title" : "Id (SF_User)", "folder" : "SF_User", "labels" : [ { "label" : { "identifier" : "label.sf_user.id", "title" : "ID (SF_User)", "type" : "GDC.text", "dataType" : "VARCHAR(255)" } } ] } }, "attributes" : [ { "attribute" : { "identifier" : "attr.sf_user.name", "title" : "Name (SF_User)", modify dataTypes accordingly and than go to https://secure.gooddata.com/gdc/projects/$PID /model/diff , submit JSON, little bit modified from step "1" (remove first two rows) and follow poll link:
Modified LDM{
"projectModel": {
"datasets": [
{
"dataset": {
"anchor": {
"attribute": {...}
},
"attributes": [],
"identifier": "dataset.sf_user",
"title": "SF_User"
}
},
{
"dataset": {...}
},
{
"dataset": {...}
}
],
"dateDimensions": [
{
"dateDimension": {
"name": "sf_opportunityclosedate",
"title": "SF_OpportunityCloseDate"
}
},
{
"dateDimension": {...}
},
{
"dateDimension": {...}
}
]
}
}
- scroll down and get maqlDdl from the bottom, where "preserveData" = false and "cascadeDrops" = true (BOLD SECTION):
MAQL DDL commands... "maqlDdl" : "ALTER ATTRIBUTE {attr.datecallout.id} DROP KEYS {f_datecallout.id};\nALTER DATASET {dataset.datecallout} DROP {attr.datecallout.id};\nALTER ATTRIBUTE {attr.sf_transaction.id} ALTER LABELS {label.sf_transaction.id} VISUAL(TITLE \"ID (SF_Transaction)\", DESCRIPTION \"\");\nALTER DATATYPE {f_sf_rpm.f_directsalesrpm} DECIMAL(15,2);\nALTER DATATYPE {f_sf_rpm.f_directsalessiterevenue} DECIMAL(15,2);\nALTER DATATYPE {f_sf_rpm.f_adnetworksiterevenue} DECIMAL(15,2);\nALTER DATATYPE {f_sf_rpm.f_adnetworkrpm} DECIMAL(15,2);\nALTER DATATYPE {f_sf_rpm.f_adnetworkpageviews} DECIMAL(15,2);\nALTER DATATYPE {f_sf_rpm.f_directsalespageviews} DECIMAL(15,2);\nDROP ALL IN {dataset.datecallout} CASCADE;\nSYNCHRONIZE {dataset.sf_transaction}, {dataset.sf_opportunity}, {dataset.sf_rpm};" ... put it to text editor and by using "find&replace" change \n to NEW LINE and \" to " resulted commands put to https://secure.gooddata.com/gdc/md/$PID/ldm/manage2 and follow poll link
Done! You're GoodData hacker :-)
P.S. If you go to GoodData Writer jobs queue in your Keboola Connection project (https://connection.keboola.com/admin/projects-new/$KBC_PID$/gooddata/?config=$WRITER_NAME$#/jobs ) and find "UpdateModel" tasks and switch to tab Log, you can dive into all details (click to log rows) - we're handling it for you automatically: |
|