zachjsh commented on code in PR #16260:
URL: https://github.com/apache/druid/pull/16260#discussion_r1580023194
##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidSqlValidator.java:
##########
@@ -397,6 +459,34 @@ private Granularity getEffectiveGranularity(
return effectiveGranularity;
}
+ @Nullable
+ private SqlNodeList convertCatalogClustering(final DatasourceFacade
tableMetadata)
+ {
+ if (tableMetadata == null) {
+ return null;
+ }
+ final List<ClusterKeySpec> keyCols = tableMetadata.clusterKeys();
+ if (CollectionUtils.isNullOrEmpty(keyCols)) {
+ return null;
+ }
+ final SqlNodeList keyNodes = new SqlNodeList(SqlParserPos.ZERO);
+ for (ClusterKeySpec keyCol : keyCols) {
+ final SqlIdentifier colIdent = new SqlIdentifier(
+ Collections.singletonList(keyCol.expr()),
+ null, SqlParserPos.ZERO,
+ Collections.singletonList(SqlParserPos.ZERO)
+ );
Review Comment:
About whether there is a check that al keyCols are present in the selected
column list, see the following tests:
`testInsertTableWithClusteringWithClusteringOnNewColumnFromQuery`
`testInsertTableWithClusteringWithClusteringOnBadColumn`
Do these cover the cases you are talking about?
About the join issue, do you have a concrete query in example, just to
clarify?
--
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]