Re: [PR] SQL: Support GROUP BY and ORDER BY for NULL types. (druid)

2024-04-11 Thread via GitHub


gianm commented on code in PR #16252:
URL: https://github.com/apache/druid/pull/16252#discussion_r1561804344


##
sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java:
##
@@ -6108,6 +6108,102 @@ public void 
testCountStarWithTimeInIntervalFilterLosAngeles()
 );
   }
 
+  @Test
+  public void testGroupByNullType()
+  {
+// Cannot vectorize due to null constant expression.
+cannotVectorize();
+testQuery(
+"SELECT NULL as nullcol, COUNT(*) FROM druid.foo GROUP BY 1",
+ImmutableList.of(
+new GroupByQuery.Builder()
+.setDataSource(CalciteTests.DATASOURCE1)
+.setInterval(querySegmentSpec(Filtration.eternity()))
+.setGranularity(Granularities.ALL)
+.setVirtualColumns(expressionVirtualColumn("v0", "null", 
ColumnType.STRING))
+.setDimensions(dimensions(new DefaultDimensionSpec("v0", "d0", 
ColumnType.STRING)))
+.setAggregatorSpecs(aggregators(new 
CountAggregatorFactory("a0")))
+.setContext(QUERY_CONTEXT_DEFAULT)
+.build()
+),
+ImmutableList.of(
+new Object[]{null, 6L}
+)
+);
+  }
+
+  @Test
+  public void testOrderByNullType()

Review Comment:
   OK, thanks, cool idea!
   
   It is supported for the basic planner, so I kept the override in 
`DecoupledPlanningCalciteQueryTest` and changed the annotation from `@Disabled` 
to `@NotYetSupported`.



-- 
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-unsubscr...@druid.apache.org

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


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



Re: [PR] SQL: Support GROUP BY and ORDER BY for NULL types. (druid)

2024-04-10 Thread via GitHub


kgyrtkirk commented on code in PR #16252:
URL: https://github.com/apache/druid/pull/16252#discussion_r1558998133


##
sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java:
##
@@ -6108,6 +6108,102 @@ public void 
testCountStarWithTimeInIntervalFilterLosAngeles()
 );
   }
 
+  @Test
+  public void testGroupByNullType()
+  {
+// Cannot vectorize due to null constant expression.
+cannotVectorize();
+testQuery(
+"SELECT NULL as nullcol, COUNT(*) FROM druid.foo GROUP BY 1",
+ImmutableList.of(
+new GroupByQuery.Builder()
+.setDataSource(CalciteTests.DATASOURCE1)
+.setInterval(querySegmentSpec(Filtration.eternity()))
+.setGranularity(Granularities.ALL)
+.setVirtualColumns(expressionVirtualColumn("v0", "null", 
ColumnType.STRING))
+.setDimensions(dimensions(new DefaultDimensionSpec("v0", "d0", 
ColumnType.STRING)))
+.setAggregatorSpecs(aggregators(new 
CountAggregatorFactory("a0")))
+.setContext(QUERY_CONTEXT_DEFAULT)
+.build()
+),
+ImmutableList.of(
+new Object[]{null, 6L}
+)
+);
+  }
+
+  @Test
+  public void testOrderByNullType()

Review Comment:
   instead of overriding+disabling the testcase; it can be marked as 
unsupported with:
   ```suggestion
 @NotYetSupported(Modes.NOT_ENOUGH_RULES)
 @Test
 public void testOrderByNullType()
   ```
   this has the benefit that it will be verified that it still fails and could 
also be located based on the type of failure it have



-- 
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-unsubscr...@druid.apache.org

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


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



Re: [PR] SQL: Support GROUP BY and ORDER BY for NULL types. (druid)

2024-04-09 Thread via GitHub


gianm commented on PR #16252:
URL: https://github.com/apache/druid/pull/16252#issuecomment-2045859287

   @kgyrtkirk FYI I encountered an error here in decoupled planning with one of 
the new tests, and disabled it: 
https://github.com/apache/druid/pull/16252/files#diff-8d40b0c4f1c04fc1a87f672f9fb48a91568c7bd4a4eb5ceda1c9cb008a22653fR70-R76


-- 
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-unsubscr...@druid.apache.org

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


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