-
Java Development Kit (JDK) 21 (LTS)
- Windows suggested path:
C:\Program Files\Java\jdk-21(or similarjdk-21.x.x) - Verify:
- PowerShell:
java -version javac -version
- If
javacis missing, you installed a JRE instead of a JDK.
- PowerShell:
- Windows suggested path:
-
Apache Maven 3.8+ (обычно ставится вместе с IDE плагином, но лучше установить отдельно)
- Verify:
mvn -v
- Verify:
-
VS Code or Cursor with extensions:
- Extension Pack for Java
- Language Support for Java by Red Hat
- Debugger for Java
- Maven for Java
- Project Manager for Java
- Open Folder: open the project root (the folder containing
pom.xml,src/, and.vscode/). - Trust the workspace if asked (otherwise Java extensions run in Restricted Mode).
- Extensions will prompt to Import Maven Project — accept it.
Recommended: set JDK 21 in workspace settings so IntelliSense and debug use the same JDK.
Edit .vscode/settings.json (already present here):
{
"java.configuration.updateBuildConfiguration": "automatic",
"java.import.maven.enabled": true,
"java.jdt.ls.java.home": "C:\\Program Files\\Java\\jdk-21",
"java.configuration.runtimes": [
{ "name": "JavaSE-21", "path": "C:\\Program Files\\Java\\jdk-21", "default": true }
]
}If your JDK path differs, adjust the path accordingly.
Additionally, this repo’s .vscode/launch.json and .vscode/tasks.json are configured to:
- run
mvn packageautomatically before debug - and enforce
JAVA_HOMEfor debug launch if needed
PowerShell (Windows):
mvn -q -DskipTests package
mvn -q exec:java- Open
src/main/java/io/example/calciteclickhouse/Main.java - Set a breakpoint in
main - Press F5 and choose "Debug Main (CalciteTest)"
- This will:
- run Maven package as a preLaunchTask
- start the app with the proper classpath
- This will:
- When stopped on breakpoint, use the Run and Debug view (Ctrl+Shift+D) to inspect variables and call stack.
If you see "invalid target release: 21": Maven/Java runs under an older JDK. Either:
- set system JAVA_HOME to JDK 21 and restart the IDE, or
- set JDK 21 for the task/launch env (already configured in
.vscode), or - temporarily set PowerShell env vars:
$env:JAVA_HOME="C:\\Program Files\\Java\\jdk-21" $env:Path="$env:JAVA_HOME\\bin;$env:Path"
- Parses SQL with Calcite, converts to RelNode
- Runs a HepPlanner with rules (including a custom Filter→Project transpose rule)
- Prints SQL before/after optimization
Change the demo SQL in Main.java to experiment with different queries and rules.