}bedrock.cube.data.import
CJRothman opened this issue · 7 comments
Describe the bug
I'm trying to use this TI to export (using Bedrock4) attribute cubes and import into another instance and I am incurring errors. I had to edit the 1st section (If( nDimensionCount = 2 );) in order to import attributes.
The TI counts the number of dimensions in the target cube as nDimensionCount.
Then, in the Data tab, we have multiple sections of code (depending on nDimensionCount) that populate the target cube. Below is one of those sections that has not been edited by me. If we only have 3 dimensions in the target cube, how is it that we are referring to v4 and what hapenned to v1? v4 should be the value (not v5) as opposed to being referred to as the 3rd dimension.
Are the errors due to attributes not existing or being typed differently between the instances? Becasue although the cube.data.import process has special cases for 2 dimensional cubes to check for attribute cubes, security cubes, etc. (and also for 3 dimension cubes in the case of localized attribute cubes for that matter). It doesn't do anything like check if the attribute exists and create it. It is assumed that what's being imported is valid for the destination.
Given that the screenshot doesn't show the special case for a localized attribute cube you aren't using the latest version (so considder upgrading).
In the standard export format (which is the same as if you right click a cube and "export as text data" in the old clients as a "cma" file the first field is always the cube name. This is ignored by the import process. Hence dimension 1 is v2.
I was just going to respond to your question but I see you closed the issue already. Was I missing something or has an updated version already been published?
It had nothing to do with attributes not existing or being typed differently.
The files that were exported using Bedrock4 did not have cube in column 1 and so all the dimension references are off by 1.
The CellisUpdateable command is referencing dimension 1 as v2.
My pCubeNameExport was set to 0 (which I didn't change) but it DID skip cube name.
Then there should be a matching parameter on the import TI.
It's counterintuitive that it includes the cube name if set to 1 as the descript is
OPTIONAL: Skip cube name from export file, including header (Skip = 0) (Default = 1)
@CJRothman there was a bug that the default value of pCubeNameExport was set to 0 not 1 so behavior if this param was ommitted was not backwards compatible. But this was fixed in #341
I don't see an immediate need to update cube.data.import to work with both formats. Although it wouldn't be that difficult just add If( pCubeNameExport = 0 ); v30 = v29; v29 = v28; ... v2 = v1; EndIf; to the start of the data tab.
If you want to raise a ER for this then please do. And/or submit a pull request with the fix.
But the bug in this case has been fixed. All you need to do is download the latest version (not the last release). Or to apply local fix just save the process with the correct default value of 1.