Uploaded image for project: 'AdMaxLocal'
  1. AdMaxLocal
  2. AML-3414

Update tmp DB to include firstPageCpc field in all tables

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Rushmore
    • Fix Version/s: Rushmore
    • Component/s: Data Summarization
    • Labels:
      None
    • Sprint:
      Sprint 7

      Description

      If firstPageCpc is not inserted the following error is seen on running whsummarize.sh

      2015-03-05 11:07:42.818 (1) [P1T1]: Exception [error inserting SQL rows into `tmp`.`searchEngineActivitySummary201503` from file /tmp/sesummUser1247Activity8746691757292457171.csv]:java.sql.BatchUpdateException: Unknown column 'firstPageCpc' in 'field list'
      at com.mysql.jdbc.PreparedStatement.executePreparedBatchAsMultiStatement(PreparedStatement.java:1653)
      at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1463)
      at com.thesearchagency.db.util.BatchInsertUtil.parseFileUsingSplit(BatchInsertUtil.java:345)
      at com.thesearchagency.db.util.BatchInsertUtil.batchInsertFromFile(BatchInsertUtil.java:156)
      at com.thesearchagency.db.util.BatchInsertUtil.batchInsertFromFile(BatchInsertUtil.java:83)
      at com.thesearchagency.db.util.BatchInsertUtil.batchInsertFromFile(BatchInsertUtil.java:60)
      at com.thesearchagency.searchengines.SearchEngineSummarizer$SearchEngineUserWorker.loadDataInfile(SearchEngineSummarizer.java:1027)
      at com.thesearchagency.searchengines.SearchEngineSummarizer$SearchEngineUserWorker.loadDataIntoTable(SearchEngineSummarizer.java:928)
      at com.thesearchagency.searchengines.SearchEngineSummarizer$SearchEngineUserWorker.call(SearchEngineSummarizer.java:565)
      at com.thesearchagency.searchengines.SearchEngineSummarizer$SearchEngineUserWorker.call(SearchEngineSummarizer.java:386)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'firstPageCpc' in 'field list'
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
      at com.mysql.jdbc.Util.getInstance(Util.java:386)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
      at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2815)
      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
      at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1379)
      at com.mysql.jdbc.PreparedStatement.executePreparedBatchAsMultiStatement(PreparedStatement.java:1583)
      ... 14 more

      This has been worked around by inserting the field.
      alter table tmp.searchEngineActivitySummary201503 add column `firstPageCpc` double DEFAULT NULL;

      Ross's comment:
      There isn't a query to alter the table. In my testing I think I happened to use 2015-03-01 which would have created the table (with the new column). You could delete the old table to see if that would work, but it does raise an issue where all the old tables would be missing the column. Let me talk to Phej a bit about this. I might need to add a script to update all the existing tables.

        Attachments

          Activity

            People

            • Assignee:
              rgardner Ross Gardner
              Reporter:
              varshini.padmanabhan Varshini Padmanabhan (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: