Skip to content

Commit 51c1411

Browse files
committed
Update limit pushdown error message
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent 08c4b06 commit 51c1411

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/OpenSearchLimitIndexScanRule.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public void onMatch(RelOptRuleCall call) {
4141
}
4242

4343
private static Integer extractLimitValue(RexNode fetch) {
44+
// fetch is always a integer literal (specified in our PPL/SQL syntax)
4445
if (fetch instanceof RexLiteral) {
4546
return ((RexLiteral) fetch).getValueAs(Integer.class);
4647
}

opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteLogicalIndexScan.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public CalciteLogicalIndexScan pushDownFilter(Filter filter) {
102102
if (LOG.isDebugEnabled()) {
103103
LOG.debug("Cannot pushdown the filter condition {}", filter.getCondition(), e);
104104
} else {
105-
LOG.warn("Cannot pushdown the filter condition {}, ", filter.getCondition());
105+
LOG.info("Cannot pushdown the filter condition {}, ", filter.getCondition());
106106
}
107107
}
108108
return null;
@@ -159,7 +159,7 @@ public CalciteLogicalIndexScan pushDownAggregate(Aggregate aggregate) {
159159
if (LOG.isDebugEnabled()) {
160160
LOG.debug("Cannot pushdown the aggregate {}", aggregate, e);
161161
} else {
162-
LOG.warn("Cannot pushdown the aggregate {}, ", aggregate);
162+
LOG.info("Cannot pushdown the aggregate {}, ", aggregate);
163163
}
164164
}
165165
return null;
@@ -175,7 +175,11 @@ public CalciteLogicalIndexScan pushDownLimit(Integer limit, Integer offset) {
175175
requestBuilder -> requestBuilder.pushDownLimit(limit, offset)));
176176
return newScan;
177177
} catch (Exception e) {
178-
LOG.debug("Cannot pushdown limit {} with offset {}. Exception: {}", limit, offset, e);
178+
if (LOG.isDebugEnabled()) {
179+
LOG.debug("Cannot pushdown limit {} with offset {}", limit, offset, e);
180+
} else {
181+
LOG.info("Cannot pushdown limit {} with offset {}", limit, offset);
182+
}
179183
}
180184
return null;
181185
}

0 commit comments

Comments
 (0)