capistrant commented on code in PR #19659:
URL: https://github.com/apache/druid/pull/19659#discussion_r3648619003
##########
processing/src/main/java/org/apache/druid/data/input/impl/ClusteredValueGroupsBaseTableProjectionSpec.java:
##########
@@ -311,6 +314,75 @@ private static void validate(List<DimensionSchema>
columns, List<String> cluster
}
}
+ /**
+ * Rules to keep virtual columns definitions reasonable:
+ * <ul>
+ * <li><b>dot notation</b>: a virtual column that {@link
VirtualColumn#usesDotNotation()} is referenced as
+ * {@code name.subfield} rather than by a fixed output name, so it has no
stable identity to materialize or cluster
+ * on; it is rejected outright.</li>
+ * <li><b>inputs</b>: every input of a virtual column must be a stored
column (declared in {@code columns}) or
+ * another virtual column in the spec.</li>
+ * <li><b>outputs</b>: every virtual column must either be materialized
(its output declared in {@code columns}) or
+ * be an intermediary that feeds another virtual column. A virtual column
that is neither materializes nothing and
+ * is used by nothing and dead metadata and so it is rejected.</li>
+ * </ul>
+ * The query-granularity carrier ({@link
Granularities#GRANULARITY_VIRTUAL_COLUMN_NAME}) is special handled to
+ * capture how __time is computed, so it is exempt from the output rule.
+ */
+ private static void validateVirtualColumns(VirtualColumns virtualColumns,
List<DimensionSchema> columns)
Review Comment:
Now that we are going to be (potentially) remapping query time VCs to use
materialized columns instead of re-compute. Do we need to validate that the VCs
who have physical output columns have matching type?
like if physical column is `type long` and the VC is `x * 1.5 type double`
an equivalent remapping would use the long instead of expected double
or do we just live with this as dealers choice by the person who owns the
datasource and whether or not they like chaos
--
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]