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

Enable Hive on Tez to provide globally sorted clustered table

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Hive, Tez
    • None
    • Patch

    Description

      CREATE TABLE `test`(
         `time` int,
         `userid` bigint)
       CLUSTERED BY (
         userid)
       SORTED BY (
         userid ASC)
       INTO 4 BUCKETS
       ;
      

      I'm new to hive. When I tried to use hive to store my data, I met the fallowing questions.

      When insert data into this table, the data will be sorted into 4 buckets automatically. But because hive uses hash partitioner by default, the data is only sorted in each bucket and isn't sorted among different buckets. Sometimes we need the data to be globally sorted, to optimizing indexing, for example.

      If we can sample the table first and use TotalOrderPartitioner, this work could be done. The difficulty is how do we automatically decide when to use TotalOrderPartitioner and when not, because a insertion query can be complex, which results in a complex DAG in Tez.

      I have implemented a temporary version. It uses a customer partitioner which combines hash partitioner and totalorder partitioner. A physical optimizer is added to hive to decide to choose which partitioner. But in order to reduce the work load, this version should affect tez source code, which is not necessary in fact.

      I'm wondering if we can implement a more common version which addresses this issue.

      Attachments

        1. CombinedPartitioner.txt
          18 kB
          LingXiao Lan
        2. HIVE-18049.1.patch
          15 kB
          LingXiao Lan
        3. tez-0.8.5.txt
          3 kB
          LingXiao Lan

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned Assign to me
            lanl001 LingXiao Lan

            Dates

              Created:
              Updated:

              Slack

                Issue deployment