Hitachi Vantara Pentaho Community Forums
Results 1 to 15 of 15

Thread: Java Filter Error

  1. #1
    Join Date
    Oct 2016
    Posts
    24

    Default Java Filter Error

    Hi,
    in my java filter condition i have this condition:
    (fk_plmn != fk_plmn_LKP) or (A!=B) or......

    but i have this error:

    Java Filter.0 - org.codehaus.janino.Parser$ParseException: Line 1, Column 9: Expression "fk_plmn != fk_plmn_LKP" is not a type
    2016/12/15 18:00:56 - Java Filter.0 - Line 1, Column 9: Expression "fk_plmn != fk_plmn_LKP" is not a type

    What's the problem?

    thanks
    Regards

  2. #2
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    You don't give enough information to help you solving the problem.
    Which version of PDI?
    Which steps are you using?
    Are those fields string, numeric, date?
    -- Mick --

  3. #3
    Join Date
    Oct 2016
    Posts
    24

    Default

    SORRY..
    I use VERSION 7, the last.
    Step is a JAVA FILTER after a SELECT VALUE TRF.
    all this fields are strings, numeric, date or big number.

    Thanks

  4. #4
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    It seems that you are trying to match 2 fields with different data types or that you are using an operator (!=) that is not suitable for the data type.
    Are fields fk_plmn and fk_plmn_LKP date fields? Or numeric? String?
    -- Mick --

  5. #5
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Why don't you attach a demo so we can see what's going on?
    It's not that hard: Put a Data-Grid and a Java-Filter in a transformation.
    So long, and thanks for all the fish.

  6. #6
    Join Date
    Oct 2016
    Posts
    24

    Default

    fk_plmn are two integer
    Attached Files Attached Files
    Last edited by enaud84; 12-16-2016 at 09:19 AM.

  7. #7
    Join Date
    Oct 2016
    Posts
    24

    Default

    look my attached file

  8. #8
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Please, make sure we can download by trying yourself.
    So long, and thanks for all the fish.

  9. #9
    Join Date
    Oct 2016
    Posts
    24

    Default

    it dont work still.. You know how i can do?
    i have always same error:
    2016/12/16 15:42:14 - Java Filter.0 - Line 1, Column 17: Expression "fk_plmn.equals(fk_plmn_LKP)" is not a type

  10. #10
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Once more: Please make sure we can download your demo transformation, so we can see what's going on. The link you provided above is not valid.
    So long, and thanks for all the fish.

  11. #11
    Join Date
    Oct 2016
    Posts
    24

    Default

    Ok, i find the error:
    date.equals(date1) <----ERROR
    date.compareTO(date1) <--- A method named "compareTO" is not declared in any enclosing class nor any supertype, nor through a static import

    How i can compare two date in a JAVA_FILTER?????
    thanks

  12. #12
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Java method names are case-sensitive, so try with compareTo()
    So long, and thanks for all the fish.

  13. #13
    Join Date
    Oct 2016
    Posts
    24

    Default

    ok but i have another error:
    || (dta_cartellino.compareTo(dta_cartellino_LKP)<0 || dta_cartellino.compareTo(dta_cartellino_LKP)>0)||
    (dta_chiusura_servizio.compareTo(dta_chiusura_servizio_LKP)<0 || dta_chiusura_servizio.compareTo(dta_chiusura_servizio_LKP)>0)

    va Filter.0 - java.lang.IllegalArgumentException: argument type mismatch
    2016/12/19 12:42:46 - Java Filter.0 - argument type mismatch
    2016/12/19 12:42:46 - Java Filter.0 -


    ​But both fields are all Timestamp.

  14. #14
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    ​But both fields are all Timestamp.
    Yes, but 0 is not a timestamp value.
    -- Mick --

  15. #15
    Join Date
    Oct 2016
    Posts
    24

    Default

    0 is result

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.