[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kettle-developers
Subject:    RE: [kettle-developers] dynamic set of formulas / UDJC
From:       Jens Bleuel <jbleuel () pentaho ! com>
Date:       2014-10-07 13:01:27
Message-ID: f931452fbdc7495cb71d0d53ffec0541 () CY1PR0601MB1100 ! namprd06 ! prod ! outlook ! com
[Download RAW message or body]

Hi Dan,

PDI-8738 fixed the example: "Changed code snippet example of process row to read out \
first info rows then usual"

Also the description over here has been modified: \
http://wiki.pentaho.com/display/EAI/User+Defined+Java+Class

Any other action item, you would like? ☺

Cheers,
Jens
From: kettle-developers@googlegroups.com [mailto:kettle-developers@googlegroups.com] \
                On Behalf Of codek
Sent: Dienstag, 7. Oktober 2014 11:17
To: kettle-developers@googlegroups.com
Subject: Re: [kettle-developers] dynamic set of formulas / UDJC

Hi Jens,

Picking up a very old thread here, but back to Pauls original problem. Is it a bug \
that Object[] r = getRow() seems to be indeterministic?

I've just had the same problem, in lots of examples on the net and in the source \
getRow() is called, but if the above is true then that call really should be avoided \
if you have multiple incoming streams.

For me it seems if you have a small number of rows it typically works as expected, \
but when there's more data it "reliably" goes wrong.

I've seen a couple of jiras related too - It seems to me the jira you mention 8738 \
still exists in 5.2.  (Suspect 11546 was a variant of this too - not enough info to \
reproduce tho)

Dan

On Tuesday, 13 November 2012 22:19:25 UTC, Jens Bleuel wrote:
Hi Paul,

try it this way:

  RowSet rowSetMain=findInputRowSet("Row Data Stream");
  Object[] r=getRowFrom(rowSetMain);
[...]
  RowSet rowSetInfo=findInputRowSet("Info Data Stream");
  Object[] rowInfo = getRowFrom(rowSetInfo);

See also http://jira.pentaho.com/browse/PDI-8738

Viele Grüße
Jens
Am 13.11.2012 23:05, schrieb Paul Stoellberger:
Hi,

I'm trying to create a nice little UDJC step that reads from 2 inputs:
a) a list of formulas / fields i want to compute
b) the actual input data

So basically there is an arbitrary number of formulas i want to compute (that I will \
get from lets say a CSV file) on a given input data.

Sometimes it works, sometimes it doesn't. From what I can tell its because its \
undefined which input set reaches the UDJC first. I'm getting the one with index 1, \
but that can be true or not.....

I wanted to use an "info stream" but I dont know how I can do that in a UDJC.
How do I do that?

If somebody thinks this step would be useful I can consider turning it into a real \
step later!

Any input welcome!

Thanks

-Paul

P.S: I dont know if KTRs get through.. so here a dropbox link to the sample \
transformation: https://dl.dropbox.com/u/13927708/DynamicFormula2.ktr

P.P.S: We wanted to use the metadata injection step for that, but I was told thats \
not working for formulas so I created this


--
You received this message because you are subscribed to the Google Groups \
"kettle-developers" group. To post to this group, send email to \
kettle-d...@googlegroups.com<javascript:>. To unsubscribe from this group, send email \
to kettle-develop...@googlegroups.com<javascript:>. Visit this group at \
http://groups.google.com/group/kettle-developers?hl=en-US.


--
You received this message because you are subscribed to the Google Groups \
"kettle-developers" group. To unsubscribe from this group and stop receiving emails \
from it, send an email to \
kettle-developers+unsubscribe@googlegroups.com<mailto:kettle-developers+unsubscribe@googlegroups.com>.
 To post to this group, send email to \
kettle-developers@googlegroups.com<mailto:kettle-developers@googlegroups.com>. Visit \
this group at http://groups.google.com/group/kettle-developers. For more options, \
visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups \
"kettle-developers" group. To unsubscribe from this group and stop receiving emails \
from it, send an email to kettle-developers+unsubscribe@googlegroups.com. To post to \
this group, send email to kettle-developers@googlegroups.com. Visit this group at \
http://groups.google.com/group/kettle-developers. For more options, visit \
https://groups.google.com/d/optout.


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
span.EmailStyle18
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">Hi \
Dan,<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">PDI-8738 \
fixed the example: "</span><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">Changed \
code snippet example of process row to read out first info rows  then \
usual"<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">Also \
the description over here has been modified: <a \
href="http://wiki.pentaho.com/display/EAI/User&#43;Defined&#43;Java&#43;Class"><span \
style="color:windowtext">http://wiki.pentaho.com/display/EAI/User&#43;Defined&#43;Java&#43;Class</span></a>
 <o:p></o:p></span></p>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">Any \
other action item, you would like? </span><span \
style="font-size:11.0pt;font-family:Wingdings">J</span><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"> \
<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">Cheers,<o:p></o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">Jens<o:p></o:p></span></p>
 <p class="MsoNormal"><b><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">From:</span></b><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"> \
