Ejemplo n.º 1
0
 @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());
   }
 }
Ejemplo n.º 2
0
    @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;
    }
Ejemplo n.º 3
0
 @Override
 protected String visitTimestampLiteral(TimestampLiteral node, Boolean unmangleNames) {
   return "TIMESTAMP '" + node.getValue() + "'";
 }