You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A query of mine using 'group by' on a column in the original query is lacking any 'group by' in the query Verdict generates to send to the database. This cause the aggregation used in the case statements to be done over the entire table rather than over the groups. The query was processed on Verdict on top of Impala.
Here is the query and debug output:
verdict:Impala> select case when count() < 50 then 1 else 0 end as sparse, case when count() > 50 then 50 else count() end as num_sampled from orders group by user_id;
DEBUG 2018-01-17 20:42:08,331 - [VerdictStatement] execute() called with: select case when count() < 50 then 1 else 0 end as sparse, case when count() > 50 then 50 else count() end as num_sampled from orders group by user_id
DEBUG 2018-01-17 20:42:08,331 - [VerdictJDBCContext] An input query:
DEBUG 2018-01-17 20:42:08,331 - [VerdictJDBCContext] select case when count() < 50 then 1 else 0 end as sparse, case when count() > 50 then 50 else count() end as num_sampled from orders group by user_id
DEBUG 2018-01-17 20:42:08,414 - [Class] [0] A query type: SELECT
DEBUG 2018-01-17 20:42:08,427 - [DbmsImpala] About to run: describe instacart1g.orders
DEBUG 2018-01-17 20:42:08,428 - [DbmsImpala] A new statement id: 1545827753
DEBUG 2018-01-17 20:42:08,481 - [ApproxProjectedRelation] A query to db: SELECT (CASE WHEN count() < 50 THEN 1 ELSE 0 END) AS sparse, (CASE WHEN count() > 50 THEN 50 ELSE count() END) AS num_sampled FROM instacart1g.orders AS vt5
DEBUG 2018-01-17 20:42:08,481 - [DbmsImpala] About to run: SELECT (CASE WHEN count() < 50 THEN 1 ELSE 0 END) AS sparse, (CASE WHEN count() > 50 THEN 50 ELSE count(*) END) AS num_sampled FROM instacart1g.orders AS vt5
DEBUG 2018-01-17 20:42:08,481 - [DbmsImpala] A new statement id: 851912430
DEBUG 2018-01-17 20:42:08,963 - [VerdictJDBCContext] The query execution finished.
DEBUG 2018-01-17 20:42:08,964 - [VerdictStatement] Internal statement set to 851912430
The text was updated successfully, but these errors were encountered:
I'll take a look as soon as soon as I get the chance. Just letting you know
on-boarding may take some time as I have to gain comfort with Java in
addition to the code base.
A query of mine using 'group by' on a column in the original query is lacking any 'group by' in the query Verdict generates to send to the database. This cause the aggregation used in the case statements to be done over the entire table rather than over the groups. The query was processed on Verdict on top of Impala.
Here is the query and debug output:
verdict:Impala> select case when count() < 50 then 1 else 0 end as sparse, case when count() > 50 then 50 else count() end as num_sampled from orders group by user_id;
DEBUG 2018-01-17 20:42:08,331 - [VerdictStatement] execute() called with: select case when count() < 50 then 1 else 0 end as sparse, case when count() > 50 then 50 else count() end as num_sampled from orders group by user_id
DEBUG 2018-01-17 20:42:08,331 - [VerdictJDBCContext] An input query:
DEBUG 2018-01-17 20:42:08,331 - [VerdictJDBCContext] select case when count() < 50 then 1 else 0 end as sparse, case when count() > 50 then 50 else count() end as num_sampled from orders group by user_id
DEBUG 2018-01-17 20:42:08,414 - [Class] [0] A query type: SELECT
DEBUG 2018-01-17 20:42:08,427 - [DbmsImpala] About to run: describe instacart1g.orders
DEBUG 2018-01-17 20:42:08,428 - [DbmsImpala] A new statement id: 1545827753
DEBUG 2018-01-17 20:42:08,481 - [ApproxProjectedRelation] A query to db: SELECT (CASE WHEN count() < 50 THEN 1 ELSE 0 END) AS
sparse
, (CASE WHEN count() > 50 THEN 50 ELSE count() END) ASnum_sampled
FROM instacart1g.orders AS vt5DEBUG 2018-01-17 20:42:08,481 - [DbmsImpala] About to run: SELECT (CASE WHEN count() < 50 THEN 1 ELSE 0 END) AS
sparse
, (CASE WHEN count() > 50 THEN 50 ELSE count(*) END) ASnum_sampled
FROM instacart1g.orders AS vt5DEBUG 2018-01-17 20:42:08,481 - [DbmsImpala] A new statement id: 851912430
DEBUG 2018-01-17 20:42:08,963 - [VerdictJDBCContext] The query execution finished.
DEBUG 2018-01-17 20:42:08,964 - [VerdictStatement] Internal statement set to 851912430
The text was updated successfully, but these errors were encountered: