You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/10/12 21:43:53 UTC

[GitHub] [druid] somu-imply commented on a diff in pull request #13173: Fix row schema of nested queries with ORDER BY clause to get proper row type during planning validation

somu-imply commented on code in PR #13173:
URL: https://github.com/apache/druid/pull/13173#discussion_r993921972


##########
sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidOuterQueryRel.java:
##########
@@ -116,12 +114,20 @@ public DruidQuery toDruidQuery(final boolean finalizeAggregations)
   @Override
   public DruidQuery toDruidQueryForExplaining()
   {
+    final RowSignature sourceRowSignature;
+    if (sourceRel instanceof DruidRel) {
+      final DruidQuery subQuery = ((DruidRel) sourceRel).toDruidQueryForExplaining();
+      sourceRowSignature = subQuery.getOutputRowSignature();
+    } else {
+      // fallback for cases other than group by inner query with order by with alias on __time column
+      sourceRowSignature = RowSignatures.fromRelDataType(
+          sourceRel.getRowType().getFieldNames(),
+          sourceRel.getRowType()

Review Comment:
   Added the test



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org