anuragrai16 commented on code in PR #17081:
URL: https://github.com/apache/pinot/pull/17081#discussion_r2466214757
##########
pinot-plugins/pinot-timeseries-lang/pinot-timeseries-m3ql/src/main/java/org/apache/pinot/tsdb/m3ql/M3TimeSeriesPlanner.java:
##########
@@ -157,6 +163,31 @@ public BaseTimeSeriesPlanNode handleFetchNode(String
planId, List<String> tokens
Preconditions.checkNotNull(timeColumn, "Time column not set. Set via
time_col=");
Preconditions.checkNotNull(timeUnit, "Time unit not set. Set via
time_unit=");
Preconditions.checkNotNull(valueExpr, "Value expression not set. Set via
value=");
+
+ Schema tableSchema =
metadata.getSchema(TableNameBuilder.extractRawTableName(tableName));
+ Preconditions.checkState(tableSchema != null, "Failed to find schema for
table: %s", tableName);
+ // validate time column
+ Preconditions.checkArgument(tableSchema.hasColumn(timeColumn),
+ "Time column '%s' not found in table '%s'.", timeColumn, tableName);
+ if (groupByColumns != null) {
+ // validate group by columns
+ for (String groupByCol : groupByColumns) {
+ Preconditions.checkArgument(tableSchema.hasColumn(groupByCol),
Review Comment:
Thanks. Updated the logic to handle expression in both groupBy columns and
filter value. The logic in `fixColumnName` is already done by
`expression.getColumn()` to handle all different ExpressionContext by __type,
which should be sufficient here. Lmk if I'm missing something.
--
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]