calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hartman, Trevor" <thart...@ebay.com>
Subject Re: RuntimeException: while resolving method 'project'
Date Thu, 30 Oct 2014 22:55:42 GMT
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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message