diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQFaultsTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQFaultsTest.java index b18e14b04f20..2918391c0be0 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQFaultsTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQFaultsTest.java @@ -511,7 +511,7 @@ public void testUnionAllWithDifferentColumnNames() + "PARTITIONED BY ALL TIME") .setExpectedValidationErrorMatcher( new DruidExceptionMatcher( - DruidException.Persona.ADMIN, + DruidException.Persona.USER, DruidException.Category.INVALID_INPUT, "general" ).expectMessageContains( @@ -533,7 +533,7 @@ public void testTopLevelUnionAllWithJoins() ) .setExpectedValidationErrorMatcher( new DruidExceptionMatcher( - DruidException.Persona.ADMIN, + DruidException.Persona.USER, DruidException.Category.INVALID_INPUT, "general" ).expectMessageContains( diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/QueryHandler.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/QueryHandler.java index b19e83e040e0..2fca51e8dc03 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/QueryHandler.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/QueryHandler.java @@ -678,9 +678,10 @@ private DruidException buildSQLPlanningError(RelOptPlanner.CannotPlanException e .build(exception, "Unhandled Query Planning Failure, see broker logs for details"); } else { // Planning errors are more like hints: it isn't guaranteed that the planning error is actually what went wrong. - // For this reason, we consider these as targetting a more expert persona, i.e. the admin instead of the actual - // user. - throw DruidException.forPersona(DruidException.Persona.ADMIN) + // Even though the errors could be targetted to a more expert persona the errors aren't leaking any privileged + // information about the cluster that an admin might care about. The errors that are user resolvable are worth + // the potential confusion that a user might face with one that requires an expert persona. + throw DruidException.forPersona(DruidException.Persona.USER) .ofCategory(DruidException.Category.INVALID_INPUT) .build( exception, diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java index 94bc3b5c2eb9..9c74d4bbffc8 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java @@ -690,7 +690,7 @@ private DruidExceptionMatcher buildUnplannableExceptionMatcher() if (testBuilder().isDecoupledMode()) { return new DruidExceptionMatcher(Persona.USER, Category.INVALID_INPUT, "invalidInput"); } else { - return new DruidExceptionMatcher(Persona.ADMIN, Category.INVALID_INPUT, "general"); + return new DruidExceptionMatcher(Persona.USER, Category.INVALID_INPUT, "general"); } } diff --git a/sql/src/test/java/org/apache/druid/sql/http/SqlResourceTest.java b/sql/src/test/java/org/apache/druid/sql/http/SqlResourceTest.java index 665d5873b461..b906fe731781 100644 --- a/sql/src/test/java/org/apache/druid/sql/http/SqlResourceTest.java +++ b/sql/src/test/java/org/apache/druid/sql/http/SqlResourceTest.java @@ -1386,7 +1386,7 @@ public void testCannotConvert() throws Exception validateErrorResponse( exception, "general", - DruidException.Persona.ADMIN, + DruidException.Persona.USER, DruidException.Category.INVALID_INPUT, "Query could not be planned. A possible reason is " + "[SQL query requires ordering a table by non-time column [[dim1]], which is not supported.]"