Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
codegen-anyval-ir.cc
Go to the documentation of this file.
1 // Copyright 2012 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifdef IR_COMPILE
18 #include "udf/udf.h"
19 
20 using namespace impala;
21 using namespace impala_udf;
22 
23 // Note: we explicitly pass by reference because passing by value has special ABI rules
24 
25 // Used by CodegenAnyVal::Eq()
26 
27 bool StringValEq(const StringVal& x, const StringVal& y) {
28  return x == y;
29 }
30 
31 bool TimestampValEq(const TimestampVal& x, const TimestampVal& y) {
32  return x == y;
33 }
34 
35 // Used by CodegenAnyVal::EqToNativePtr()
36 
37 bool StringValueEq(const StringVal& x, const StringValue& y) {
39  return sv.Eq(y);
40 }
41 
42 bool TimestampValueEq(const TimestampVal& x, const TimestampValue& y) {
44  return tv == y;
45 }
46 
47 #else
48 #error "This file should only be used for cross compiling to IR."
49 #endif
50 
bool Eq(const StringValue &other) const
==
This object has a compatible storage format with boost::ptime.
Definition: udf.h:495
static TimestampValue FromTimestampVal(const impala_udf::TimestampVal &udf_value)
static StringValue FromStringVal(const impala_udf::StringVal &sv)
Definition: string-value.h:103