Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES|QL: copy QL module and detach from SQL/EQL #106079

Closed
wants to merge 9 commits into from

Conversation

luigidellaquila
Copy link
Contributor

@luigidellaquila luigidellaquila commented Mar 7, 2024

DO NOT MERGE!

PoC to test which problems can arise by removing ESQL dependency from QL/SQL/EQL, just copying QL module to a different plugin.

There are open PRs that modify QL, they'll have to be synchronized with this change: #105860, #105469, #104907

@luigidellaquila
Copy link
Contributor Author

@elasticmachine run buildkite/docs-build-pr

@luigidellaquila
Copy link
Contributor Author

Closing this for now.
Since there is no agreement on the approach and on the timing, paying the high cost of maintaining this PR aligned with main branch is probably not convenient.

In case we decide to revive it, we can recreate it from main branch using the following script (osx)

cd x-pack/plugin/

# you never know...
rm -rf qlcore

ECHO create a new qlcore module copying ql
cp -R ql qlcore

ECHO Adapt java src directories and rename the plugin
cd qlcore/src/main/java/org/elasticsearch/xpack
mv ql qlcore
cd qlcore/plugin
mv QlPlugin.java QlCorePlugin.java
find . -type f -name 'QlCorePlugin.java' -exec sed -i '' s/'class QlPlugin'/'class QlCorePlugin'/g {} +
cd ../../../../../../../..       
# we are now at /elasticsearch/x-pack/plugin/qlcore
cd src/test/java/org/elasticsearch/xpack
mv ql qlcore
cd ../../../../../..
# we are now at /elasticsearch/x-pack/plugin/qlcore
cd test-fixtures/src/main/java/org/elasticsearch/xpack
mv ql qlcore
cd ../../../../../../..
# we are now at /elasticsearch/x-pack/plugin/qlcore

ECHO adapt java packages in qlcore module
find . -type f -name '*.java' -exec sed -i '' s/xpack\\.ql/xpack.qlcore/g {} +

ECHO rename the plugin in the gradle files
find . -type f -name '*.gradle' -exec sed -i '' s/\'x-pack-ql\'/\'x-pack-qlcore\'/g {} +
find . -type f -name '*.gradle' -exec sed -i '' s/\'ql\'/\'qlcore\'/g {} +
find . -type f -name '*.gradle' -exec sed -i '' s/ql\.plugin\.QlPlugin/qlcore.plugin.QlCorePlugin/g {} +
find . -type f -name '*.gradle' -exec sed -i '' s/ql\:test\-fixtures/qlcore\:test-fixtures/g {} +



ECHO modify ESQL to use the new plugin
cd ../esql

ECHO point to the new plugin from Gradle
find . -type f -name '*.gradle' -exec sed -i '' s/\'x-pack-ql\'/\'x-pack-qlcore\'/g {} +
find . -type f -name '*.gradle' -exec sed -i '' s/\'ql\'/\'qlcore\'/g {} +
find . -type f -name '*.gradle' -exec sed -i '' s/ql\:test\-fixtures/qlcore\:test-fixtures/g {} +

ECHO update packages
find . -type f -name '*.java' -exec sed -i '' s/xpack\\.ql/xpack.qlcore/g {} +

ECHO fix bwc tests
find . -type f -name '*.csv-spec' -exec sed -i '' s/'skip\:\-8\.11\.99\, reason\:ql exceptions were updated in 8\.12'/'skip:-8.13.99, reason:warning messages changed in 8.14'/g {} +
find . -type f -name '*.csv-spec' -exec sed -i '' s/'evalDateDiffErrorOutOfIntegerRange\#\[skip\:\-8\.12\.99\, reason\:date_diff added in 8\.13'/'evalDateDiffErrorOutOfIntegerRange\#\[skip:-8.13.99, reason:warning messages changed in 8.14'/g {} +
find . -type f -name '*.csv-spec' -exec sed -i '' s/'convertDoubleToUL\#\[skip\:\-8\.11\.99, reason\:ql exceptions updated in 8\.12'/'convertDoubleToUL\#\[skip:-8.13.99, reason:warning messages changed in 8.14'/g {} +
find . -type f -name '*.csv-spec' -exec sed -i '' s/xpack\\.ql/xpack.qlcore/g {} +

ECHO fix spotless
cd ../../..
./gradlew :x-pack:plugin:qlcore:spotlessApply
./gradlew :x-pack:plugin:esql:spotlessApply

ECHO done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants