You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Ning Zhang (JIRA)" <ji...@apache.org> on 2010/08/27 21:11:57 UTC
[jira] Created: (HIVE-1602) List Partitioning
List Partitioning
-----------------
Key: HIVE-1602
URL: https://issues.apache.org/jira/browse/HIVE-1602
Project: Hadoop Hive
Issue Type: New Feature
Affects Versions: 0.7.0
Reporter: Ning Zhang
Dynamic partition inserts create partitions bases on the dynamic partition column values. Currently it creates one partition for each distinct DP column value. This could result in skews in the created dynamic partitions in that some partitions are large but there could be large number of small partitions as well. This results in burdens in HDFS as well as metastore. A list partitioning scheme that aggregate a number of small partitions into one big one is more preferable for skewed partitions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1602) List Partitioning
Posted by "Joydeep Sen Sarma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903655#action_12903655 ]
Joydeep Sen Sarma commented on HIVE-1602:
-----------------------------------------
how will this be made transparent from queryability perspective? i think i still don't understand the details
i agree - if the user does it themselves they have to duplicate the column. but this doesn't seem like a big deal to me (we compress everything anyway and partitioning columns are highly compressible since they will be repeated like crazy).
my worry is that this change might be a very big one (representing multiple partitions in one storage container). it seems to me a much more fundamental change than just fixing dynamic partitioning.
> List Partitioning
> -----------------
>
> Key: HIVE-1602
> URL: https://issues.apache.org/jira/browse/HIVE-1602
> Project: Hadoop Hive
> Issue Type: New Feature
> Affects Versions: 0.7.0
> Reporter: Ning Zhang
>
> Dynamic partition inserts create partitions bases on the dynamic partition column values. Currently it creates one partition for each distinct DP column value. This could result in skews in the created dynamic partitions in that some partitions are large but there could be large number of small partitions as well. This results in burdens in HDFS as well as metastore. A list partitioning scheme that aggregate a number of small partitions into one big one is more preferable for skewed partitions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1602) List Partitioning
Posted by "Joydeep Sen Sarma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903692#action_12903692 ]
Joydeep Sen Sarma commented on HIVE-1602:
-----------------------------------------
yeah. but i have been asking how you are planning to make the grouping of partitioning transparent. to me that sounds like a very risky and big change and there are no details here.
why would we do this at hive layer given we have HAR already?
i really don't understand why we wouldn't start with hive-1467 and then add HAR as an optimization to reduce number of files for small partitions. this doesn't address the skew case. it doesn't address the fact that we still have to partition by dynamic partitioning columns - and that requires the same partition-only map-reduce operator that 1467 requires. at which point - we can just do 1467.
what am i missing?
> List Partitioning
> -----------------
>
> Key: HIVE-1602
> URL: https://issues.apache.org/jira/browse/HIVE-1602
> Project: Hadoop Hive
> Issue Type: New Feature
> Affects Versions: 0.7.0
> Reporter: Ning Zhang
>
> Dynamic partition inserts create partitions bases on the dynamic partition column values. Currently it creates one partition for each distinct DP column value. This could result in skews in the created dynamic partitions in that some partitions are large but there could be large number of small partitions as well. This results in burdens in HDFS as well as metastore. A list partitioning scheme that aggregate a number of small partitions into one big one is more preferable for skewed partitions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1602) List Partitioning
Posted by "Joydeep Sen Sarma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903606#action_12903606 ]
Joydeep Sen Sarma commented on HIVE-1602:
-----------------------------------------
hmmm - not sure i understand. how can we collapse partitions? we have to generate one directory per distinct DP column value - no?
(or are you thinking of jumping straight to har?)
> List Partitioning
> -----------------
>
> Key: HIVE-1602
> URL: https://issues.apache.org/jira/browse/HIVE-1602
> Project: Hadoop Hive
> Issue Type: New Feature
> Affects Versions: 0.7.0
> Reporter: Ning Zhang
>
> Dynamic partition inserts create partitions bases on the dynamic partition column values. Currently it creates one partition for each distinct DP column value. This could result in skews in the created dynamic partitions in that some partitions are large but there could be large number of small partitions as well. This results in burdens in HDFS as well as metastore. A list partitioning scheme that aggregate a number of small partitions into one big one is more preferable for skewed partitions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1602) List Partitioning
Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903608#action_12903608 ]
Namit Jain commented on HIVE-1602:
----------------------------------
To clarify more, this is not list partitioning in the traditional database sense.
For a table T with the following columns: c1, c2 and partitioning column p:
The user should be able to specify:
For
p = p1, partition name = p1
p = p2, partition name = p2
p = p3, partition name = p3
p = p4,p5,p6,p7 partition name = p4_p7
p = p8,p9,..,p100 partition name = p8_p100
But, during a query, the actual values of p must be returned.
(for eg: p4, and not p4_p7)
> List Partitioning
> -----------------
>
> Key: HIVE-1602
> URL: https://issues.apache.org/jira/browse/HIVE-1602
> Project: Hadoop Hive
> Issue Type: New Feature
> Affects Versions: 0.7.0
> Reporter: Ning Zhang
>
> Dynamic partition inserts create partitions bases on the dynamic partition column values. Currently it creates one partition for each distinct DP column value. This could result in skews in the created dynamic partitions in that some partitions are large but there could be large number of small partitions as well. This results in burdens in HDFS as well as metastore. A list partitioning scheme that aggregate a number of small partitions into one big one is more preferable for skewed partitions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1602) List Partitioning
Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903642#action_12903642 ]
Namit Jain commented on HIVE-1602:
----------------------------------
For the user to do this today, he will have to duplicate the column.
I think we will end up doing the same internally, but if I understand right, the idea is to make it transparent to the user.
> List Partitioning
> -----------------
>
> Key: HIVE-1602
> URL: https://issues.apache.org/jira/browse/HIVE-1602
> Project: Hadoop Hive
> Issue Type: New Feature
> Affects Versions: 0.7.0
> Reporter: Ning Zhang
>
> Dynamic partition inserts create partitions bases on the dynamic partition column values. Currently it creates one partition for each distinct DP column value. This could result in skews in the created dynamic partitions in that some partitions are large but there could be large number of small partitions as well. This results in burdens in HDFS as well as metastore. A list partitioning scheme that aggregate a number of small partitions into one big one is more preferable for skewed partitions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1602) List Partitioning
Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903662#action_12903662 ]
Namit Jain commented on HIVE-1602:
----------------------------------
I don't think it has anything to do with dynamic partitioning.
It is a scheme to reduce the number of partitions/files in the presence of many small partitions
> List Partitioning
> -----------------
>
> Key: HIVE-1602
> URL: https://issues.apache.org/jira/browse/HIVE-1602
> Project: Hadoop Hive
> Issue Type: New Feature
> Affects Versions: 0.7.0
> Reporter: Ning Zhang
>
> Dynamic partition inserts create partitions bases on the dynamic partition column values. Currently it creates one partition for each distinct DP column value. This could result in skews in the created dynamic partitions in that some partitions are large but there could be large number of small partitions as well. This results in burdens in HDFS as well as metastore. A list partitioning scheme that aggregate a number of small partitions into one big one is more preferable for skewed partitions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1602) List Partitioning
Posted by "Joydeep Sen Sarma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903630#action_12903630 ]
Joydeep Sen Sarma commented on HIVE-1602:
-----------------------------------------
yikes. how is this queried afterwards?
the user can do this by doing the transformation namit listed in the select clause (on the partitioning column). the user can do a one time analysis of the data (for size distribution on different partitioning columns) and then generate the clumping logic manually.
because this does not result in queryable data sets - it doesn't seem useful/reusable to me.
> List Partitioning
> -----------------
>
> Key: HIVE-1602
> URL: https://issues.apache.org/jira/browse/HIVE-1602
> Project: Hadoop Hive
> Issue Type: New Feature
> Affects Versions: 0.7.0
> Reporter: Ning Zhang
>
> Dynamic partition inserts create partitions bases on the dynamic partition column values. Currently it creates one partition for each distinct DP column value. This could result in skews in the created dynamic partitions in that some partitions are large but there could be large number of small partitions as well. This results in burdens in HDFS as well as metastore. A list partitioning scheme that aggregate a number of small partitions into one big one is more preferable for skewed partitions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1602) List Partitioning
Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903664#action_12903664 ]
Ning Zhang commented on HIVE-1602:
----------------------------------
@joydeep, this is intended to be an open ended discussions about how to tackle partition skews. Combining small partitions into one large partitions seems to be a natural way. May be the name of list partition is not so obvious, but I meant to map a list of values from the DP column to one partition rather than a 1-to-1 mapping.
HAR is one option and we can keep the partition spec as part of the file name so that the actual column is not stored.
Another way is to store the partition column value in the data file itself if the partition corresponds to a list of values.
> the user can do a one time analysis of the data (for size distribution on different partitioning columns) and then generate the clumping logic manually.
The problem is that there is no way that the user can manually cluster data with different partition column values. for example, if event is a DP column and you find a couple of large partitions event = {'l', 'g'}, and a 3 small partitions event = {'s', 'm', 'l'}. How can the user manually cluster event=s, event=m, event=l into one? If there are a lot of these small partitions it introduces a lot of problems in HDFS, metastore, and Hive client side.
> List Partitioning
> -----------------
>
> Key: HIVE-1602
> URL: https://issues.apache.org/jira/browse/HIVE-1602
> Project: Hadoop Hive
> Issue Type: New Feature
> Affects Versions: 0.7.0
> Reporter: Ning Zhang
>
> Dynamic partition inserts create partitions bases on the dynamic partition column values. Currently it creates one partition for each distinct DP column value. This could result in skews in the created dynamic partitions in that some partitions are large but there could be large number of small partitions as well. This results in burdens in HDFS as well as metastore. A list partitioning scheme that aggregate a number of small partitions into one big one is more preferable for skewed partitions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1602) List Partitioning
Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903686#action_12903686 ]
Ning Zhang commented on HIVE-1602:
----------------------------------
> insert overwrite table xxx partition (event_class) select a,b,c,event, case(event when 's' then 'sml' when 'm' then 'sml' when 'l' then 'sml' else 'g') from ...
This changed the schema of table xxx. Now the user has to change his query to include this event_class in his where clause. no?
> List Partitioning
> -----------------
>
> Key: HIVE-1602
> URL: https://issues.apache.org/jira/browse/HIVE-1602
> Project: Hadoop Hive
> Issue Type: New Feature
> Affects Versions: 0.7.0
> Reporter: Ning Zhang
>
> Dynamic partition inserts create partitions bases on the dynamic partition column values. Currently it creates one partition for each distinct DP column value. This could result in skews in the created dynamic partitions in that some partitions are large but there could be large number of small partitions as well. This results in burdens in HDFS as well as metastore. A list partitioning scheme that aggregate a number of small partitions into one big one is more preferable for skewed partitions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1602) List Partitioning
Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903708#action_12903708 ]
Ning Zhang commented on HIVE-1602:
----------------------------------
I agree this will be a big change and we are tossing the ideas here. We don't have a final plan yet.
HAR is one idea and definitely we should try it once HIVE-1467 is done. But as you said it won't change the # of partitions. Check out some of our tables, which has more than 240 partitions each day. With dynamic partition, it is very easy to increase it even more.
Another idea Namit and I were talking about is to store the mapping from the list of values {'s', 'm', 'l'} to the actual partition location and store this mapping in the metastore. This essentially separates the logical concept of partition from the physical storage location (HDFS directories). This could be a big change and break some users' assumption who are relying on the reverse of the mapping (figuring out partition from the HDFS directory).
If we decide to go this route, inserting is easy as we get the mapping from metastore and decide which directory to write given an output row. Querying is a little bit complicated as the partition prunning phase need to figure out which physical directory a partition correspond to and get the partition column value from the data file itself rather than from the directory name. The overhead is of course the partition column value need extra storage in the data file. But if we sort based on the partitioning column and with RCFile and column level run-length compression (which we have already supported), the storage overhead is very small.
> List Partitioning
> -----------------
>
> Key: HIVE-1602
> URL: https://issues.apache.org/jira/browse/HIVE-1602
> Project: Hadoop Hive
> Issue Type: New Feature
> Affects Versions: 0.7.0
> Reporter: Ning Zhang
>
> Dynamic partition inserts create partitions bases on the dynamic partition column values. Currently it creates one partition for each distinct DP column value. This could result in skews in the created dynamic partitions in that some partitions are large but there could be large number of small partitions as well. This results in burdens in HDFS as well as metastore. A list partitioning scheme that aggregate a number of small partitions into one big one is more preferable for skewed partitions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1602) List Partitioning
Posted by "Joydeep Sen Sarma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903672#action_12903672 ]
Joydeep Sen Sarma commented on HIVE-1602:
-----------------------------------------
> combining small partitions into one large partitions seems to be a natural way.
sure - but i am worried that this is a fundamental change to hive's data model and may not be the quickest/safest solution to what is a pretty urgent problem.
also - HAR solves the small files packed into big file already. and it doesn't require changes to hive's data model. so in that sense it seems like an easy win.
u are still left with the problem of the large partition (skew) problem. this doesn't solve that either (assuming u are using reducers).
> How can the user manually cluster event=s, event=m, event=l into one
insert overwrite table xxx partition (event_class) select a,b,c,event, case(event when 's' then 'sml' when 'm' then 'sml' when 'l' then 'sml' else 'g') from ...
> List Partitioning
> -----------------
>
> Key: HIVE-1602
> URL: https://issues.apache.org/jira/browse/HIVE-1602
> Project: Hadoop Hive
> Issue Type: New Feature
> Affects Versions: 0.7.0
> Reporter: Ning Zhang
>
> Dynamic partition inserts create partitions bases on the dynamic partition column values. Currently it creates one partition for each distinct DP column value. This could result in skews in the created dynamic partitions in that some partitions are large but there could be large number of small partitions as well. This results in burdens in HDFS as well as metastore. A list partitioning scheme that aggregate a number of small partitions into one big one is more preferable for skewed partitions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HIVE-1602) List Partitioning
Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903610#action_12903610 ]
Namit Jain commented on HIVE-1602:
----------------------------------
.. we have to generate one directory per distinct DP column value - no?
That has to change for this to work
> List Partitioning
> -----------------
>
> Key: HIVE-1602
> URL: https://issues.apache.org/jira/browse/HIVE-1602
> Project: Hadoop Hive
> Issue Type: New Feature
> Affects Versions: 0.7.0
> Reporter: Ning Zhang
>
> Dynamic partition inserts create partitions bases on the dynamic partition column values. Currently it creates one partition for each distinct DP column value. This could result in skews in the created dynamic partitions in that some partitions are large but there could be large number of small partitions as well. This results in burdens in HDFS as well as metastore. A list partitioning scheme that aggregate a number of small partitions into one big one is more preferable for skewed partitions.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.