Giter VIP home page Giter VIP logo

Comments (5)

matriv avatar matriv commented on September 25, 2024

Hi @juanpardo ! Thx for reporting the issue.
The queries won't show in sys.jobs (and therefore sys.jobs_log) until they start executing, (we'll discuss if there should be a change in behavior there), and in your case the query is probably failing during the binding of parameters to actual values.

Could you please provide us also with the schemas of the tables (you can use SHOW CREATE TABLE <table_name>) and also, how do you execute those queries, do you use the admin console, crash, plain http endpoint, some postgres compatible client?

Note: we delay adding to sys.jobs because we also do this classification of stmts, so we use a plan just before triggering execution.
Note: a possible improvement could be to add a timeout for the Parsing/Analysis stage.

from crate.

matriv avatar matriv commented on September 25, 2024

More info was shared privately by @juanpardo, thx!

from crate.

matriv avatar matriv commented on September 25, 2024

Simpler reproduction:

CREATE TABLE IF NOT EXISTS t (
    "a" TEXT NOT NULL,
    "b" TEXT NOT NULL,
    "c" TEXT NOT NULL,
    PRIMARY KEY ("a", "b", "c")
);

query:

SELECT * FROM t
WHERE a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
    OR a = ?
    AND b = ?
    AND c = ?
;

from crate.

matriv avatar matriv commented on September 25, 2024

The issue with ugly ArrayIndexOutOfBounds error can simply be reproduced with:

SELECT * FROM t
WHERE a = ?
    AND b = ?
    AND c = ?

since the where clause contains all columns of the PK and a Get plan is used, so SubQueryAndParamBinder is not called, which already handles the situation by throwing
a user friendly error messsage.

from crate.

matriv avatar matriv commented on September 25, 2024

@juanpardo Thx a lot for reporting this issue.
The part regarding the ugly exception has been fixed and will be available with the next hotfix release.

Additionally, I discovered the root cause of the slow process of the query (during the optimization phase) and opened a ticket: #16066 to also address this. We'll discuss if this will be treated as a bug or (most probably) as an improvement.

from crate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.