Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
static-asserts.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
#include <boost/static_assert.hpp>
16
17
#include "
common/hdfs.h
"
18
#include "
runtime/buffered-tuple-stream.h
"
19
#include "
runtime/string-value.h
"
20
#include "
runtime/timestamp-value.h
"
21
#include "
udf/udf.h
"
22
23
namespace
impala {
24
// This class is unused. It contains static (compile time) asserts.
25
// This is useful to validate struct sizes and other similar things
26
// at compile time. If these asserts fail, the compile will fail.
27
class
UnusedClass
{
28
private
:
29
BOOST_STATIC_ASSERT
(
sizeof
(
StringValue
) == 16);
30
BOOST_STATIC_ASSERT
(offsetof(
StringValue
, len) == 8);
31
BOOST_STATIC_ASSERT
(
sizeof
(
TimestampValue
) == 16);
32
BOOST_STATIC_ASSERT
(offsetof(
TimestampValue
, date_) == 8);
33
BOOST_STATIC_ASSERT
(
sizeof
(boost::posix_time::time_duration) == 8);
34
BOOST_STATIC_ASSERT
(
sizeof
(boost::gregorian::date) == 4);
35
BOOST_STATIC_ASSERT
(
sizeof
(hdfsFS) ==
sizeof
(
void
*));
36
BOOST_STATIC_ASSERT
(
sizeof
(hdfsFile) ==
sizeof
(
void
*));
37
BOOST_STATIC_ASSERT
(
sizeof
(
BufferedTupleStream::RowIdx
) ==
sizeof
(
void
*));
38
39
// If the memory layout of any of these types changes, it will be necessary to change
40
// LlvmCodeGen::GetUdfValType(), and we may also run into calling convention problems
41
// with codegen'd calls to UDFs.
42
BOOST_STATIC_ASSERT
(
sizeof
(
impala_udf::BooleanVal
) == 2);
43
BOOST_STATIC_ASSERT
(
sizeof
(
impala_udf::TinyIntVal
) == 2);
44
BOOST_STATIC_ASSERT
(
sizeof
(
impala_udf::SmallIntVal
) == 4);
45
BOOST_STATIC_ASSERT
(
sizeof
(
impala_udf::IntVal
) == 8);
46
BOOST_STATIC_ASSERT
(
sizeof
(
impala_udf::BigIntVal
) == 16);
47
BOOST_STATIC_ASSERT
(
sizeof
(
impala_udf::FloatVal
) == 8);
48
BOOST_STATIC_ASSERT
(
sizeof
(
impala_udf::DoubleVal
) == 16);
49
BOOST_STATIC_ASSERT
(
sizeof
(
impala_udf::StringVal
) == 16);
50
};
51
52
}
timestamp-value.h
impala::StringValue
Definition:
string-value.h:33
buffered-tuple-stream.h
impala_udf::DoubleVal
Definition:
udf.h:475
udf.h
impala_udf::TinyIntVal
Definition:
udf.h:382
impala_udf::FloatVal
Definition:
udf.h:458
impala::UnusedClass
Definition:
static-asserts.cc:27
impala::UnusedClass::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT(sizeof(StringValue)==16)
impala_udf::SmallIntVal
Definition:
udf.h:401
impala::TimestampValue
Definition:
timestamp-value.h:65
impala_udf::StringVal
Definition:
udf.h:521
impala_udf::IntVal
Definition:
udf.h:420
hdfs.h
impala_udf::BigIntVal
Definition:
udf.h:439
impala::BufferedTupleStream::RowIdx
Definition:
buffered-tuple-stream.h:121
string-value.h
impala_udf::BooleanVal
Definition:
udf.h:363
be
src
util
static-asserts.cc
Generated on Thu May 7 2015 16:10:38 for Impala by
1.8.6