Support Questions

Find answers, ask questions, and share your expertise

ERROR: IllegalArgumentException: Comparison method violates its general contract!

avatar

getting error ERROR: IllegalArgumentException: Comparison method violates its general contract! when running query through impala-shell or impala jdbc.

this problem is coming in PROD which is very embarasing as never thought such kind of weired problem will come.

please help to resolve the problem.

 

using Impala Shell v2.7.0-cdh5.9.0 .

1 ACCEPTED SOLUTION

avatar

I believe you can append query options applied to that JDBC to the connection string like this:

jdbc:impala://your_impalad.com:21050/default;UseNativeQuery=1;SET RUNTIME_FILTER_MODE=OFF;

 

Alternatively, you should be able to run "SET RUNTIME_FILTER_MODE=OFF" as a query from JDBC to alter the defauly query options of that session.

View solution in original post

3 REPLIES 3

avatar

My apologies for this unsightly issue and error message.

 

You are running into an issue with a relativey new feature - runtime filters.

We have identified and fixed the issue in later versions, see:

https://issues.apache.org/jira/browse/IMPALA-4076

 

Please first check that the relevant tables have stats.

 

As a workaround, you may either disable runtime filters:

SET RUNTIME_FILTER_MODE=OFF;

 

or you can increase the number of allowed filters per-query:

SET MAX_NUM_RUNTIME_FILTERS=100;

 

The issue only occurs for complex queries where the number of runtime filters exceed the per-query runtime filter budget (we sort all runtime filters and try to pick the best top-N, which is where this issue is happening).

 

avatar

Thanks for the quick reply. where to set/put/configure these properties when using Impala through JDBC. 

avatar

I believe you can append query options applied to that JDBC to the connection string like this:

jdbc:impala://your_impalad.com:21050/default;UseNativeQuery=1;SET RUNTIME_FILTER_MODE=OFF;

 

Alternatively, you should be able to run "SET RUNTIME_FILTER_MODE=OFF" as a query from JDBC to alter the defauly query options of that session.