Add columns to a dataset in module sdk

I have a BasicStreamingDataset "dataset" that I obtained from a queryHistory in java, I want to add additional columns to it but I have problems to do it or how you could create a new dataset with the columns you wish from the one obtained in the query?.

You have to make a new one and copy the rows. Datasets are not mutable after creation. (Well, not supposed to be.)

Create a new dataset using system.dataset.addColumn, then replace the original dataset with the new one. The added column will need to have the exact same number of rows as the original dataset.