Skip to content

Add qd to msqspec#772

Closed
kgyrtkirk wants to merge 213 commits intomasterfrom
add-qd-to-msqspec
Closed

Add qd to msqspec#772
kgyrtkirk wants to merge 213 commits intomasterfrom
add-qd-to-msqspec

Conversation

@kgyrtkirk
Copy link
Copy Markdown
Owner

Fixes #XXXX.

Description

Fixed the bug ...

Renamed the class ...

Added a forbidden-apis entry ...

Release note


Key changed/added classes in this PR
  • MyFoo
  • OurBar
  • TheirBaz

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.


// This flag is to ensure backward compatibility, as brokers are upgraded after indexers/middlemanagers.
nativeQueryContextOverrides.put(MultiStageQueryContext.WINDOW_FUNCTION_OPERATOR_TRANSFORMATION, true);
boolean isReindex = MSQControllerTask.isReplaceInputDataSourceTask(druidQuery.getQuery(), destination);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
druidQuery
may be null at this access because of
this
null argument.

Copilot Autofix

AI about 1 year ago

To fix the problem, we need to ensure that druidQuery is not null before it is dereferenced at line 246. The best way to fix this without changing existing functionality is to add a null check for druidQuery before line 246. If druidQuery is null, we should handle it appropriately, possibly by throwing an exception or providing a default value.

Suggested changeset 1
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java
--- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java
+++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java
@@ -245,2 +245,5 @@
     nativeQueryContextOverrides.put(MultiStageQueryContext.WINDOW_FUNCTION_OPERATOR_TRANSFORMATION, true);
+    if (druidQuery == null) {
+      throw new IllegalArgumentException("druidQuery cannot be null");
+    }
     boolean isReindex = MSQControllerTask.isReplaceInputDataSourceTask(druidQuery.getQuery(), destination);
EOF
@@ -245,2 +245,5 @@
nativeQueryContextOverrides.put(MultiStageQueryContext.WINDOW_FUNCTION_OPERATOR_TRANSFORMATION, true);
if (druidQuery == null) {
throw new IllegalArgumentException("druidQuery cannot be null");
}
boolean isReindex = MSQControllerTask.isReplaceInputDataSourceTask(druidQuery.getQuery(), destination);
Copilot is powered by AI and may make mistakes. Always verify output.
@kgyrtkirk kgyrtkirk modified the milestones: bv, bvhbv Apr 14, 2025
@kgyrtkirk kgyrtkirk closed this May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants