Hive
  1. Hive
  2. HIVE-790

race condition related to ScriptOperator + UnionOperator

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.4.0
    • Component/s: Query Processor
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      ScriptOperator uses a second thread to output the rows to the children operators. In a corner case which contains a union, 2 threads might be outputting data into the same operator hierarchy and caused race conditions.

      CREATE TABLE tablea (cola STRING);
      SELECT *
      FROM (
          SELECT TRANSFORM(cola)
          USING 'cat'
          AS cola
          FROM tablea
        UNION ALL
          SELECT cola as cola
          FROM tablea
      ) a;
      
      1. Hive_790_0.4.0.patch
        18 kB
        Ning Zhang
      2. Hive-790_4.patch
        19 kB
        Ning Zhang
      3. Hive-790_3.patch
        12 kB
        Ning Zhang
      4. Hive-790_2.patch
        12 kB
        Ning Zhang
      5. Hive-790.patch
        11 kB
        Ning Zhang

        Activity

        Zheng Shao created issue -
        Zheng Shao made changes -
        Field Original Value New Value
        Description ScriptOperator uses a second thread to output the rows to the children operators. In a corner case which contains a union, 2 threads might be outputting data into the same operator hierarchy and caused race conditions.

        {code}
        SELECT *
        FROM (
            SELECT TRANSFORM(cola)
            USING 'cat'
            AS cola
            FROM tablea
          UNION ALL
            SELECT cola
            FROM tablea
        ) a;
        {code}
        ScriptOperator uses a second thread to output the rows to the children operators. In a corner case which contains a union, 2 threads might be outputting data into the same operator hierarchy and caused race conditions.

        {code}
        CREATE TABLE tablea (cola STRING);
        SELECT *
        FROM (
            SELECT TRANSFORM(cola)
            USING 'cat'
            AS cola
            FROM tablea
          UNION ALL
            SELECT cola as cola
            FROM tablea
        ) a;
        {code}
        Zheng Shao made changes -
        Assignee Ning Zhang [ nzhang ]
        Ning Zhang made changes -
        Attachment Hive-790.patch [ 12417833 ]
        Ning Zhang made changes -
        Attachment Hive-790_2.patch [ 12417848 ]
        Ning Zhang made changes -
        Attachment Hive-790_3.patch [ 12417913 ]
        Ning Zhang made changes -
        Attachment Hive-790_4.patch [ 12418042 ]
        Namit Jain made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Hadoop Flags [Reviewed]
        Resolution Fixed [ 1 ]
        Namit Jain made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Ning Zhang made changes -
        Attachment Hive_790_0.4.0.patch [ 12418293 ]
        Namit Jain made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Carl Steinbach made changes -
        Fix Version/s 0.4.0 [ 12313714 ]
        Component/s Query Processor [ 12312586 ]
        Carl Steinbach made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development