You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2014/09/03 19:03:53 UTC

[jira] [Created] (OPTIQ-397) "SELECT DISTINCT *" gives ClassCastException at runtime

Julian Hyde created OPTIQ-397:
---------------------------------

             Summary: "SELECT DISTINCT *" gives ClassCastException at runtime
                 Key: OPTIQ-397
                 URL: https://issues.apache.org/jira/browse/OPTIQ-397
             Project: Optiq
          Issue Type: Bug
            Reporter: Julian Hyde
            Assignee: Julian Hyde


Given the query

{code:sql}
select distinct *
from "hr"."emps"
{code}

Optiq gives the error

{code}
Caused by: java.lang.ClassCastException: net.hydromatic.optiq.test.JdbcTest$Employee cannot be cast to [Ljava.lang.Object;
	at net.hydromatic.linq4j.function.Functions$ArrayEqualityComparer.hashCode(Functions.java:491)
	at net.hydromatic.linq4j.EnumerableDefaults$Wrapped.hashCode(EnumerableDefaults.java:2252)
	at java.util.HashMap.hash(HashMap.java:338)
	at java.util.HashMap.put(HashMap.java:611)
	at java.util.HashSet.add(HashSet.java:219)
	at net.hydromatic.linq4j.EnumerableDefaults.into(EnumerableDefaults.java:2120)
	at net.hydromatic.linq4j.DefaultEnumerable.into(DefaultEnumerable.java:325)
	at net.hydromatic.linq4j.EnumerableDefaults.distinct(EnumerableDefaults.java:405)
	at net.hydromatic.linq4j.DefaultEnumerable.distinct(DefaultEnumerable.java:193)
	at Baz.bind(Unknown Source)
	at net.hydromatic.optiq.jdbc.OptiqPrepare$PrepareResult.getEnumerable(OptiqPrepare.java:270)
{code}

Suspect that {{EnumerableAggregateRel}} is not generating its input record accessor correctly.

I'll add a test case {{JdbcTest.testSelectDistinctStar}} shortly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)