/Users/deen/code/yugabyte-db/src/yb/yql/cql/ql/ptree/pt_dml_using_clause.cc
Line | Count | Source |
1 | | // Copyright (c) YugaByte, Inc. |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
4 | | // in compliance with the License. You may obtain a copy of the License at |
5 | | // |
6 | | // http://www.apache.org/licenses/LICENSE-2.0 |
7 | | // |
8 | | // Unless required by applicable law or agreed to in writing, software distributed under the License |
9 | | // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
10 | | // or implied. See the License for the specific language governing permissions and limitations |
11 | | // under the License. |
12 | | // |
13 | | |
14 | | #include "yb/yql/cql/ql/ptree/pt_dml_using_clause.h" |
15 | | |
16 | | namespace yb { |
17 | | namespace ql { |
18 | | |
19 | 199 | Status PTDmlUsingClause::Analyze(SemContext* sem_context) { |
20 | 204 | for (PTDmlUsingClauseElement::SharedPtr tnode : node_list()) { |
21 | 204 | RETURN_NOT_OK(tnode->Analyze(sem_context)); |
22 | | // The last one in the list wins. |
23 | 194 | if (tnode->IsTTL()) { |
24 | 100 | ttl_seconds_ = tnode->value(); |
25 | 94 | } else if (tnode->IsTimestamp()) { |
26 | 94 | user_timestamp_usec_ = tnode->value(); |
27 | 94 | } |
28 | 194 | } |
29 | 189 | return Status::OK(); |
30 | 199 | } |
31 | | |
32 | 233 | const PTExprPtr& PTDmlUsingClause::ttl_seconds() const { |
33 | 233 | return ttl_seconds_; |
34 | 233 | } |
35 | | |
36 | 217 | const PTExprPtr& PTDmlUsingClause::user_timestamp_usec() const { |
37 | 217 | return user_timestamp_usec_; |
38 | 217 | } |
39 | | |
40 | | } // namespace ql |
41 | | } // namespace yb |