Some operators of `Dataset` create a new `Dataset` and update the logical plan, like 'filter' as below:

```
def filter(condition: Column): Dataset[T] = withTypedPlan {
  Filter(condition.expr, logicalPlan)
}

```

But there are operators, like `groupBy`, that create a different type of `Dataset`, i.e. `RelationalGroupedDataset`.

Why doesn't Spark create a new Dataset with a LogicalPlan which can express `groupBy`?

```
@scala.annotation.varargs
def groupBy(cols: Column*): RelationalGroupedDataset = {
  RelationalGroupedDataset(toDF(), cols.map(_.expr), RelationalGroupedDataset.GroupByType)
}

```