iceberg-cpp
Loading...
Searching...
No Matches
Classes | Namespaces | Functions | Variables
hive_utils.h File Reference

Convert Iceberg catalog objects to HMS records. More...

#include <string>
#include <string_view>
#include <unordered_map>
#include <vector>
#include "iceberg/catalog/hive/hive_schema.h"
#include "iceberg/catalog/hive/iceberg_hive_export.h"
#include "iceberg/result.h"
#include "iceberg/table_identifier.h"

Go to the source code of this file.

Classes

struct  iceberg::hive::HiveDatabase
 Subset of HMS Database used by HiveCatalog. More...
 
struct  iceberg::hive::HiveTable
 Subset of HMS Table used by HiveCatalog. More...
 
struct  iceberg::hive::HiveNamespace
 Namespace and properties read from HMS. More...
 

Namespaces

namespace  iceberg
 Core Apache Iceberg C++ APIs.
 
namespace  iceberg::hive
 Hive catalog APIs.
 

Functions

ICEBERG_HIVE_EXPORT Result< HiveDatabase > iceberg::hive::ConvertToHiveDatabase (const Namespace &ns, const std::unordered_map< std::string, std::string > &properties)
 Lift reserved properties into HMS fields. Caller resolves defaults.
 
ICEBERG_HIVE_EXPORT HiveNamespace iceberg::hive::ConvertFromHiveDatabase (const HiveDatabase &database)
 Extract namespace properties from an HMS database.
 
ICEBERG_HIVE_EXPORT Result< HiveTable > iceberg::hive::ConvertToHiveTable (const TableIdentifier &identifier, const std::vector< HiveColumn > &columns, std::string_view metadata_location, std::string_view location, const std::unordered_map< std::string, std::string > &table_properties)
 Build an external Iceberg table with a LazySimpleSerDe descriptor. Translate gc.enabled to external.table.purge. Catalog markers override user properties. metadata_location must be non-empty; caller resolves the owner.
 
ICEBERG_HIVE_EXPORT Result< std::string > iceberg::hive::GetMetadataLocation (const std::unordered_map< std::string, std::string > &table_parameters)
 Return metadata_location, or kNotFound if absent or empty.
 
ICEBERG_HIVE_EXPORT Status iceberg::hive::ValidateIcebergTable (const TableIdentifier &identifier, const std::unordered_map< std::string, std::string > &table_parameters)
 Require table_type=ICEBERG (case-insensitive).
 
ICEBERG_HIVE_EXPORT std::string iceberg::hive::GetDefaultTableLocation (std::string_view warehouse, const Namespace &ns, std::string_view table_name)
 Return <warehouse>/<namespace>.db/<table_name>.
 
ICEBERG_HIVE_EXPORT Status iceberg::hive::ValidateNamespace (const Namespace &ns)
 Require a single-level namespace.
 
ICEBERG_HIVE_EXPORT Status iceberg::hive::ValidateOwnerSettings (const std::unordered_map< std::string, std::string > &properties)
 Require owner when owner-type is set. owner-type must be USER, GROUP or ROLE.
 

Variables

constexpr std::string_view iceberg::hive::kMetadataLocationKey = "metadata_location"
 Iceberg-on-HMS parameter keys.
 
constexpr std::string_view iceberg::hive::kTableTypeKey = "table_type"
 
constexpr std::string_view iceberg::hive::kTableTypeIceberg = "ICEBERG"
 
constexpr std::string_view iceberg::hive::kExternalKey = "EXTERNAL"
 
constexpr std::string_view iceberg::hive::kExternalTrue = "TRUE"
 
constexpr std::string_view iceberg::hive::kCommentProperty = "comment"
 Property keys lifted into HMS fields.
 
constexpr std::string_view iceberg::hive::kLocationProperty = "location"
 
constexpr std::string_view iceberg::hive::kHmsTableOwnerProperty = "hive.metastore.table.owner"
 HMS table owner key.
 
constexpr std::string_view iceberg::hive::kHmsDbOwnerProperty = "hive.metastore.database.owner"
 HMS database owner keys.
 
constexpr std::string_view iceberg::hive::kHmsDbOwnerTypeProperty
 
constexpr std::string_view iceberg::hive::kLazySimpleSerDe
 Fallback storage descriptor classes.
 
constexpr std::string_view iceberg::hive::kFileInputFormat
 
constexpr std::string_view iceberg::hive::kFileOutputFormat
 

Detailed Description

Convert Iceberg catalog objects to HMS records.