Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ public void writeTo(StreamOutput out) throws IOException {
}

public static byte[] convertToSubstraitAndSerialize(RelNode relNode) {
LOGGER.info("Calcite Logical Plan before Conversion\n {}", RelOptUtil.toString(relNode));
LOGGER.debug("Calcite Logical Plan before Conversion\n {}", RelOptUtil.toString(relNode));

// Preprocess the Calcite plan
relNode = preprocessRelNodes(relNode);
Expand All @@ -471,7 +471,7 @@ public static byte[] convertToSubstraitAndSerialize(RelNode relNode) {
// Support to convert COUNT(DISTINCT) to APPROX_COUNT_DISTINCT for partial results
relNode = convertCountDistinctToApprox(relNode);

LOGGER.info("Calcite Logical Plan after Conversion\n {}", RelOptUtil.toString(relNode));
LOGGER.debug("Calcite Logical Plan after Conversion\n {}", RelOptUtil.toString(relNode));

long startTimeSubstrait = System.nanoTime();
// Substrait conversion
Expand Down Expand Up @@ -510,8 +510,8 @@ public static byte[] convertToSubstraitAndSerialize(RelNode relNode) {
// This enables serialization, storage, and cross-system communication
PlanProtoConverter planProtoConverter = new PlanProtoConverter();
io.substrait.proto.Plan substraitPlanProtoModified = planProtoConverter.toProto(modifiedPlan);
LOGGER.info("Time taken to convert to Substrait convert (ms) {}", (endTimeSubstraitConvert-startTimeSubstrait)/1000000);
LOGGER.info("Substrait Logical Plan \n {}", substraitPlanProtoModified.toString());
LOGGER.debug("Time taken to convert to Substrait convert (ms) {}", (endTimeSubstraitConvert-startTimeSubstrait)/1000000);
LOGGER.debug("Substrait Logical Plan \n {}", substraitPlanProtoModified.toString());
return substraitPlanProtoModified.toByteArray();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ public Result implement(EnumerableRelImplementor implementor, Prefer pref) {
// FIXME : Make this optional based on the index setting
fullRelNodeTree = CalciteToolsHelper.OpenSearchRelRunners.getCurrentRelNode();
CalciteToolsHelper.OpenSearchRelRunners.clearCurrentRelNode();
LOG.info("Full RelNode tree:\n{}", RelOptUtil.toString(fullRelNodeTree));
LOG.info("=== PushDownContext contains {} operations ===", pushDownContext.size());
LOG.debug("Full RelNode tree:\n{}", RelOptUtil.toString(fullRelNodeTree));
LOG.debug("=== PushDownContext contains {} operations ===", pushDownContext.size());
int index = 0;
for (var operation : pushDownContext) {
LOG.info(" Operation {}: type={}, relNode={}",
LOG.debug(" Operation {}: type={}, relNode={}",
index++,
operation.type(),
operation.relNode() != null ? operation.relNode().toString() : "NULL");
Expand All @@ -137,7 +137,7 @@ public Result implement(EnumerableRelImplementor implementor, Prefer pref) {
// Create a base CalciteLogicalIndexScan for reconstruction
CalciteLogicalIndexScan logicalIndexScan = new CalciteLogicalIndexScan(getCluster(), getTable(), osIndex);
pushedDownTree = pushDownContext.reconstructPushedDownRelNodeTree(logicalIndexScan);
LOG.info("Reconstructed pushed-down RelNode tree:\n{}", pushedDownTree.explain());
LOG.debug("Reconstructed pushed-down RelNode tree:\n{}", pushedDownTree.explain());
}
} catch (Exception e) {
LOG.error("Failed to reconstruct pushed-down RelNode tree", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public AbstractRelNode pushDownFilter(Filter filter) {
CalciteLogicalIndexScan newScan = this.copy();

// Log the filter condition being stored to check if SEARCH optimization already happened
LOG.info("Filter condition being stored: {}", filter.getCondition());
LOG.debug("Filter condition being stored: {}", filter.getCondition());

newScan.pushDownContext.add(
queryExpression.getScriptCount() > 0 ? PushDownType.SCRIPT : PushDownType.FILTER,
Expand Down Expand Up @@ -409,7 +409,7 @@ public AbstractRelNode pushDownAggregate(Aggregate aggregate, Project project) {
// Store the input Project node BEFORE the Aggregate
// This Project comes between the Aggregate and the Filter in the pattern: Agg → Project → Filter
if (project != null) {
LOG.info("Project to add: {}", project);
LOG.debug("Project to add: {}", project);
// Create a no-op OSRequestBuilderAction (not AggregationBuilderAction!)
// This ensures the Project is added to operationsForRequestBuilder, not operationsForAgg
// no-op since we don't need to modify the OpenSearch query, we only need RelNode for Substrait conversion
Expand All @@ -421,7 +421,7 @@ public AbstractRelNode pushDownAggregate(Aggregate aggregate, Project project) {
newScan.pushDownContext.add(PushDownType.AGGREGATION, aggregate, action, aggregate);
return newScan;
} catch (Exception e) {
LOG.info("Cannot pushdown the aggregate {}", aggregate, e);
LOG.debug("Cannot pushdown the aggregate {}", aggregate, e);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,21 @@ public RelNode reconstructPushedDownRelNodeTree(RelNode logicalIndexScan) {
RelNode current = logicalIndexScan;
List<PushDownOperation> pushDownOperations = new ArrayList<>(this);

LOGGER.info("Starting reconstruction with {} operations", pushDownOperations.size());
LOGGER.debug("Starting reconstruction with {} operations", pushDownOperations.size());
for (int i = 0; i < pushDownOperations.size(); i++) {
PushDownOperation op = pushDownOperations.get(i);
LOGGER.info("Operation {}: type={}, digest={}", i, op.type(), op.digest());
LOGGER.debug("Operation {}: type={}, digest={}", i, op.type(), op.digest());
RelNode storedRelNode = op.relNode();
if (storedRelNode != null) {
LOGGER.info(" Stored RelNode: {}", storedRelNode);
LOGGER.debug(" Stored RelNode: {}", storedRelNode);
RelNode before = current;
current = replaceInput(storedRelNode, current);
LOGGER.info(" {} being added as input to {}", before, current);
LOGGER.debug(" {} being added as input to {}", before, current);
} else {
LOGGER.info(" No RelNode stored for this operation");
LOGGER.debug(" No RelNode stored for this operation");
}
}
LOGGER.info("Final reconstructed tree\n: {}", current);
LOGGER.debug("Final reconstructed tree\n: {}", current);
return current;
}

Expand Down
2 changes: 1 addition & 1 deletion ppl/src/main/java/org/opensearch/sql/ppl/PPLService.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private AbstractPlan plan(
PPLQueryRequest request,
ResponseListener<QueryResponse> queryListener,
ResponseListener<ExplainResponse> explainListener) {
log.info("ORIGINAL PPL {}", request.getRequest());
log.debug("ORIGINAL PPL {}", request.getRequest());
// 1.Parse query and convert parse tree (CST) to abstract syntax tree (AST)
ParseTree cst = parser.parse(request.getRequest());
Statement statement =
Expand Down
Loading