[
https://issues.apache.org/jira/browse/HIVE-18537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Amruth S updated HIVE-18537:
----------------------------
Description:
Sample test case to re-produce the issue
{code:java}
create table test_cbo (
`a` BIGINT,
`b` STRING,
`c` TIMESTAMP,
`d` STRING
);
SELECT 1
FROM
(SELECT
DISTINCT
a AS a_,
b AS b_,
rank() over (partition BY a ORDER BY c DESC) AS c_,
d AS d_
FROM test_cbo
WHERE b = 'some_filter' ) n
WHERE c_ = 1;
{code}
Fails with,
{code:java}
Exception in thread "main" java.lang.AssertionError: Internal error: Cannot add
expression of different type to set:
set type is RecordType(BIGINT a_, INTEGER c_, VARCHAR(2147483647) CHARACTER SET
"UTF-16LE" COLLATE "ISO-8859-1$en_US$primary" d_) NOT NULL
expression type is RecordType(BIGINT a_, VARCHAR(2147483647) CHARACTER SET
"UTF-16LE" COLLATE "ISO-8859-1$en_US$primary" c_, INTEGER d_) NOT NULL
set is rel#112:HiveAggregate.HIVE.[](input=HepRelVertex#121,group={0, 2, 3})
expression is HiveProject#123{code}
This might be related to https://issues.apache.org/jira/browse/CALCITE-1868.
was:
Sample test case to re-produce the issue
{code:java}
create table test_cbo (
`a` BIGINT,
`b` STRING,
`c` TIMESTAMP,
`d` STRING
);
SELECT 1
FROM
(SELECT
DISTINCT
a AS a_,
b AS b_,
rank() over (partition BY a ORDER BY c DESC) AS c_,
d AS d_
FROM test_cbo
WHERE b = 'some_filter' ) n
WHERE c_ = 1;
{code}
This might be related to https://issues.apache.org/jira/browse/CALCITE-1868
> Queries with a nested distinct clause and a windowing function seem to fail
> with calcite Assertion error
> --------------------------------------------------------------------------------------------------------
>
> Key: HIVE-18537
> URL: https://issues.apache.org/jira/browse/HIVE-18537
> Project: Hive
> Issue Type: Bug
> Components: Hive
> Affects Versions: 2.3.2
> Reporter: Amruth S
> Priority: Critical
>
> Sample test case to re-produce the issue
> {code:java}
> create table test_cbo (
> `a` BIGINT,
> `b` STRING,
> `c` TIMESTAMP,
> `d` STRING
> );
> SELECT 1
> FROM
> (SELECT
> DISTINCT
> a AS a_,
> b AS b_,
> rank() over (partition BY a ORDER BY c DESC) AS c_,
> d AS d_
> FROM test_cbo
> WHERE b = 'some_filter' ) n
> WHERE c_ = 1;
> {code}
> Fails with,
> {code:java}
> Exception in thread "main" java.lang.AssertionError: Internal error: Cannot
> add expression of different type to set:
> set type is RecordType(BIGINT a_, INTEGER c_, VARCHAR(2147483647) CHARACTER
> SET "UTF-16LE" COLLATE "ISO-8859-1$en_US$primary" d_) NOT NULL
> expression type is RecordType(BIGINT a_, VARCHAR(2147483647) CHARACTER SET
> "UTF-16LE" COLLATE "ISO-8859-1$en_US$primary" c_, INTEGER d_) NOT NULL
> set is rel#112:HiveAggregate.HIVE.[](input=HepRelVertex#121,group={0, 2, 3})
> expression is HiveProject#123{code}
> This might be related to https://issues.apache.org/jira/browse/CALCITE-1868.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)