@Override public PlannedAnalyzedRelation visitQueriedTable(QueriedTable table, ConsumerContext context) { TableRelation tableRelation = table.tableRelation(); if (table.querySpec().where().hasVersions()) { context.validationException(new VersionInvalidException()); return null; } TableInfo tableInfo = tableRelation.tableInfo(); if (tableInfo.schemaInfo().systemSchema() && table.querySpec().where().hasQuery()) { ensureNoLuceneOnlyPredicates(table.querySpec().where().query()); } if (table.querySpec().hasAggregates()) { return GlobalAggregateConsumer.globalAggregates( functions, table, tableRelation, table.querySpec().where(), context); } else { return normalSelect(table, table.querySpec().where(), tableRelation, context); } }