You will find Talend Errors and solutions, Optimization, Tips & Tricks, Performance, Components Explanations ... and much more.
Monday, 28 March 2016
Monday, 21 March 2016
Rounding Double/Float values till 1 & 2 Decimal values in TALEND thru Math.round
Rounding double/float till 1 decimal value
1) Math.round(x)
Prints
10.5 rounded is 11
10.499999999999998 rounded is 10
9.5 rounded is 10
9.499999999999998 rounded is 9
8.5 rounded is 9
8.499999999999998 rounded is 8
7.5 rounded is 8
7.499999999999999 rounded is 7
Rounding double/float till 2 Decimal values
Eg:
double kilobytes = 1205.6358;
System.out.println("kilobytes : " + kilobytes);
double newKB = Math.round(kilobytes*100.0)/100.0;
System.out.println("kilobytes (Math.round) : " + newKB);
Output :
=======
1) Math.round(x)
Prints
10.5 rounded is 11
10.499999999999998 rounded is 10
9.5 rounded is 10
9.499999999999998 rounded is 9
8.5 rounded is 9
8.499999999999998 rounded is 8
7.5 rounded is 8
7.499999999999999 rounded is 7
Rounding double/float till 2 Decimal values
Eg:
double kilobytes = 1205.6358;
System.out.println("kilobytes : " + kilobytes);
double newKB = Math.round(kilobytes*100.0)/100.0;
System.out.println("kilobytes (Math.round) : " + newKB);
Output :
=======
kilobytes : 1205.6358
kilobytes (Math.round) : 1205.64
Tuesday, 15 March 2016
TALEND ERROR : COMPILATION ERROR, But don't know which COMPONENT has the ERROR.
[/Solution] :
0)Deactivate the Entire Talend job.
1)Activate the Components in the TALEND job flow by flow.
2)Go to the Code window and check for the Errors.
3)If you don't see the Errors, Activate the Next Flow.
4) Iterate the Steps 2 and 3 until the code window shows the Errors.
5)Once you found the Errors, you get to know which component is having code Issues.
0)Deactivate the Entire Talend job.
1)Activate the Components in the TALEND job flow by flow.
2)Go to the Code window and check for the Errors.
3)If you don't see the Errors, Activate the Next Flow.
4) Iterate the Steps 2 and 3 until the code window shows the Errors.
5)Once you found the Errors, you get to know which component is having code Issues.
ERROR: Could not find or load main class project_name.job_name_0_1_job_name
Solution :
Sometimes JVM does not compiles files as expected so rerun and it will compile
Or else remove all already generated class files to force JVM to create new ones.
0)Go to the Task Manager.
1)Check whether the TALEND application is running in Multiple Instances.
If so, First Exit from the Talend Application.
Then kill the other Multiple Instances of TALEND that are running.
2)Kill all the java process that are running.
3)Remove already Generated Class files in the below folder :
...\<Workspace name>\.Java\classes\<Project name>\<Job folder>
4)Remove all the talend related folders/files in the below folder too.
C:\Users\<User_name>\AppData\Local\Temp
Sometimes JVM does not compiles files as expected so rerun and it will compile
Or else remove all already generated class files to force JVM to create new ones.
0)Go to the Task Manager.
1)Check whether the TALEND application is running in Multiple Instances.
If so, First Exit from the Talend Application.
Then kill the other Multiple Instances of TALEND that are running.
2)Kill all the java process that are running.
3)Remove already Generated Class files in the below folder :
...\<Workspace name>\.Java\classes\<Project name>\<Job folder>
4)Remove all the talend related folders/files in the below folder too.
C:\Users\<User_name>\AppData\Local\Temp
Wednesday, 2 March 2016
DataTypes Conversions in TALEND
String to Integer --- Integer.parseInt(row1.myString)
String to Date -- TalendDate.parseDate("dd-MM-yyyy",row1.myString)
String to BigDecimal -- new BigDecimal(row1.myString)
String to Float -- Float.parseFloat(row1.myString)
String to Long -- Long.parseLong(row1.myString)
Integer to String -- variable+"" or variable.toString()
Date to String -- TalendDate.formatDate("yy-MM-dd", row1.myDate)
BigDecimal to String -- row1.myBigDecimal.toString()
String->Timestamp and String->Date: String->Date
TalendDate.parseDate(pattern, stringDate)
Date related Talend Functions
TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",myDate)
TalendDate.parseDate("yyyy-MM-dd HH:mm:ss","")
TalendDate.getDate("CCYY-MM-DD hh:mm:ss")
TalendDate.getRandomDate("2007-01-01","2008-12-31")
TalendDate.diffDate(myDate,myDate2,"MM")
TalendDate.addDate(myDate,pattern,addValue,"MM")
TalendDate.compareDate(myDate,myDate2,"yyyy-MM-dd")
DATE 2 STRING 2 DATE Examples
----------String 2 Date Conversion Example------
String a="2016-01-23";
Date d=TalendDate.parseDate("yyyy-MM-dd", a);
System.out.println("\nInput String ------ "+a);
System.out.println("\nOutput Converted Date------"+d);
RESULT :
Input String ------ 2016-01-23
Output Converted Date------Sat Jan 23 00:00:00 IST 2016
----------Date 2 String Conversion Example------
String a1="2016-01-23";
Date d1=TalendDate.parseDate("yyyy-MM-dd", a1);
String b1=TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",d1);
System.out.println("\nInput Date ------ "+d1);
System.out.println("\nOutput Converted String------"+b1);
RESULT :
Input Date ------ Sat Jan 23 00:00:00 IST 2016
Output Converted String------2016-01-23 00:00:00
----------Date Conversion with AM/PM Example------
String a5="2016-01-23 12:30:45 AM";
Date d5=TalendDate.parseDate("yyyy-MM-dd HH:mm:ss aa", a5);
System.out.println("\nInput String ------ "+a5);
System.out.println("\nOutput Converted Date------"+d5);
String b7=TalendDate.formatDate("yyyy-MM-dd HH:mm:ss aa",d5);
System.out.println("\nOutput Converted String------"+b7);
RESULT :
Input String ------ 2016-01-23 12:30:45 AM
Output Converted Date------Sat Jan 23 12:30:45 IST 2016
Output Converted String------2016-01-23 12:30:45 PM
String a="2016-01-23";
Date d=TalendDate.parseDate("yyyy-MM-dd", a);
System.out.println("\nInput String ------ "+a);
System.out.println("\nOutput Converted Date------"+d);
RESULT :
Input String ------ 2016-01-23
Output Converted Date------Sat Jan 23 00:00:00 IST 2016
----------Date 2 String Conversion Example------
String a1="2016-01-23";
Date d1=TalendDate.parseDate("yyyy-MM-dd", a1);
String b1=TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",d1);
System.out.println("\nInput Date ------ "+d1);
System.out.println("\nOutput Converted String------"+b1);
RESULT :
Input Date ------ Sat Jan 23 00:00:00 IST 2016
Output Converted String------2016-01-23 00:00:00
----------Date Conversion with AM/PM Example------
String a5="2016-01-23 12:30:45 AM";
Date d5=TalendDate.parseDate("yyyy-MM-dd HH:mm:ss aa", a5);
System.out.println("\nInput String ------ "+a5);
System.out.println("\nOutput Converted Date------"+d5);
String b7=TalendDate.formatDate("yyyy-MM-dd HH:mm:ss aa",d5);
System.out.println("\nOutput Converted String------"+b7);
RESULT :
Input String ------ 2016-01-23 12:30:45 AM
Output Converted Date------Sat Jan 23 12:30:45 IST 2016
Output Converted String------2016-01-23 12:30:45 PM
Subscribe to:
Posts (Atom)
get it
http://hinekv1.ddns.net:8008/get.php?username=Varga_Florentina1tv&password=j5MgWBs18t&type=m3u_plus&output=mpegts http://www.lo...