SWS-Methodology / faoswsProduction

Repository to contain the code for imputing production data in the statistical working system.
0 stars 1 forks source link

Item not imputed in batch run #196

Closed mkao006 closed 8 years ago

mkao006 commented 8 years ago

There appear to be some item not imputed when running on the complete production data but imputed when running on session.

We suspect it is because the item is not in the complete imputation key specified. But when the session is specified, it can impute anything.

Now we need to check whether pistachio (01375) is in the complete imputation key.

mkao006 commented 8 years ago

Also check the list provided by Tomasz, I suspect the oils are not in the list as well.

mkao006 commented 8 years ago

Pistachio is in the list and oil as well. Need to investigate further why they are not imputed or saved back.

mkao006 commented 8 years ago

It seems the error comes from the values are protected in the database, and thus can not be over-written.

"Error in SaveData(domain = sessionKey@domain, dataset = sessionKey@dataset, : Validation error/s occurred: [1757, 65]: Cannot overwrite an official data item [1759, 65]: Cannot overwrite an official data item [1761, 65]: Cannot overwrite an official data item [1842, 65]: Cannot overwrite an official data item

However, they are calculated official data (, i), and thus should be writable. Awaiting response from Giorgio.

mkao006 commented 8 years ago

After a discussion with Giorgio, we have uncovered why the R module was unsuccessful in saving the imputed values back to the system.

The reason was due to the protection mechanism of the system preventing R modules over-writting official values and interfere with other data collection procedures such as the harvestor.

Thus, despite the execution being a core module, the R module does not have the privilege to over-write official values.

The solution is to run the imputation in session then manually save the data back to the database. ​