Hive
  1. Hive
  2. HIVE-2568

HIVE-2246 upgrade script needs to drop foreign key in COLUMNS_OLD

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.8.0
    • Component/s: Metastore
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      One more bug in the MySQL metastore upgrade script: the foreign key in COLUMNS needs to be dropped, otherwise drop_partition will fail because the SDS row cannot be deleted due to the foreign key constraint.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1d 3h 25m 1 Namit Jain 11/Nov/11 23:12
        Resolved Resolved Reopened Reopened
        3d 1h 8m 1 Carl Steinbach 15/Nov/11 00:20
        Reopened Reopened Resolved Resolved
        3d 55m 1 Carl Steinbach 18/Nov/11 01:16
        Resolved Resolved Closed Closed
        28d 22h 39m 1 Carl Steinbach 16/Dec/11 23:56
        Carl Steinbach made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Carl Steinbach made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Fix Version/s 0.9.0 [ 12317742 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in Hive-0.8.0-SNAPSHOT-h0.21 #98 (See https://builds.apache.org/job/Hive-0.8.0-SNAPSHOT-h0.21/98/)
        backporting HIVE-2568 (rev. 1201091)

        nzhang : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1202945
        Files :

        • /hive/branches/branch-0.8
        • /hive/branches/branch-0.8/README.txt
        • /hive/branches/branch-0.8/contrib/src/java/org/apache/hadoop/hive/contrib/udaf/example/UDAFExampleMax.java
        • /hive/branches/branch-0.8/contrib/src/java/org/apache/hadoop/hive/contrib/udaf/example/UDAFExampleMin.java
        • /hive/branches/branch-0.8/metastore/scripts/upgrade/mysql/008-HIVE-2246.mysql.sql
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/io/NonSyncDataInputBuffer.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/io/NonSyncDataOutputBuffer.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/DefaultGraphWalker.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/DefaultRuleDispatcher.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/Dispatcher.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/GraphWalker.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/NodeProcessor.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/NodeProcessorCtx.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/Rule.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/RuleRegExp.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/parse/JoinCond.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/parse/JoinType.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/AggregationDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/AlterTableDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/CollectDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/CopyWork.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateFunctionDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateTableDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateTableLikeDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateViewDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/DDLDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/DescFunctionDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/DescTableDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/DropFunctionDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/DropTableDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/Explain.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExplainWork.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExplosionDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeColumnDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeConstantDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeFieldDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeNullDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExtractDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/FetchWork.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/FileSinkDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/FilterDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ForwardDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/GroupByDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/JoinCondDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/JoinDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/LateralViewJoinDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/LimitDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadFileDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadTableDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/MapJoinDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/MapredLocalWork.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/MapredWork.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/MoveWork.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/PartitionDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ReduceSinkDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/SchemaDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ScriptDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/SelectDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowFunctionsDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowPartitionsDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTableStatusDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTablesDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/TableDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/TableScanDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/UDTFDesc.java
        • /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/UnionDesc.java
        • /hive/branches/branch-0.8/serde/README.txt
        • /hive/branches/branch-0.8/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyFactory.java
        • /hive/branches/branch-0.8/serde/src/java/org/apache/hadoop/hive/serde2/typeinfo
        Show
        Hudson added a comment - Integrated in Hive-0.8.0-SNAPSHOT-h0.21 #98 (See https://builds.apache.org/job/Hive-0.8.0-SNAPSHOT-h0.21/98/ ) backporting HIVE-2568 (rev. 1201091) nzhang : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1202945 Files : /hive/branches/branch-0.8 /hive/branches/branch-0.8/README.txt /hive/branches/branch-0.8/contrib/src/java/org/apache/hadoop/hive/contrib/udaf/example/UDAFExampleMax.java /hive/branches/branch-0.8/contrib/src/java/org/apache/hadoop/hive/contrib/udaf/example/UDAFExampleMin.java /hive/branches/branch-0.8/metastore/scripts/upgrade/mysql/008- HIVE-2246 .mysql.sql /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/io/NonSyncDataInputBuffer.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/io/NonSyncDataOutputBuffer.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/DefaultGraphWalker.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/DefaultRuleDispatcher.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/Dispatcher.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/GraphWalker.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/NodeProcessor.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/NodeProcessorCtx.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/Rule.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/lib/RuleRegExp.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/parse/JoinCond.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/parse/JoinType.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/AggregationDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/AlterTableDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/CollectDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/CopyWork.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateFunctionDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateTableDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateTableLikeDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateViewDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/DDLDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/DescFunctionDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/DescTableDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/DropFunctionDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/DropTableDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/Explain.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExplainWork.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExplosionDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeColumnDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeConstantDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeFieldDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeNullDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ExtractDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/FetchWork.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/FileSinkDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/FilterDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ForwardDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/GroupByDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/JoinCondDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/JoinDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/LateralViewJoinDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/LimitDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadFileDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadTableDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/MapJoinDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/MapredLocalWork.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/MapredWork.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/MoveWork.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/PartitionDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ReduceSinkDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/SchemaDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ScriptDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/SelectDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowFunctionsDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowPartitionsDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTableStatusDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTablesDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/TableDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/TableScanDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/UDTFDesc.java /hive/branches/branch-0.8/ql/src/java/org/apache/hadoop/hive/ql/plan/UnionDesc.java /hive/branches/branch-0.8/serde/README.txt /hive/branches/branch-0.8/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyFactory.java /hive/branches/branch-0.8/serde/src/java/org/apache/hadoop/hive/serde2/typeinfo
        Hide
        Ning Zhang added a comment -

        backported to 0.8.0

        Show
        Ning Zhang added a comment - backported to 0.8.0
        Carl Steinbach made changes -
        Priority Major [ 3 ] Blocker [ 1 ]
        Carl Steinbach made changes -
        Component/s Metastore [ 12312584 ]
        Carl Steinbach made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Carl Steinbach added a comment -

        @Ning: Can you please backport this 0.8.0? Thanks.

        Show
        Carl Steinbach added a comment - @Ning: Can you please backport this 0.8.0? Thanks.
        Hide
        Hudson added a comment -

        Integrated in Hive-trunk-h0.21 #1079 (See https://builds.apache.org/job/Hive-trunk-h0.21/1079/)
        HIVE-2568 HIVE-2246 upgrade script needs to drop foreign key in COLUMNS_OLD
        (Ning Zhang via namit)

        namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1201091
        Files :

        • /hive/trunk/metastore/scripts/upgrade/mysql/008-HIVE-2246.mysql.sql
        Show
        Hudson added a comment - Integrated in Hive-trunk-h0.21 #1079 (See https://builds.apache.org/job/Hive-trunk-h0.21/1079/ ) HIVE-2568 HIVE-2246 upgrade script needs to drop foreign key in COLUMNS_OLD (Ning Zhang via namit) namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1201091 Files : /hive/trunk/metastore/scripts/upgrade/mysql/008- HIVE-2246 .mysql.sql
        Namit Jain made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Resolution Fixed [ 1 ]
        Hide
        Namit Jain added a comment -

        Committed. Thanks Ning

        Show
        Namit Jain added a comment - Committed. Thanks Ning
        Hide
        Namit Jain added a comment -

        +1

        running tests

        Show
        Namit Jain added a comment - +1 running tests
        Phabricator made changes -
        Field Original Value New Value
        Attachment D369.1.patch [ 12503282 ]
        Hide
        Phabricator added a comment -

        nzhang requested code review of "HIVE-2568 [jira] HIVE-2246 upgrade script needs to drop foreign key in COLUMNS_OLD".
        Reviewers: JIRA

        the foreign key in COLUMNS needs to be dropped, otherwise drop_partition will fail because the SDS row cannot be deleted due to the foreign key constraint.

        One more bug in the MySQL metastore upgrade script: the foreign key in COLUMNS needs to be dropped, otherwise drop_partition will fail because the SDS row cannot be deleted due to the foreign key constraint.

        TEST PLAN
        EMPTY

        REVISION DETAIL
        https://reviews.facebook.net/D369

        AFFECTED FILES
        metastore/scripts/upgrade/mysql/008-HIVE-2246.mysql.sql

        MANAGE HERALD DIFFERENTIAL RULES
        https://reviews.facebook.net/herald/view/differential/

        WHY DID I GET THIS EMAIL?
        https://reviews.facebook.net/herald/transcript/735/

        Tip: use the X-Herald-Rules header to filter Herald messages in your client.

        Show
        Phabricator added a comment - nzhang requested code review of " HIVE-2568 [jira] HIVE-2246 upgrade script needs to drop foreign key in COLUMNS_OLD". Reviewers: JIRA the foreign key in COLUMNS needs to be dropped, otherwise drop_partition will fail because the SDS row cannot be deleted due to the foreign key constraint. One more bug in the MySQL metastore upgrade script: the foreign key in COLUMNS needs to be dropped, otherwise drop_partition will fail because the SDS row cannot be deleted due to the foreign key constraint. TEST PLAN EMPTY REVISION DETAIL https://reviews.facebook.net/D369 AFFECTED FILES metastore/scripts/upgrade/mysql/008- HIVE-2246 .mysql.sql MANAGE HERALD DIFFERENTIAL RULES https://reviews.facebook.net/herald/view/differential/ WHY DID I GET THIS EMAIL? https://reviews.facebook.net/herald/transcript/735/ Tip: use the X-Herald-Rules header to filter Herald messages in your client.
        Ning Zhang created issue -

          People

          • Assignee:
            Ning Zhang
            Reporter:
            Ning Zhang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development