PageRenderTime 28ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.1-rc2/hive/external/odbc/src/cpp/HiveColumnDesc.h

#
C Header | 73 lines | 27 code | 10 blank | 36 comment | 0 complexity | 4ebd9256de479ad283195e864c4855fc MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  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. #ifndef __hive_column_desc_h__
  26. #define __hive_column_desc_h__
  27. #include "hive_metastore_types.h"
  28. #include "hiveconstants.h"
  29. /*************************************************************************************************
  30. * HiveColumnDesc Class Declaration
  31. ************************************************************************************************/
  32. /**
  33. * @brief Descriptor for a column in a HiveResultSet.
  34. *
  35. * This class stores the information describing a column in a HiveResultSet.
  36. * It was only meant to be created by DBCreateColumnDesc and destroyed by DBCloseColumnDesc.
  37. *
  38. * @see DBCreateColumnDesc()
  39. * @see DBCloseColumnDesc()
  40. */
  41. class HiveColumnDesc {
  42. public:
  43. HiveColumnDesc();
  44. virtual ~HiveColumnDesc();
  45. void initialize(Apache::Hadoop::Hive::FieldSchema& field_schema);
  46. void getColumnName(char* buffer, size_t buffer_len);
  47. void getColumnType(char* buffer, size_t buffer_len);
  48. HiveType getHiveType();
  49. int getIsNullable();
  50. int getIsCaseSensitive();
  51. size_t getMaxDisplaySize();
  52. size_t getFieldByteSize();
  53. private:
  54. Apache::Hadoop::Hive::FieldSchema m_field_schema;
  55. HiveType m_hive_type;
  56. bool m_is_nullable;
  57. bool m_is_case_sensitive;
  58. size_t m_max_display_size;
  59. size_t m_byte_size;
  60. size_t getMaxDisplaySize(HiveType type);
  61. size_t getByteSize(HiveType type);
  62. };
  63. #endif // __hive_column_desc_h__