Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
udf-debug.h
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
16
#ifndef IMPALA_UDF_UDF_DEBUG_H
17
#define IMPALA_UDF_UDF_DEBUG_H
18
19
#include "
udf/udf.h
"
20
21
#include <string>
22
#include <sstream>
23
24
namespace
impala_udf {
25
26
template
<
typename
T>
27
inline
std::string
DebugString
(
const
T& val) {
28
if
(val.is_null)
return
"NULL"
;
29
std::stringstream ss;
30
ss << val.val;
31
return
ss.str();
32
}
33
34
template
<>
35
inline
std::string
DebugString
(
const
StringVal
& val) {
36
if
(val.
is_null
)
return
"NULL"
;
37
return
std::string(reinterpret_cast<const char*>(val.
ptr
), val.
len
);
38
}
39
40
}
41
42
#endif
43
udf.h
impala_udf::StringVal::ptr
uint8_t * ptr
Definition:
udf.h:523
impala_udf::AnyVal::is_null
bool is_null
Definition:
udf.h:359
impala_udf::DebugString
std::string DebugString(const T &val)
Definition:
udf-debug.h:27
impala_udf::StringVal
Definition:
udf.h:521
impala_udf::StringVal::len
int len
Definition:
udf.h:522
be
src
udf
udf-debug.h
Generated on Thu May 7 2015 16:10:37 for Impala by
1.8.6