You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "vamshi kolanu (Jira)" <ji...@apache.org> on 2025/02/12 00:49:00 UTC
[jira] [Created] (IMPALA-13756) Impala query returning wrong results
vamshi kolanu created IMPALA-13756:
--------------------------------------
Summary: Impala query returning wrong results
Key: IMPALA-13756
URL: https://issues.apache.org/jira/browse/IMPALA-13756
Project: IMPALA
Issue Type: Bug
Components: Backend
Reporter: vamshi kolanu
How to reproduce this issue.
{code:java}
create table merge_exclude_columns
STORED BY ICEBERG
as
select CAST(1 AS INT) as id, 'hello' as msg, 'blue' as color
union all
select CAST(2 AS INT) as id, 'goodbye' as msg, 'green' as color
union all
select CAST(3 AS INT) as id, 'anyway' as msg, 'purple' as color;{code}
{code:java}
create table expected_merge_exclude_columns as select * from merge_exclude_columns; {code}
This query is supposed to find the row count difference and records difference between both the tables. Since both the tables are same, we expect row_count_difference and num_mismatched to be 0 but currently num_mismatched is being computed as 3.
{code:java}
with diff_count as (
SELECT
1 as id,
COUNT(*) as num_missing FROM (
(SELECT color, id, msg FROM expected_merge_exclude_columns EXCEPT
SELECT color, id, msg FROM merge_exclude_columns)
UNION ALL
(SELECT color, id, msg FROM merge_exclude_columns EXCEPT
SELECT color, id, msg FROM expected_merge_exclude_columns)
) as a
), table_a as (
SELECT COUNT(*) as num_rows FROM expected_merge_exclude_columns
), table_b as (
SELECT COUNT(*) as num_rows FROM merge_exclude_columns
), row_count_diff as (
select
1 as id,
table_a.num_rows - table_b.num_rows as difference
from table_a, table_b
)
select
row_count_diff.difference as row_count_difference,
diff_count.num_missing as num_mismatched
from row_count_diff
join diff_count using (id);{code}
Any help to resolve this issue is appreciated.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)