Source:
<code>public ScanQuery( @JsonProperty("dataSource") DataSource dataSource, @JsonProperty("intervals") QuerySegmentSpec querySegmentSpec, @JsonProperty("virtualColumns") VirtualColumns virtualColumns, @JsonProperty("resultFormat") ResultFormat resultFormat, @JsonProperty("batchSize") int batchSize, @JsonProperty("limit") long limit, @JsonProperty("order") Order order, @JsonProperty("filter") DimFilter dimFilter, @JsonProperty("columns") List<String> columns, @JsonProperty("legacy") Boolean legacy, @JsonProperty("context") Map<String, Object> context ) { super(dataSource, querySegmentSpec, false, context); this.virtualColumns = VirtualColumns.nullToEmpty(virtualColumns); this.resultFormat = (resultFormat == null) ? ResultFormat.RESULT_FORMAT_LIST : resultFormat; this.batchSize = (batchSize == 0) ? 4096 * 5 : batchSize; Preconditions.checkArgument( this.batchSize > 0, "batchSize must be greater than 0" ); this.limit = (limit == 0) ? Long.MAX_VALUE : limit; Preconditions.checkArgument( this.limit > 0, "limit must be greater than 0" ); this.dimFilter = dimFilter; this.columns = columns; this.legacy = legacy; this.order = (order == null) ? Order.NONE : order; if (order != Order.NONE) { Preconditions.checkArgument( <START> (columns.contains(ColumnHolder.TIME_COLUMN_NAME)), <END> "The __time column must be selected if the results are time-ordered." ); } this.maxRowsQueuedForOrdering = validateAndGetMaxRowsQueuedForOrdering(); this.maxSegmentPartitionsOrderedInMemory = validateAndGetMaxSegmentPartitionsOrderedInMemory(); }</code><technical_language>I columns null empty, in this case, columns included. check invalid then. verify a unit test, fix if needed</technical_language>

Target:
public ScanQuery( @JsonProperty("dataSource") DataSource dataSource, @JsonProperty("intervals") QuerySegmentSpec querySegmentSpec, @JsonProperty("virtualColumns") VirtualColumns virtualColumns, @JsonProperty("resultFormat") ResultFormat resultFormat, @JsonProperty("batchSize") int batchSize, @JsonProperty("limit") long limit, @JsonProperty("order") Order order, @JsonProperty("filter") DimFilter dimFilter, @JsonProperty("columns") List<String> columns, @JsonProperty("legacy") Boolean legacy, @JsonProperty("context") Map<String, Object> context ) { super(dataSource, querySegmentSpec, false, context); this.virtualColumns = VirtualColumns.nullToEmpty(virtualColumns); this.resultFormat = (resultFormat == null) ? ResultFormat.RESULT_FORMAT_LIST : resultFormat; this.batchSize = (batchSize == 0) ? 4096 * 5 : batchSize; Preconditions.checkArgument( this.batchSize > 0, "batchSize must be greater than 0" ); this.limit = (limit == 0) ? Long.MAX_VALUE : limit; Preconditions.checkArgument( this.limit > 0, "limit must be greater than 0" ); this.dimFilter = dimFilter; this.columns = columns; this.legacy = legacy; this.order = (order == null) ? Order.NONE : order; if (this.order != Order.NONE) { Preconditions.checkArgument( columns == null || columns.size() == 0 || columns.contains(ColumnHolder.TIME_COLUMN_NAME), "The __time column must be selected if the results are time-ordered." ); } this.maxRowsQueuedForOrdering = validateAndGetMaxRowsQueuedForOrdering(); this.maxSegmentPartitionsOrderedInMemory = validateAndGetMaxSegmentPartitionsOrderedInMemory(); }