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

Add explicit EOF for expression parser and use assert instead of exception in sql planner #11041

Merged
merged 1 commit into from
Mar 31, 2021

Conversation

jihoonson
Copy link
Contributor

@jihoonson jihoonson commented Mar 28, 2021

Description

This PR fixes 2 issues.

Screenshot from 2021-03-12 18-36-01

  • getClass().getSimpleName() in BottomUpTransform.checkedProcess() can be expensive if it is called lots of times. This PR changes it to use assert.

SqlBenchmark.planSql() results. Only the query 19 (the giant union query) shows a noticeable improvement.

master

Benchmark             (query)  (rowsPerSegment)  (vectorize)  Mode  Cnt    Score   Error  Units
SqlBenchmark.planSql        0                 5        false  avgt   15    0.563 ± 0.005  ms/op
SqlBenchmark.planSql        1                 5        false  avgt   15    0.603 ± 0.004  ms/op
SqlBenchmark.planSql        2                 5        false  avgt   15    0.662 ± 0.007  ms/op
SqlBenchmark.planSql        3                 5        false  avgt   15    0.808 ± 0.009  ms/op
SqlBenchmark.planSql        4                 5        false  avgt   15    1.156 ± 0.014  ms/op
SqlBenchmark.planSql        5                 5        false  avgt   15    1.291 ± 0.011  ms/op
SqlBenchmark.planSql        6                 5        false  avgt   15    1.504 ± 0.011  ms/op
SqlBenchmark.planSql        7                 5        false  avgt   15    1.270 ± 0.013  ms/op
SqlBenchmark.planSql        8                 5        false  avgt   15    2.044 ± 0.013  ms/op
SqlBenchmark.planSql        9                 5        false  avgt   15    1.982 ± 0.022  ms/op
SqlBenchmark.planSql       10                 5        false  avgt   15    0.707 ± 0.005  ms/op
SqlBenchmark.planSql       11                 5        false  avgt   15    0.741 ± 0.002  ms/op
SqlBenchmark.planSql       12                 5        false  avgt   15    0.624 ± 0.006  ms/op
SqlBenchmark.planSql       13                 5        false  avgt   15    0.874 ± 0.007  ms/op
SqlBenchmark.planSql       14                 5        false  avgt   15    0.980 ± 0.008  ms/op
SqlBenchmark.planSql       15                 5        false  avgt   15    0.628 ± 0.007  ms/op
SqlBenchmark.planSql       16                 5        false  avgt   15    0.745 ± 0.005  ms/op
SqlBenchmark.planSql       17                 5        false  avgt   15    0.956 ± 0.009  ms/op
SqlBenchmark.planSql       18                 5        false  avgt   15    1.078 ± 0.011  ms/op
SqlBenchmark.planSql       19                 5        false  avgt   15  129.221 ± 0.725  ms/op

patch

Benchmark             (query)  (rowsPerSegment)  (vectorize)  Mode  Cnt    Score   Error  Units
SqlBenchmark.planSql        0                 5        force  avgt   15    0.553 ± 0.007  ms/op
SqlBenchmark.planSql        1                 5        force  avgt   15    0.610 ± 0.006  ms/op
SqlBenchmark.planSql        2                 5        force  avgt   15    0.669 ± 0.005  ms/op
SqlBenchmark.planSql        3                 5        force  avgt   15    0.768 ± 0.009  ms/op
SqlBenchmark.planSql        4                 5        force  avgt   15    1.136 ± 0.010  ms/op
SqlBenchmark.planSql        5                 5        force  avgt   15    1.151 ± 0.012  ms/op
SqlBenchmark.planSql        6                 5        force  avgt   15    1.337 ± 0.011  ms/op
SqlBenchmark.planSql        7                 5        force  avgt   15    1.184 ± 0.008  ms/op
SqlBenchmark.planSql        8                 5        force  avgt   15    1.838 ± 0.016  ms/op
SqlBenchmark.planSql        9                 5        force  avgt   15    1.699 ± 0.018  ms/op
SqlBenchmark.planSql       10                 5        force  avgt   15    0.710 ± 0.005  ms/op
SqlBenchmark.planSql       11                 5        force  avgt   15    0.738 ± 0.007  ms/op
SqlBenchmark.planSql       12                 5        force  avgt   15    0.592 ± 0.002  ms/op
SqlBenchmark.planSql       13                 5        force  avgt   15    0.810 ± 0.006  ms/op
SqlBenchmark.planSql       14                 5        force  avgt   15    0.906 ± 0.005  ms/op
SqlBenchmark.planSql       15                 5        force  avgt   15    0.593 ± 0.005  ms/op
SqlBenchmark.planSql       16                 5        force  avgt   15    0.700 ± 0.006  ms/op
SqlBenchmark.planSql       17                 5        force  avgt   15    0.853 ± 0.006  ms/op
SqlBenchmark.planSql       18                 5        force  avgt   15    0.967 ± 0.004  ms/op
SqlBenchmark.planSql       19                 5        force  avgt   15  105.288 ± 0.724  ms/op

