You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by Ravindra Pesala <ra...@gmail.com> on 2016/11/27 17:51:02 UTC
[New Feature] Adding bucketed table feature to Carbondata
Hi All,
Bucketing concept is based on the hash partition the bucketed column as per
configured bucket numbers. Records with same bucketed column always goes to
the same same bucket. Physically each bucket is a file/files in table
directory.
Advantages
Bucketed table is useful feature to do the map side joins and avoids
shuffling of data.
Carbondata can do driver level pruning on bucketed column to improve query
performance.
User can add bucketed table as follows
CREATE TABLE test(user_id BIGINT, firstname STRING, lastname STRING)
CLUSTERED BY(user_id) INTO 32 BUCKETS;
In the above example column user_id is hash partitioned and creates 32
buckets/partitions files in carbondata. So while doing the join with other
table on bucketed column it can select same buckets and do the join with
out shuffling.
Carbon creates following folder structure currently, since carbon is
already supporting partitioning in its file format
dbName -> tableName - > Fact ->
Part0 ->Segment_id ->
carbondatafiles
Part1 ->Segment_id ->
carbondatafiles
we can also move the partitionid to file metadata.But if we move the
partitionId to metadata then there would be complications in backward
compatibility.
--
Thanks & Regards,
Ravindra
Re: [New Feature] Adding bucketed table feature to Carbondata
Posted by Ravindra Pesala <ra...@gmail.com>.
Hi Raghu,
In Hive's or Spark's terminology Partitioning and bucketing are different.
Partitioning divides the large amount of data into number pieces of folders
based on table columns value.Here the number partitions created is
depending upon the cardinality of that partitioned column. So it is very
in-effective if cardinality is higher.
In other hand Bucketing can divide the data into equal parts(user
configurable number) depends on hashing of that column. It is useful for
high cardinality columns.
Regards,
Ravindra
On 27 November 2016 at 23:24, Raghunandan S <
carbondatacontributions@gmail.com> wrote:
> How is this different from partitioning?
> On Sun, 27 Nov 2016 at 11:21 PM, Ravindra Pesala <ra...@gmail.com>
> wrote:
>
> > Hi All,
> >
> > Bucketing concept is based on the hash partition the bucketed column as
> per
> > configured bucket numbers. Records with same bucketed column always goes
> to
> > the same same bucket. Physically each bucket is a file/files in table
> > directory.
> > Advantages
> > Bucketed table is useful feature to do the map side joins and avoids
> > shuffling of data.
> > Carbondata can do driver level pruning on bucketed column to improve
> query
> > performance.
> >
> > User can add bucketed table as follows
> >
> > CREATE TABLE test(user_id BIGINT, firstname STRING, lastname STRING)
> > CLUSTERED BY(user_id) INTO 32 BUCKETS;
> >
> > In the above example column user_id is hash partitioned and creates 32
> > buckets/partitions files in carbondata. So while doing the join with
> other
> > table on bucketed column it can select same buckets and do the join with
> > out shuffling.
> >
> > Carbon creates following folder structure currently, since carbon is
> > already supporting partitioning in its file format
> >
> > dbName -> tableName - > Fact ->
> >
> > Part0 ->Segment_id ->
> > carbondatafiles
> >
> > Part1 ->Segment_id ->
> > carbondatafiles
> >
> > we can also move the partitionid to file metadata.But if we move the
> > partitionId to metadata then there would be complications in backward
> > compatibility.
> > --
> > Thanks & Regards,
> > Ravindra
> >
>
--
Thanks & Regards,
Ravi
Re: [New Feature] Adding bucketed table feature to Carbondata
Posted by Raghunandan S <ca...@gmail.com>.
How is this different from partitioning?
On Sun, 27 Nov 2016 at 11:21 PM, Ravindra Pesala <ra...@gmail.com>
wrote:
> Hi All,
>
> Bucketing concept is based on the hash partition the bucketed column as per
> configured bucket numbers. Records with same bucketed column always goes to
> the same same bucket. Physically each bucket is a file/files in table
> directory.
> Advantages
> Bucketed table is useful feature to do the map side joins and avoids
> shuffling of data.
> Carbondata can do driver level pruning on bucketed column to improve query
> performance.
>
> User can add bucketed table as follows
>
> CREATE TABLE test(user_id BIGINT, firstname STRING, lastname STRING)
> CLUSTERED BY(user_id) INTO 32 BUCKETS;
>
> In the above example column user_id is hash partitioned and creates 32
> buckets/partitions files in carbondata. So while doing the join with other
> table on bucketed column it can select same buckets and do the join with
> out shuffling.
>
> Carbon creates following folder structure currently, since carbon is
> already supporting partitioning in its file format
>
> dbName -> tableName - > Fact ->
>
> Part0 ->Segment_id ->
> carbondatafiles
>
> Part1 ->Segment_id ->
> carbondatafiles
>
> we can also move the partitionid to file metadata.But if we move the
> partitionId to metadata then there would be complications in backward
> compatibility.
> --
> Thanks & Regards,
> Ravindra
>