cryptoe commented on code in PR #14571:
URL: https://github.com/apache/druid/pull/14571#discussion_r1284014529
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:
##########
@@ -663,12 +666,36 @@ private MSQControllerTask
getMSQControllerTaskOrThrow(String queryId, String cur
return msqControllerTask;
}
+ /**
+ * Creates a new sqlQuery from the user submitted sqlQuery after performing
required modifications.
+ */
+ private SqlQuery createModifiedSqlQuery(SqlQuery sqlQuery)
+ {
+ Map<String, Object> context = sqlQuery.getContext();
+ if (context.containsKey(RESULT_FORMAT)) {
+ throw InvalidInput.exception("Query context parameter [%s] is not
allowed", RESULT_FORMAT);
Review Comment:
```suggestion
throw InvalidInput.exception("Result format as a query context
parameter [%s] is not allowed. Pass it as a parameter in the body of the
request payload like {\"query\":\"select a from foo limit 1\",
\"resultFormat\":\"csv\"} ", RESULT_FORMAT);
```
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:
##########
@@ -115,6 +117,7 @@
public class SqlStatementResource
{
+ public static final String RESULT_FORMAT = "resultFormat";
Review Comment:
I think we should set this as __resultFormat ie this is set by the broker
and not by the user directly. Sort of like an internal parameter.
WDYT ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]