Key changed/added classes in this PR
  • Expr.g4
  • BottomUpTransform

This PR has:

  • been self-reviewed.

@jihoonson jihoonson changed the title Add explicit EOF and use assert instead of exception Add explicit EOF for expression parser and use assert instead of exception in sql planner Mar 28, 2021
Copy link
Member

@clintropolis clintropolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤘

@jihoonson jihoonson merged commit 43ea184 into apache:master Mar 31, 2021
@clintropolis clintropolis added this to the 0.22.0 milestone Aug 12, 2021
jon-wei added a commit to jon-wei/druid that referenced this pull request Nov 22, 2021
* IMPLY-6556 remove offending settings.xml for intellij inspections

* GCS lookup support (apache#11026)

* GCS lookup support

* checkstyle fix

* review comments

* review comments

* remove unused import

* remove experimental from Kinesis with caveats (apache#10998)

* remove experimental from Kinesis with caveats

* add suggested known issue

* spelling fixes

* Bump aliyun SDK to 3.11.3 (apache#11044)

* Update reset-cluster.md (apache#10990)

fixed Error: Could not find or load main class org.apache.druid.cli.Main

* Make imply-view-manager non-experimental (apache#316)

* Make druid.indexer.task.ignoreTimestampSpecForDruidInputSource default to true, for backwards compat (apache#315)

* Add explicit EOF and use assert instead of exception (apache#11041)

* Add Calcite Avatica protobuf handler (apache#10543)

* bump to latest of same version node and npm versions, bump frontend-maven-plugin (apache#11057)

* request logs through kafka emitter (apache#11036)

* request logs through kafka emitter

* travis fixes

* review comments

* kafka emitter unit test

* new line

* travis checks

* checkstyle fix

* count request lost when request topic is null

* IMPLY-6556 map local repository instead .m2

* remove outdated info from faq (apache#11053)

* remove outdated info from faq

* Add an option for ingestion task to drop (mark unused) all existing segments that are contained by interval in the ingestionSpec (apache#11025)

* Auto-Compaction can run indefinitely when segmentGranularity is changed from coarser to finer.

* Add option to drop segments after ingestion

* fix checkstyle

* add tests

* add tests

* add tests

* fix test

* add tests

* fix checkstyle

* fix checkstyle

* add docs

* fix docs

* address comments

* address comments

* fix spelling

* Allow list for JDBC connection properties to address CVE-2021-26919 (apache#11047)

* Allow list for JDBC connection properties to address CVE-2021-26919

* fix tests for java 11

* Fix compile issue from dropExisting in ingest-service (apache#320)

Co-authored-by: Slava Mogilevsky <triggerwoods91@gmail.com>
Co-authored-by: Parag Jain <pjain1@apache.org>
Co-authored-by: Charles Smith <38529548+techdocsmith@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: frank chen <frank.chen021@outlook.com>
Co-authored-by: Tushar Raj <43772524+tushar-1728@users.noreply.github.com>
Co-authored-by: Jonathan Wei <jon-wei@users.noreply.github.com>
Co-authored-by: Jihoon Son <jihoonson@apache.org>
Co-authored-by: Lasse Krogh Mammen <lkm@bookboon.com>
Co-authored-by: Clint Wylie <cwylie@apache.org>
Co-authored-by: Maytas Monsereenusorn <maytasm@apache.org>
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.

None yet

2 participants