calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Hyde <julianh...@gmail.com>
Subject Re: RuntimeException: while resolving method 'project'
Date Thu, 30 Oct 2014 23:11:34 GMT
I don’t think the ‘INT DUMMY’ column is coming from your query. The top of your query
will be an AggregateRel and have type ‘BIGINT ROWCOUNT’. 

Row types with 0 columns are not allowed (for various reasons I won’t go into), so some
rules create an ‘INT DUMMY’ column. I think that’s what you’re seeing. And if so,
it’s not a problem in your code.

Can you please log a jira case. The big question is why this problem occurs on your table
but not on, say, CsvTable.

Try instead

  SELECT COUNT(_MAP[‘foo’]) FROM “listings”.”listings”

and because you are using the _MAP column you won’t cause an INT DUMMY to be created, and
you’ll be able to make progress.

Julian

On Oct 30, 2014, at 3:55 PM, Hartman, Trevor <thartman@ebay.com> wrote:

> Having a hard time understanding this.
> 
> I'm using a MAP row type in my Table since my data is hierarchical:
> 
>  override def getRowType(typeFactory: RelDataTypeFactory): RelDataType =
>    typeFactory.builder().add("_MAP",
>      typeFactory.createMapType(
>        typeFactory.createSqlType(SqlTypeName.VARCHAR),
>        typeFactory.createSqlType(SqlTypeName.ANY))).build();
> 
> Otherwise I haven't specified anything about row types.
> 
> The query I'm testing is: select count(*) as rowcount from "listings"."listings"
> 
> I'm guessing that's where the row type RecordType(INTEGER NOT NULL DUMMY) NOT NULL in
the error message is coming from:
> 
> || Caused by: java.lang.AssertionError: Type mismatch:
> || rel rowtype:
> || RecordType((VARCHAR(1) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary"
NOT NULL, ANY NOT NULL) MAP NOT NULL _MAP) NOT NULL
> || equivRel rowtype:
> || RecordType(INTEGER NOT NULL DUMMY) NOT NULL
> 
> If I understand correctly: I need to dynamically determine a row type and built it accordingly,
and at some point in the query process the data is transformed from my hierarchical data structure
into a flat row of columns with a more rigid row type. Is this what deriveRowType is for in
TableScan?
> 
> Thanks,
> Trevor


Mime
View raw message