OmniSciDB  c07336695a
Parser::TimestampLiteral Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::TimestampLiteral:
+ Collaboration diagram for Parser::TimestampLiteral:

Public Member Functions

 TimestampLiteral ()
std::shared_ptr< Analyzer::Expranalyze (const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::string to_string () const override
- Public Member Functions inherited from Parser::Node
virtual ~Node ()

Static Public Member Functions

static std::shared_ptr< Analyzer::Exprget (const int64_t)

Private Attributes

int64_t timestampval_

Additional Inherited Members

- Public Types inherited from Parser::Expr

Detailed Description

Definition at line 236 of file ParserNode.h.

Constructor & Destructor Documentation

◆ TimestampLiteral()

Parser::TimestampLiteral::TimestampLiteral ( )

Definition at line 238 of file ParserNode.h.

References anonymous_namespace{UpdateMetadataTest.cpp}::query.

238 { time(reinterpret_cast<time_t*>(&timestampval_)); }

Member Function Documentation

◆ analyze()

std::shared_ptr< Analyzer::Expr > Parser::TimestampLiteral::analyze ( const Catalog_Namespace::Catalog catalog,
Analyzer::Query query,
TlistRefType  allow_tlist_ref = TLIST_NONE 
) const

Implements Parser::Literal.

Definition at line 162 of file ParserNode.cpp.

165  {
166  return get(timestampval_);
167 }

◆ get()

std::shared_ptr< Analyzer::Expr > Parser::TimestampLiteral::get ( const int64_t  timestampval)

Definition at line 169 of file ParserNode.cpp.

References Datum::bigintval, anonymous_namespace{ImportTest.cpp}::d(), and kTIMESTAMP.

Referenced by RelAlgTranslator::translateNow(), and anonymous_namespace{CalciteAdapter.cpp}::CalciteAdapter::translateNow().

169  {
170  Datum d;
171  d.bigintval = timestampval;
172  return makeExpr<Analyzer::Constant>(kTIMESTAMP, false, d);
173 }
void d(const SQLTypes expected_type, const std::string &str)
Definition: ImportTest.cpp:268
int64_t bigintval
Definition: sqltypes.h:126
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ to_string()

std::string Parser::TimestampLiteral::to_string ( ) const

Implements Parser::Literal.

Definition at line 244 of file ParserNode.h.

244  {
245  // TODO: Should we convert to a datum and use the datum toString converters to pretty
246  // print?
247  return boost::lexical_cast<std::string>(timestampval_);
248  }

Member Data Documentation

◆ timestampval_

int64_t Parser::TimestampLiteral::timestampval_

Definition at line 251 of file ParserNode.h.

The documentation for this class was generated from the following files: