{"record":{"id":"89d58b2b4439a323","repo":"apache/druid","slug":"columnnamerestricted","errorCode":"ColumnNameRestricted","errorMessage":"ColumnNameRestrictedFault: __boost is a restricted column name","messagePattern":"ColumnNameRestrictedFault: __boost is a restricted column name","errorType":"error_code","errorClass":"MSQException","httpStatus":null,"severity":"error","filePath":"multi-stage-query/src/main/java/org/apache/druid/msq/querykit/QueryKitUtils.java","lineNumber":133,"sourceCode":"  {\n    if (Granularities.ALL.equals(segmentGranularity)) {\n      return clusterBy;\n    } else {\n      final List<KeyColumn> newColumns = new ArrayList<>(clusterBy.getColumns().size() + 1);\n      newColumns.add(new KeyColumn(QueryKitUtils.SEGMENT_GRANULARITY_COLUMN, KeyOrder.ASCENDING));\n      newColumns.addAll(clusterBy.getColumns());\n      return new ClusterBy(newColumns, 1);\n    }\n  }\n\n  /**\n   * Verifies the {@link RowSignature} and throws an appropriate exception if it is invalid or uses restricted column\n   * names\n   */\n  public static void verifyRowSignature(final RowSignature signature)\n  {\n    if (signature.contains(QueryKitUtils.PARTITION_BOOST_COLUMN)) {\n      throw new MSQException(new ColumnNameRestrictedFault(QueryKitUtils.PARTITION_BOOST_COLUMN));\n    } else if (signature.contains(QueryKitUtils.SEGMENT_GRANULARITY_COLUMN)) {\n      throw new MSQException(new ColumnNameRestrictedFault(QueryKitUtils.SEGMENT_GRANULARITY_COLUMN));\n    }\n  }\n\n  /**\n   * Adds {@link #SEGMENT_GRANULARITY_COLUMN} to a {@link RowSignature} if needed. Signature should be verified prior\n   * to calling this function to ensure that {@link #SEGMENT_GRANULARITY_COLUMN} is not passed in by the user\n   */\n  public static RowSignature signatureWithSegmentGranularity(\n      final RowSignature signature,\n      final Granularity segmentGranularity\n  )\n  {\n    if (Granularities.ALL.equals(segmentGranularity)) {\n      return signature;\n    } else {\n      return RowSignature.builder()","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/QueryKitUtils.java#L115-L151","documentation":"Thrown by QueryKitUtils.verifyRowSignature when the query's output signature contains the reserved partition-boost column (__boost, PARTITION_BOOST_COLUMN). MSQ uses __boost internally to influence partition weighting, so user queries must not define a column with that name; doing so would collide with internal machinery.","triggerScenarios":"A query (e.g. an INSERT/SELECT producing output for partitioning) whose result RowSignature includes a column literally named __boost, typically because a source column is named __boost or an expression aliases to __boost.","commonSituations":"Ingesting data that already contains a column named __boost; renaming an expression with AS \"__boost\"; schema copied verbatim from data files that happen to include reserved names.","solutions":["Rename the user column/alias away from __boost, e.g. AS boost_col.","Filter out or exclude the __boost column from the SELECT projection.","If the source table has a __boost column, exclude it during ingestion or rename it upstream."],"exampleFix":"// before\nSELECT __boost, other_col FROM druid.tbl\n// after\nSELECT __boost AS boost_value, other_col FROM druid.tbl","handlingStrategy":"validation","validationCode":"for (String col : signature.getColumnNames()) {\n  if (\"__boost\".equals(col)) throw new IllegalArgumentException(\"Rename column __boost before using MSQ\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  QueryKitUtils.verifyRowSignature(signature);\n} catch (MSQException e) {\n  // prompt user to rename reserved columns and resubmit\n}","preventionTips":["Avoid naming user columns with double-underscore prefixes (__).","Check source schemas for reserved names before ingesting through MSQ.","Alias any expression results away from reserved names."],"tags":["druid","msq","column-name","reserved-word","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}