@Override
 protected Long visitTimestampLiteral(TimestampLiteral node, ConnectorSession session) {
   try {
     return parseTimestampLiteral(session.getTimeZoneKey(), node.getValue());
   } catch (Exception e) {
     throw new SemanticException(
         INVALID_LITERAL, node, "'%s' is not a valid timestamp literal", node.getValue());
   }
 }
    @Override
    protected Type visitTimestampLiteral(TimestampLiteral node, AnalysisContext context) {
      try {
        parseTimestampLiteral(session.getTimeZoneKey(), node.getValue());
      } catch (Exception e) {
        throw new SemanticException(
            INVALID_LITERAL, node, "'%s' is not a valid timestamp literal", node.getValue());
      }

      Type type;
      if (timestampHasTimeZone(node.getValue())) {
        type = TIMESTAMP_WITH_TIME_ZONE;
      } else {
        type = TIMESTAMP;
      }
      expressionTypes.put(node, type);
      return type;
    }
Beispiel #3
0
 @Override
 protected String visitTimestampLiteral(TimestampLiteral node, Boolean unmangleNames) {
   return "TIMESTAMP '" + node.getValue() + "'";
 }