ankitsultana commented on code in PR #17081:
URL: https://github.com/apache/pinot/pull/17081#discussion_r2464401376
##########
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:
We also support expressions for each of these, so you need to handle that
too. You can refer to "fixColumnName"'s logic
--
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]