Product: TIBCO Spotfire®
A "round trip" TERR data function fails when its input data table has a Binary column and no rows: 'Error in .cleanDataForExport(value, output.name) : Output data 'output$PlotImage' has illegal type: 'AsIs''.'
A "round trip" TERR data function (in which the data function's TERR script is a simple reassignment like output <- input ) fails when its input data table from Spotfire includes a Binary column and has no rows.
Using TERR 4.5.0 or earlier and an empty input table whose [PlotImage] column has a DataType of "Binary", for example, the round-trip script generates an output table that throws a cryptic error like the following when the data function tries to prepare it for return to Spotfire:
'Error in .cleanDataForExport(value, output.name) : Output data 'output$PlotImage' has illegal type: 'AsIs''.'
This issue has been fixed in TERR 5.0.0, which was released in February 2019.
There is no known workaround to prevent the data function failure in TERR 4.5.0 and earlier, but use of the following modified TERR script will stop such a "round trip" data function with a more informative error message to the Spotfire user:
#-----
if( is.null(input) || nrow(input) == 0 )
{
stop( "\n\nNo input data was selected for this data function. Please make a data selection.\n\n" )
}
output <- input
#-----
That code (adapted to use the script's own object names) will return an error message and stack trace like the following, when an empty input table is sent to the data function:
Could not execute function call.
TIBCO Enterprise Runtime for R returned an error: 'Error in eval(expr, envir, enclos) :
No input data was selected for this data function. Please make a data selection.
eval(expr, envir, enclos)
eval(expr, envir, enclos)
stop("\n\nNo input data was selected for this data function. Please make a data selection.\n\n")'.
at Spotfire.Dxp.Data.DataFunctions.Executors.LocalFunctionClient.OnExecuting()
at Spotfire.Dxp.Data.DataFunctions.Executors.AbstractFunctionClient.<RunFunction>d__31.MoveNext()
at Spotfire.Dxp.Data.DataFunctions.Executors.SPlusFunctionExecutor.<ExecuteFunction>d__12.MoveNext()
at Spotfire.Dxp.Data.DataFunctions.DataFunctionExecutorService.<ExecuteFunction>d__3.MoveNext()
~~~
NOTE:
A Spotfire data function that uses TERR 4.5.0 or earlier will fail with an error like this one whenever its output data table has a Binary column and no rows:
'Error in .cleanDataForExport(value, output.name) : Output data '..' has illegal type: 'AsIs''.'
A "round trip" data function whose input data table has a Binary column and no rows is just one of many ways for the output data table generated in the TERR script to have a Binary column and no rows.
Disclaimer:
The code in this article is only a sample to be used as a reference. It is not intended to be used "As Is" in a Production environment. Always test in a Development environment. Make modifications to the code in accordance with your implementation specifications that best suit your business requirements. Refer to the reference(s) cited in this article for usage of the functions and methods used in the code.
Comments
0 comments
Article is closed for comments.