Questions about single-dimension partitioning

According to the druid docs, single-dimension range partitioning works by first selecting a dimension to partition on, and then separating that dimension into contiguous ranges. Each segment will contain all rows with values of that dimension in that range. For example, your segments may be partitioned on the dimension “host” using the ranges “a.example.com” to “f.example.com” and “f.example.com” to “z.example.com”. By default, the dimension to use is determined automatically, although you can override it with a specific dimension. So I have a list of questions regarding this partitioning:

  1. In single dimension partitioning, how does druid decide the ranges for each segment, i.e., how are the start and end values of range figured out? If we don’t give a partitionDimension, how is the dimension selected on which the partitioning will be based upon?

  2. What are the differences between the terms: partition, shard, bucket, partitionChunk, chunk?

  3. What is the difference between SingleDimensionShardSpec and SingleDimensionPartitionSpec?

  4. Why do we need a maxPartitionSize field when we have a targetPartitionSize?

  5. Does single dimension partitioning also works for realtime ingestion?

  6. There is a assumeGrouped configuration option which if set to no perform some grouping operation. Is this grouping operation same as rollup?

Thank you in advance.