kettle-developers@googlegroups.com [mailto:kettle-developers@googlegroups.com] <b>On \
Behalf Of </b>codek<br> <b>Sent:</b> Dienstag, 7. Oktober 2014 11:17<br>
<b>To:</b> kettle-developers@googlegroups.com<br>
<b>Subject:</b> Re: [kettle-developers] dynamic set of formulas / \
UDJC<o:p></o:p></span></p> <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">Hi Jens,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Picking up a very old thread here, but back to Pauls original \
problem. Is it a bug that Object[] r = getRow() seems to be \
indeterministic?<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">I've just had the same problem, in lots of examples on the net \
and in the source getRow() is called, but if the above is true then that call really \
should be avoided if you have multiple incoming streams.<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">For me it seems if you have a small number of rows it typically \
works as expected, but when there's more data it &quot;reliably&quot; goes \
wrong.<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">I've seen a couple of jiras related too - It seems to me the \
jira you mention 8738 still exists in 5.2. &nbsp;(Suspect 11546 was a variant of this \
too - not enough info to reproduce tho)<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Dan<br>
<br>
On Tuesday, 13 November 2012 22:19:25 UTC, Jens Bleuel wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm \
6.0pt;margin-left:4.8pt;margin-right:0cm"> <div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span \
style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">Hi Paul,<br> <br>
try it this way:<br>
</span><br>
&nbsp;&nbsp;RowSet rowSetMain=findInputRowSet(&quot;Row Data Stream&quot;); <br>
&nbsp;&nbsp;Object[] r=getRowFrom(rowSetMain); <br>
[...] <br>
&nbsp;&nbsp;RowSet rowSetInfo=findInputRowSet(&quot;Info Data Stream&quot;); <br>
&nbsp;&nbsp;Object[] rowInfo = getRowFrom(rowSetInfo);<br>
<br>
See also <a href="http://jira.pentaho.com/browse/PDI-8738" \
target="_blank">http://jira.pentaho.com/browse/PDI-8738</a><br> <br>
Viele Grüße<br>
Jens<o:p></o:p></p>
<div>
<p class="MsoNormal">Am 13.11.2012 23:05, schrieb Paul Stoellberger:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span \
style="font-size:10.0pt">Hi,<br> <br>
I'm trying to create a nice little UDJC step that reads from 2 inputs:<br>
a) a list of formulas / fields i want to compute<br>
b) the actual input data<br>
<br>
So basically there is an arbitrary number of formulas i want to compute (that I will \
get from lets say a CSV file) on a given input data.<br> <br>
Sometimes it works, sometimes it doesn't. From what I can tell its because its \
undefined which input set reaches the UDJC first.<br> I'm getting the one with index \
1, but that can be true or not..... <br> <br>
I wanted to use an &quot;info stream&quot; but I dont know how I can do that in a \
UDJC.<br> How do I do that?<br>
<br>
If somebody thinks this step would be useful I can consider turning it into a real \
step later!<br> <br>
Any input welcome!<br>
<br>
Thanks<br>
<br>
-Paul<br>
<br>
P.S: I dont know if KTRs get through.. so here a dropbox link to the sample \
transformation: <br>
<a href="https://dl.dropbox.com/u/13927708/DynamicFormula2.ktr" \
target="_blank">https://dl.dropbox.com/u/13927708/DynamicFormula2.ktr</a><br> <br>
P.P.S: We wanted to use the metadata injection step for that, but I was told thats \
not working for formulas so I created this<br> <br>
<o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span \
style="font-size:10.0pt"><o:p>&nbsp;</o:p></span></p> </div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt">--
<br>
You received this message because you are subscribed to the Google Groups \
&quot;kettle-developers&quot; group.<br> To post to this group, send email to <a \
href="javascript:" target="_blank">kettle-d...@googlegroups.com</a>.<br> To \
unsubscribe from this group, send email to <a href="javascript:" target="_blank"> \
kettle-develop...@googlegroups.com</a>.<br> Visit this group at <a \
href="http://groups.google.com/group/kettle-developers?hl=en-US" target="_blank"> \
http://groups.google.com/group/kettle-developers?hl=en-US</a>.<br> <br>
<o:p></o:p></span></p>
</div>
</div>
</blockquote>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</blockquote>
</div>
</div>
<p class="MsoNormal">-- <br>
You received this message because you are subscribed to the Google Groups \
&quot;kettle-developers&quot; group.<br> To unsubscribe from this group and stop \
receiving emails from it, send an email to <a \
href="mailto:kettle-developers&#43;unsubscribe@googlegroups.com">kettle-developers&#43;unsubscribe@googlegroups.com</a>.<br>
 To post to this group, send email to <a \
href="mailto:kettle-developers@googlegroups.com"> \
kettle-developers@googlegroups.com</a>.<br> Visit this group at <a \
href="http://groups.google.com/group/kettle-developers">http://groups.google.com/group/kettle-developers</a>.<br>
 For more options, visit <a \
href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.<o:p></o:p></p>
 </div>
</body>
</html>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups \
&quot;kettle-developers&quot; group.<br /> To unsubscribe from this group and stop \
receiving emails from it, send an email to <a \
href="mailto:kettle-developers+unsubscribe@googlegroups.com">kettle-developers+unsubscribe@googlegroups.com</a>.<br \
/> To post to this group, send email to <a \
href="mailto:kettle-developers@googlegroups.com">kettle-developers@googlegroups.com</a>.<br \
/> Visit this group at <a \
href="http://groups.google.com/group/kettle-developers">http://groups.google.com/group/kettle-developers</a>.<br \
/> For more options, visit <a \
href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.<br \
/>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic