apache/druid · info
SQL text for query [ ] exceeds [%,d] bytes and will be…
Error message
SQL text for query [%s] exceeds [%,d] bytes and will be truncated in the sql job facet
What it means
The OpenLineage sql job facet has a maximum length (SQL_FACET_MAX_LENGTH). When a query's SQL text exceeds that limit, the facet embeds only the truncated SQL and this warning records that truncation occurred. The event is still emitted; only the facet text is cut.
Solutions
- Reduce query text size (parameterize literals instead of inlining them)
- Accept the truncation — lineage still records a query prefix; verify downstream consumers tolerate truncated sql
- If the max length is too small for your workflows, adjust SQL_FACET_MAX_LENGTH in the extension configuration and rebuild
- Downstream: match facet text against queryId, not the truncated SQL string
Defensive patterns
Strategy: validation
Validate before calling
if (sql != null && sql.length() > SQL_FACET_MAX_LENGTH) {
sql = sql.substring(0, SQL_FACET_MAX_LENGTH); // pre-truncate before sending
} Prevention
- Parameterize SQL instead of inlining large literals
- Match lineage facets by queryId, not SQL text
- Size SQL_FACET_MAX_LENGTH to your workload
When it happens
Trigger: Running a SQL query whose text length exceeds SQL_FACET_MAX_LENGTH (very large literals, huge IN lists, generated SQL, comments, or machine-generated queries) while the OpenLineage request logger builds the job facet.
Common situations: BI tools or ORMs generating giant SQL statements; queries with thousands of values in an IN clause; users pasting large INSERT ... VALUES blocks.
Understand the failure class
Background: payload too large / request exceeds maximum size: why libraries cap bytes and how to fix oversize payloads — this error's family across 50 libraries.
Related errors
- argument must be a LONG constant
- Cannot filter datasource
- Cannot handle constant condition
- Cannot handle equality condition involving left-hand…
- Cannot handle non-equijoin condition
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/67ea6ae4d0d1ff76.
Report an issue: GitHub.
Appendix: source
Thrown at extensions-contrib/openlineage-emitter/src/main/java/org/apache/druid/extensions/openlineage/OpenLineageRequestLogger.java:411
private ObjectNode buildJob(String queryId, @Nullable String sql)
{
ObjectNode job = jsonMapper.createObjectNode();
job.put("namespace", namespace);
job.put("name", queryId);
ObjectNode facets = jsonMapper.createObjectNode();
ObjectNode jobTypeFacet = createFacet(JOB_TYPE_FACET_SCHEMA_URL);
jobTypeFacet.put("processingType", "BATCH");
jobTypeFacet.put("integration", "DRUID");
jobTypeFacet.put("jobType", "QUERY");
facets.set("jobType", jobTypeFacet);
if (sql != null) {
ObjectNode sqlFacet = createFacet(SQL_FACET_SCHEMA_URL);
if (sql.length() > SQL_FACET_MAX_LENGTH) {
log.warn(
"SQL text for query [%s] exceeds [%,d] bytes and will be truncated in the sql job facet",
queryId,
SQL_FACET_MAX_LENGTH
);
sqlFacet.put("query", sql.substring(0, SQL_FACET_MAX_LENGTH));
} else {
sqlFacet.put("query", sql);
}
facets.set("sql", sqlFacet);
}
job.set("facets", facets);
return job;
}
private ObjectNode createFacet(@Nullable String schemaUrl)
{
ObjectNode facet = jsonMapper.createObjectNode();View on GitHub (pinned to 9b90983fd2)