LakshSingla commented on code in PR #14476:
URL: https://github.com/apache/druid/pull/14476#discussion_r1243479365


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQSelectDestination.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.msq.indexing;
+
+/**
+ * Determines the destination for results of select queries.
+ */
+public enum MSQSelectDestination
+{
+  /**
+   * Writes all the results directly to the report.
+   */
+  REPORT(false),

Review Comment:
   ```suggestion
     TASK_REPORT(false),
   ```



##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQSelectDestination.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.msq.indexing;
+
+/**
+ * Determines the destination for results of select queries.
+ */
+public enum MSQSelectDestination
+{
+  /**
+   * Writes all the results directly to the report.
+   */
+  REPORT(false),
+  S3(true);

Review Comment:
   nit: Update this to DURABLE_STORAGE and add a doc line for this. 



##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQSelectDestination.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.msq.indexing;
+
+/**
+ * Determines the destination for results of select queries.
+ */
+public enum MSQSelectDestination
+{
+  /**
+   * Writes all the results directly to the report.
+   */
+  REPORT(false),
+  S3(true);
+
+  private final boolean shouldTruncateResults;
+
+  public boolean shouldTruncateResults()

Review Comment:
   ```suggestion
     public boolean shouldTruncateResultsInTaskReport()
   ```
   Results themselves won't be truncated in the other locations, so IMO this 
method should reflect that we are truncating the results in the task reports



##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/util/MultiStageQueryContext.java:
##########
@@ -204,6 +211,16 @@ public static int getRowsPerSegment(final QueryContext 
queryContext)
     );
   }
 
+  public static MSQSelectDestination getSelectDestination(final QueryContext 
queryContext)
+  {
+    return MSQSelectDestination.valueOf(

Review Comment:
   What happens if this isn't a valid destination? If this errors out with a 
cryptic error message, we should present a user-friendly message and list out 
the possible options for the destination. (Presence of DURABLE_STORAGE/S3 as an 
option should only be if durable storage is configured)



-- 
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]

Reply via email to