PageRenderTime 36ms CodeModel.GetById 32ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.0.0-rc0/hive/external/odbc/src/cpp/HiveColumnDesc.h

#
C Header | 73 lines | 27 code | 10 blank | 36 comment | 0 complexity | 4ebd9256de479ad283195e864c4855fc MD5 | raw file
 1/**************************************************************************//**
 2 *
 3 * Licensed to the Apache Software Foundation (ASF) under one
 4 * or more contributor license agreements.  See the NOTICE file
 5 * distributed with this work for additional information
 6 * regarding copyright ownership.  The ASF licenses this file
 7 * to you under the Apache License, Version 2.0 (the
 8 * "License"); you may not use this file except in compliance
 9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 ******************************************************************************
20 *
21 * @file HiveColumnDesc.h
22 * @brief Provides the HiveColumnDesc class
23 *
24 *****************************************************************************/
25
26
27#ifndef __hive_column_desc_h__
28#define __hive_column_desc_h__
29
30#include "hive_metastore_types.h"
31#include "hiveconstants.h"
32
33
34/*************************************************************************************************
35 * HiveColumnDesc Class Declaration
36 ************************************************************************************************/
37
38/**
39 * @brief Descriptor for a column in a HiveResultSet.
40 *
41 * This class stores the information describing a column in a HiveResultSet.
42 * It was only meant to be created by DBCreateColumnDesc and destroyed by DBCloseColumnDesc.
43 *
44 * @see DBCreateColumnDesc()
45 * @see DBCloseColumnDesc()
46 */
47class HiveColumnDesc {
48  public:
49    HiveColumnDesc();
50    virtual ~HiveColumnDesc();
51    void initialize(Apache::Hadoop::Hive::FieldSchema& field_schema);
52    void getColumnName(char* buffer, size_t buffer_len);
53    void getColumnType(char* buffer, size_t buffer_len);
54    HiveType getHiveType();
55    int getIsNullable();
56    int getIsCaseSensitive();
57    size_t getMaxDisplaySize();
58    size_t getFieldByteSize();
59
60  private:
61    Apache::Hadoop::Hive::FieldSchema m_field_schema;
62    HiveType m_hive_type;
63    bool m_is_nullable;
64    bool m_is_case_sensitive;
65    size_t m_max_display_size;
66    size_t m_byte_size;
67
68    size_t getMaxDisplaySize(HiveType type);
69    size_t getByteSize(HiveType type);
70};
71
72
73#endif // __hive_column_desc_h__