Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using a global map variable in a tJavaRow component. but its giving an error message.
"cannot make a static reference to the non-static field".
I am using BigData Spark job.
How Do i overcome this issue.
I have created a simple mapping to show this error.
the error is coming from the tJavaRow component which i have shown in the first post.
here is the code of the tjavarow component .
String[] values = (String[])globalMap.get("values"); row1.a = row2.a; row1.b = row2.b;
here is the code in tjava component
String[] values = { "This", "is", "test" }; globalMap.put("values", values);
try reproducing the error in you system.
request to help me on this..
Hi,
I am not able to open your job in talend.
what kind of job is that.. is it standard or bigdata job?.
I am specifically talking about Bigdata Spark job.
In Talend standard job , I am able to get the output . but the same code in talend big data is giving error.
I am using 'Talend big data plaform 6.2'
Thanks
Sorry it was a standard job, not a Bigdata Spark job. I will give it a try with Bigdata Spark job.
I am trying with an alternative
I have created a context variable of type Object.
To this variable I am saving my string array in tJava component
String[] cols = { "This","is","test" }; context.SrcCols = cols;
I am accessing this context variable in tJavarow
String[] Cols = (String[])context.SrcCols;
but while running its giving the following error.
java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.String;
Hello Tom,
Did you get any solution to make it work in BigData Spark Job? we tried to implement the same and found this artilce with the same error what we are getting.
Please suggest.
Hello,
Currently, there is no access for "globalMap" in Spark Batch mode. This is due to a different implementation of Spark Batch compared to DI. You will only be able to accomplish this with standard DI jobs.
This feature is not available in talend spark jobs.
We have raised a ticket to talend support and they mentioned that it is a limitation in talend big data job.
I don't know if this feature is available in talend latest version
Thanks