Kapacitor fill() seems to have no effect on batch queries

I’m trying to compute summary data over series data that may have gaps. I would like to fill with the previous value in case of gaps, but would settle for being able to fill with zeros. My tickscript looks like this:

var SQL = '''SELECT "duration"
             FROM "desktop_client"."default"."profiling_metrics"''''

var hour_batched = batch

var hour_median = hour_batched

Any value I use for .fill() (previous, 0, null, etc.) yields the same results, and hours with missing values in the original series are also missing data in the transformed series. I have tried putting ‘GROUP BY/FILL’ in the influx query as well, with no results.

What am I doing wrong?