From 75a53e165bbcdc6386d14749b9e9b95c63eea514 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Tue, 7 Apr 2015 16:15:40 +0300 Subject: [PATCH] cql3: enable WRITETIME and TTL functions SELECT WRITETIME(col), TTL(col) FROM tab --- cql3/Cql.g | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cql3/Cql.g b/cql3/Cql.g index b9033b6d86..b26fd2d53f 100644 --- a/cql3/Cql.g +++ b/cql3/Cql.g @@ -30,6 +30,7 @@ options { } @parser::includes { +#include "cql3/selection/writetime_or_ttl.hh" #include "cql3/statements/create_keyspace_statement.hh" #include "cql3/statements/create_table_statement.hh" #include "cql3/statements/property_definitions.hh" @@ -306,10 +307,8 @@ selector returns [shared_ptr s] unaliasedSelector returns [shared_ptr s] @init { shared_ptr tmp; } : ( c=cident { tmp = c; } -#if 0 - | K_WRITETIME '(' c=cident ')' { tmp = new Selectable.WritetimeOrTTL.Raw(c, true); } - | K_TTL '(' c=cident ')' { tmp = new Selectable.WritetimeOrTTL.Raw(c, false); } -#endif + | K_WRITETIME '(' c=cident ')' { tmp = make_shared(c, true); } + | K_TTL '(' c=cident ')' { tmp = make_shared(c, false); } | f=functionName args=selectionFunctionArgs { tmp = ::make_shared(std::move(f), std::move(args)); } ) #if 0