apache/druid · critical · RuntimeException
The 'select' query has been removed, use 'scan' instead…
Error message
The 'select' query has been removed, use 'scan' instead. See https://druid.apache.org/docs/latest/querying/select-query.html for more details.
What it means
SelectQuery was removed from Druid; its constructor and all methods unconditionally throw RuntimeException pointing to the scan query as the replacement. The class is retained only so deserialization fails loudly with an actionable message. Any code or query JSON still creating a 'select' query hits this error.
Solutions
- Replace queryType 'select' with 'queryType':'scan' in query JSON
- Migrate query-building code to use ScanQuery instead of SelectQuery
- Rewrite stored/dynamic queries and dashboards to the scan API
Example fix
// before
{"queryType":"select", "dataSource":"ds"}
// after
{"queryType":"scan", "dataSource":"ds", "columns":[], "batchSize":20480} Defensive patterns
Strategy: type-guard
Validate before calling
if ("select".equals(queryJson.get("queryType"))) { throw new IllegalArgumentException("select query removed; use scan"); } Type guard
boolean isRemovedSelectQuery(Map<String,Object> q) { return "select".equals(q.get("queryType")); } Try / catch
try { runQuery(json); } catch (RuntimeException e) { if (e.getMessage().contains("'select' query has been removed")) { migrateToScanQuery(json); } else throw e; } Prevention
- Search codebases and stored queries for queryType 'select' before upgrades
- Convert select queries to scan queries proactively
- Pin client SDK/doc versions to match server Druid version
When it happens
Trigger: Submitting a JSON query with queryType 'select' (Jackson @JsonCreator constructor throws); referencing SelectQuery in Java code; old clients or dashboards still emitting select queries.
Common situations: Upgrading legacy pipelines written before the select->scan removal; stored queries or monitoring scripts using select; tutorials with outdated query JSON.
Understand the failure class
Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.
Related errors
- Cannot apply limit[ ] with offset[ ] due to overflow
- Cannot execute query with orderBy
- Cannot provide 'order' incompatible with 'orderBy'
- Column [ ] from 'orderBy' must also appear in 'columns'.
- Got a [ ] which isn't a
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/48c0ec47dea6bacb.
Report an issue: GitHub.
Appendix: source
Thrown at processing/src/main/java/org/apache/druid/query/select/SelectQuery.java:50
import org.joda.time.Duration;
import org.joda.time.Interval;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Map;
@Deprecated
public class SelectQuery implements Query<Object>
{
static final String REMOVED_ERROR_MESSAGE =
"The 'select' query has been removed, use 'scan' instead. See "
+ "https://druid.apache.org/docs/latest/querying/select-query.html for more details.";
@JsonCreator
public SelectQuery()
{
throw new RuntimeException(REMOVED_ERROR_MESSAGE);
}
@Override
public DataSource getDataSource()
{
throw new RuntimeException(REMOVED_ERROR_MESSAGE);
}
@Override
public boolean hasFilters()
{
throw new RuntimeException(REMOVED_ERROR_MESSAGE);
}
@Override
public DimFilter getFilter()
{
throw new RuntimeException(REMOVED_ERROR_MESSAGE);View on GitHub (pinned to 9b90983fd2)