calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nuwan Abeysiriwardana <nuwan...@gmail.com>
Subject monotonic column not working
Date Mon, 31 Oct 2016 17:30:28 GMT
Hi All,

 i have  create a table which handle stream of java hashmap pair with the
rowTime column. abstract table getRowType implementation given below.

 @Override
    public RelDataType getRowType(RelDataTypeFactory typeFactory) {
            return typeFactory.builder().add("_MAP",
        typeFactory.createMapType(
            typeFactory.createSqlType(SqlTypeName.VARCHAR),
            typeFactory.createTypeWithNullability(
                typeFactory.createSqlType(SqlTypeName.ANY),
true))).add("rowTime",typeFactory.createSqlType(SqlTypeName.TIMESTAMP)).build();
    }

idea is to use order by with floor(rowTime TO HOUR) .sample query as
follows.

select stream _MAP['name'],rowTime from event where cast(_MAP['age'] as INT
)  >= 10 order by floor(event.rowTime TO HOUR)

it giving me error saying  : 'Streaming ORDER BY must start with monotonic
expression'

i can't find any special handling in the sample csv stream implementation
as well.

following query works fine.
   select stream _MAP['name'],rowTime from event

so that means rowTime identified properly as timestamp.
please help.

calcite version :
  <dependency>
                <groupId>org.apache.calcite</groupId>
                <artifactId>calcite-core</artifactId>
                <version>1.10.0</version>
            </dependency>

thanks
nuwan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message