Delphix Products

 View Only
Expand all | Collapse all

Delphix data cleansing algorithm throwing error with Postgres DB

  • 1.  Delphix data cleansing algorithm throwing error with Postgres DB

    Posted 12-16-2019 03:25:00 AM
    I was replacing the positive integer with negative integer by using data cleansing algorithm.
    This was working correctly in Oracle DB but same algorithm throwing error in postgres DB.
    below is the error screenshot.

    2019/12/16 06:58:10 - Get All Lookups Values.0 - A String type was specified for field [Col0_lkUpKey], but a [class java.lang.Long] type was returned as a result of formula [release_id]

    Can some one suggest me the possible resolution here:
    In Oracle I was using data type as Varchar for the particular field while in Postgres DB I was using data type as int.
    That is the only difference I understood.

    My data cleansing file looks like:

    1=-1
    2=-2
    3=-3
    4=-4
    .
    .
    some 1 lakh rows .


    ------------------------------
    indrajeet yadav
    Delphix Community Members
    ------------------------------


  • 2.  RE: Delphix data cleansing algorithm throwing error with Postgres DB

    Posted 12-16-2019 06:14:00 AM
    Edited by Mouhssine Saidi 12-16-2019 06:15:49 AM
    Hi indrajeet,

    My interpretation to this error message is.

    Lookup value returned is of type long that doens't fit into postgres int type, you can try to change the column type to bigint if you can or change the masking algorithm to use one that gives you more control like "segment mapping".

    Regards,

    Mouhssine

    ------------------------------
    Mouhssine SAIDI
    Community Member
    Delphix Community Members
    ------------------------------



  • 3.  RE: Delphix data cleansing algorithm throwing error with Postgres DB

    Posted 12-16-2019 06:48:00 AM
    In postgres database Integer datatype ( INT) is a 4-byte integer that has a range from -2,147,483,648 to 2,147,483,647.
    So the range should not be an issue as far as i understood.


    ------------------------------
    indrajeet yadav
    Delphix Community Members
    ------------------------------



  • 4.  RE: Delphix data cleansing algorithm throwing error with Postgres DB

    Posted 12-16-2019 07:16:00 AM
    Hi,

    Either, try to use segment mapping algorithm or engage with support as they have the tools to look on what's going wrong on masking engine.

    Regards,

    Mouhssine

    ------------------------------
    Mouhssine SAIDI
    Community Member
    Delphix Community Members
    ------------------------------



  • 5.  RE: Delphix data cleansing algorithm throwing error with Postgres DB
    Best Answer

    Posted 12-16-2019 07:30:00 AM
    Hey Mouhssine,

    I got the solution. It was a type cast error. tried using cast function in custom sql filter and that worked for me.
    :)



    ------------------------------
    indrajeet yadav
    Delphix Community Members
    ------------------------------



  • 6.  RE: Delphix data cleansing algorithm throwing error with Postgres DB

    Posted 12-16-2019 07:35:00 AM
    Edited by Mouhssine Saidi 12-16-2019 07:35:55 AM
    Hi,

    Great news, so finally it was related to data type :)

    For information you casted from what to what ?

    Regards,

    Mouhssine

    ------------------------------
    Mouhssine SAIDI
    Community Member
    Delphix Community Members
    ------------------------------



  • 7.  RE: Delphix data cleansing algorithm throwing error with Postgres DB

    Posted 12-16-2019 07:52:00 AM
    integer to Varchar

    ------------------------------
    indrajeet yadav
    Delphix Community Members
    ------------------------------



  • 8.  RE: Delphix data cleansing algorithm throwing error with Postgres DB

    Posted 12-17-2019 05:14:00 AM
    Now the same algorithm is throwing error with a similar integer column in postgres DB (only difference is that of primary key).
    This column Build_Info is a primary key  and Index column.

    I just wanted to replace 23649 by -23649

    Struggling to resolve this from morning. Below is the error logs:

    2019/12/17 08:10:43 - Update.0 - Error updating batch

    2019/12/17 08:10:43 - Update.0 - Batch entry 0 UPDATE "azuredevops_reporting"."build_info"
    2019/12/17 08:10:43 - Update.0 - SET "build_id" = -23649.0
    2019/12/17 08:10:43 - Update.0 - WHERE ( ( "build_id" = '23649' ) ) was aborted: ERROR: operator does not exist: integer = character varying
    2019/12/17 08:10:43 - Update.0 - Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.

    ------------------------------
    indrajeet yadav
    Technical Test Lead
    Delphix Community Members
    ------------------------------



  • 9.  RE: Delphix data cleansing algorithm throwing error with Postgres DB

    Posted 12-17-2019 05:17:00 AM
    I am already using cast function in custom SQL while fetching data from this table.
    Ex: SELECT cast ("build_id" as varchar) from <tablename>

    ------------------------------
    indrajeet yadav
    Technical Test Lead
    Delphix Community Members
    ------------------------------