HNode hNode = f.getHNode(hNodeId);
String hTableId = hNode.getHTableId();
HTable hTable = hNode.getHTable(f);
String nodeId = hTable.getHNodeIdFromColumnName(newColumnName);
inputColumns.clear();
ExecutionController ctrl = WorkspaceRegistry.getInstance().getExecutionController(
workspace.getId());
// Invoke the add column command
logger.debug("SubmitPythonTranformation: " + hNodeId + ":" + nodeId);
try
{
HNode newColumnNameHNode = hTable.getHNodeFromColumnName(newColumnName);
if(null != newColumnNameHNode ) //Column name already exists
{
pythonNodeId = nodeId;
saveOrResetColumnValues(workspace, ctrl);
logger.debug("SubmitPythonTranformation: Tranform Existing Column" + hNodeId + ":" + nodeId);
UpdateContainer c = applyPythonTransformation(workspace, worksheet, f,
newColumnNameHNode, ctrl, nodeId);
return c;
} else {
saveColumnValues(workspace);
}
if (null == addColCmd) {
JSONArray addColumnInput = getAddColumnCommandInputJSON(hTableId);
AddColumnCommandFactory addColumnFac = (AddColumnCommandFactory) ctrl
.getCommandFactoryMap().get(
AddColumnCommand.class.getSimpleName());
addColCmd = (AddColumnCommand) addColumnFac.createCommand(
addColumnInput, workspace);
addColCmd.saveInHistory(false);