Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a very simple script like this:
[table1]
Replace Load *;
Select * From `database1`.`table1`;
Drop Field A;
Rename Field B to B_alias;
The script runs well with Full Reload.
However, if I run a Partial Reload, it fails at Rename with this error:
Error: The name 'B_alias' already exists.
Could someone please help me with this error?
if there already exists a field named "B_alias" in a previously loaded table, then you will not be able to rename a second field to the same name
instead of renaming , try to load the same field twice and then drop the other field
for example
table1:
load B_alias
,Dim1,Dim2
From table1source;
table2:
load B as B_alias
,B as B2
,a1,a2
From table2source;
Drop field B2;
read limitations
Two differently named fields cannot be renamed to having the same name. The script will run without errors, but the second field will not be renamed.
No, there is no B_alias field in any other table, before or after this script. This script is still running without error with Full Reload; only with Partial Reload it fails.
I am trying to optimize my run time using Partial Reload, so I need to understand why it causes error in this particular script.
Are you replacing the Table that has the B_alias field or another table that does not have B_alias field?
Partial Load will not drop existing tables from MEmory
so if you are replacing a table that does not have B_alias field means that B_alias exist in another table at the time of Partial Reload
a simple way to verify if B_alias exist in another table is to comment your rename field statement
and at the end of the partial reload
>> create a Table chart
>> Add Dimensions =$Table
>> Add Dimensions =$Field
>>and check if B_alias exists
[table1]
Replace Load *;
Select * From `database1`.`table1`;
Drop Field A;
//Rename Field B to B_alias;
The error message is very straight forward and is pointing out that a field named "B_alias" already exists in memory and won't allow you to rename another field with the same name.