Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-23756

Added more constraints to the package.jdo file

    XMLWordPrintableJSON

Details

    Description

      Drop table command fails intermittently with the following exception.

      Caused by: java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails ("metastore"."COLUMNS_V2", CONSTRAINT "COLUMNS_V2_FK1" FOREIGN KEY ("CD_ID") REFERENCES "CDS" ("CD_ID")) App > at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1815)at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1277) Appat org.datanucleus.store.rdbms.ParamLoggingPreparedStatement.executeBatch(ParamLoggingPreparedStatement.java:372)
      at org.datanucleus.store.rdbms.SQLController.processConnectionStatement(SQLController.java:628)
      at org.datanucleus.store.rdbms.SQLController.getStatementForUpdate(SQLController.java:207)
      at org.datanucleus.store.rdbms.SQLController.getStatementForUpdate(SQLController.java:179)
      at org.datanucleus.store.rdbms.scostore.JoinMapStore.clearInternal(JoinMapStore.java:901)
      ... 36 more 
      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails ("metastore"."COLUMNS_V2", CONSTRAINT "COLUMNS_V2_FK1" FOREIGN KEY ("CD_ID") REFERENCES "CDS" ("CD_ID"))
      at sun.reflect.GeneratedConstructorAccessor121.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
      at com.mysql.jdbc.Util.getInstance(Util.java:360)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:971)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)

      Although HIVE-19994 resolves this issue, the FK constraint name of COLUMNS_V2 table specified in package.jdo file is not same as the FK constraint name used while creating COLUMNS_V2 table (Ref]). 

      Attachments

        1. HIVE-23756.1.patch
          0.7 kB
          Ganesha Shreedhara

        Issue Links

          Activity

            People

              scarlin Steve Carlin
              ganeshas Ganesha Shreedhara
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m