IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 12, 2014, 12:05:37 PM (12 years ago)
Author:
heather
Message:

small schema tweaks, as well as we now populate stackDetectRowID in
stackObjectThin / stackObjectAttributes tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/stackbatch.py

    r37577 r37586  
    293293        self.generateRandomIDs()
    294294
     295        self.generateStackDetectRowIDs()
     296
    295297        # add indexes StackObjectThin
    296298        self.scratchDb.createIndex("StackObjectThin", "objID")
     
    382384        self.logger.infoPair("Procesing table", tablename)
    383385        self.insertDvoIDs(tablename, "StackObjectThin")
    384 
     386       
    385387        # if we are going to add a key, do it here so it is useful
    386388        self.scratchDb.createIndex(tablename, "objID")
     
    949951
    950952
     953    def generateStackDetectRowIDs(self):
     954        sql = "UPDATE StackObjectThin join (select @r:=@r+1 rownum, objID from \
     955        (select @r:=0) r, StackObjectThin t) as foo using (objID) set \
     956        stackDetectRowID = ((" + str(self.batchID) + " << 32 ) + rownum)";
     957        try: self.scratchDb.execute(sql)
     958        except:
     959            self.logger.errorPair('failed sql',sql)
     960            return
     961       
     962
    951963    '''
    952964    select objID (psps object ID) from dvo restricted to this set of imageIDs. also insert
     
    10081020            if (i < len(self.filters) - 1):
    10091021                fields += ", "
    1010        
     1022
     1023        if (table == "StackObjectAttributes"):
     1024            fields += "stackDetectRowID, "
    10111025        sql  = "INSERT INTO " + table + " (" + fields + ") "
    10121026        sql += "SELECT " + fields + " FROM " + mainTable
     
    10161030            self.logger.errorPair('failed sql',sql)
    10171031            return
    1018    
     1032
     1033
     1034       
    10191035    '''
    10201036    Does the processing, i.e. pulling stuff from IPP tables into PSPS tables
Note: See TracChangeset for help on using the changeset viewer.