public static TimestampString jodaToCalciteTimestampString ( final DateTime dateTime , final DateTimeZone timeZone ) { // The replaceAll is because Calcite doesn't like trailing zeroes in its fractional seconds part. String timestampString = TRAILING_ZEROS . matcher ( CALCITE_TIMESTAMP_PRINTER . print ( dateTime . withZone ( timeZone ) ) ) . replaceAll ( "" ) ; return new TimestampString ( timestampString ) ; }
Calcite expects TIMESTAMP literals to be represented by TimestampStrings in the local time zone .