sdreynolds commented on a change in pull request #2495:
URL: https://github.com/apache/calcite/pull/2495#discussion_r695336924
##########
File path:
core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnUniqueness.java
##########
@@ -148,6 +148,13 @@ public Boolean areColumnsUnique(Intersect rel,
RelMetadataQuery mq,
public @Nullable Boolean areColumnsUnique(Sort rel, RelMetadataQuery mq,
ImmutableBitSet columns, boolean ignoreNulls) {
+ // when return rows is less than or equals 1 (limit 1 or limit 0).
+ if (rel.fetch != null) {
+ int limit = RexLiteral.intValue(rel.fetch);
Review comment:
Fetch and offset are not guaranteed to be RexLiteral. If you look at
EnumerableSortRule you can see how that handles variables.
--
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]