Skip to content

pre_process()

Vidhi Jain edited this page Jun 14, 2017 · 1 revision

Tasks

  • Drop the MULT column for all CP tables in databaseName_BN database by following queries:

    SHOW TABLES FROM databaseName_BN LIKE '%_CP' ;

    • For each such table:

    SHOW COLUMNS FROM tableName WHERE Field ='MULT';

    to check if this column exists or not

    • If yes, then execute

    ALTER TABLE tableName DROP COLUMN 'MULT';


  • Remapping of RNodes
    • Get the list of rnids and origrnids by executing

      SELECT orig_rnid, rnid FROM databaseName_BN.RNodes;

    • For each rnid

      • For each cp_table,

        • Remap the column headers by executing

          SHOW COLUMNS FROM <databaseName_BN.cp_tableName> WHERE Field = <rnidName>;

          to check if rnode in the header or not. S ave the result in rsTypes. Let a string in rsTypes be type.

        • If yes, then execute

          ALTER TABLE <databaseName_BN.cp_tableName> CHANGE COLUMN <rnidName> <origrnidName> type;


  • Create Fnodes Mapping tables by executing

    drop table if exists "+databaseName+"_BN.FNodes_Mapping;

    create table "+databaseName+"_BN.FNodes_Mapping as select * from "+databaseName+"_BN.FNodes;

    update "+databaseName+"_BN.FNodes_Mapping, "+databaseName+"_BN.RNodes set Fid = orig_rnid where Fid=rnid;

    update "+databaseName+"_BN.Attribute_Value set value = 'F' where value = 'False' ;

    update "+databaseName+"_BN.Attribute_Value set value = 'T' where value = 'True' ;

Clone this wiki locally