iceberg-cpp
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
iceberg::hive Namespace Reference

Hive catalog APIs. More...

Classes

class  HiveCatalog
 Catalog implementation backed by a Hive Metastore. More...
 
class  HiveCatalogProperties
 Configuration for the iceberg_hive HiveCatalog. More...
 
struct  HiveColumn
 Column metadata passed to HMS. More...
 
struct  HiveDatabase
 Subset of HMS Database used by HiveCatalog. More...
 
struct  HiveNamespace
 Namespace and properties read from HMS. More...
 
struct  HiveTable
 Subset of HMS Table used by HiveCatalog. More...
 
class  HmsClient
 A live connection to a Hive Metastore over Thrift. More...
 
struct  HmsEndpoint
 A single host:port pair parsed from an HMS URI. More...
 

Enumerations

enum class  HiveThriftTransport : uint8_t { kBuffered , kFramed }
 Thrift framing mode used to connect to the Hive Metastore. More...
 

Functions

ICEBERG_HIVE_EXPORT Result< std::string > TypeToHiveString (const Type &type)
 Render a Hive type string, including nested types. Follow Java: variant -> unknown, time/uuid -> string, fixed -> binary. Unsupported types return kNotImplemented. Zoned timestamps require Hive 3+.
 
ICEBERG_HIVE_EXPORT Result< std::vector< HiveColumn > > SchemaToHiveColumns (const Schema &schema)
 Convert top-level fields to HMS columns. Docs become comments. Field IDs and requiredness are not represented in HMS.
 
ICEBERG_HIVE_EXPORT Result< HiveDatabase > 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 ConvertFromHiveDatabase (const HiveDatabase &database)
 Extract namespace properties from an HMS database.
 
ICEBERG_HIVE_EXPORT Result< HiveTable > 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 > GetMetadataLocation (const std::unordered_map< std::string, std::string > &table_parameters)
 Return metadata_location, or kNotFound if absent or empty.
 
ICEBERG_HIVE_EXPORT Status 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 GetDefaultTableLocation (std::string_view warehouse, const Namespace &ns, std::string_view table_name)
 Return <warehouse>/<namespace>.db/<table_name>.
 
ICEBERG_HIVE_EXPORT Status ValidateNamespace (const Namespace &ns)
 Require a single-level namespace.
 
ICEBERG_HIVE_EXPORT Status 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.
 
ICEBERG_HIVE_EXPORT Result< std::vector< HmsEndpoint > > ParseHmsUris (std::string_view uri)
 Parse an HMS URI string into one or more endpoints.
 

Variables

constexpr std::string_view kMetadataLocationKey = "metadata_location"
 Iceberg-on-HMS parameter keys.
 
constexpr std::string_view kTableTypeKey = "table_type"
 
constexpr std::string_view kTableTypeIceberg = "ICEBERG"
 
constexpr std::string_view kExternalKey = "EXTERNAL"
 
constexpr std::string_view kExternalTrue = "TRUE"
 
constexpr std::string_view kCommentProperty = "comment"
 Property keys lifted into HMS fields.
 
constexpr std::string_view kLocationProperty = "location"
 
constexpr std::string_view kHmsTableOwnerProperty = "hive.metastore.table.owner"
 HMS table owner key.
 
constexpr std::string_view kHmsDbOwnerProperty = "hive.metastore.database.owner"
 HMS database owner keys.
 
constexpr std::string_view kHmsDbOwnerTypeProperty
 
constexpr std::string_view kLazySimpleSerDe
 Fallback storage descriptor classes.
 
constexpr std::string_view kFileInputFormat
 
constexpr std::string_view kFileOutputFormat
 
constexpr int kDefaultHmsPort = 9083
 Hive's well-known metastore port, used when an HMS URI omits one.
 

Detailed Description

Hive catalog APIs.

Enumeration Type Documentation

◆ HiveThriftTransport

enum class iceberg::hive::HiveThriftTransport : uint8_t
strong

Thrift framing mode used to connect to the Hive Metastore.

Most HMS deployments default to TBufferedTransport. TFramedTransport is required by HMS instances that have been configured to use framed transport (for example, certain Hive 3.x setups with SASL enabled).

Function Documentation

◆ ParseHmsUris()

ICEBERG_HIVE_EXPORT Result< std::vector< HmsEndpoint > > iceberg::hive::ParseHmsUris ( std::string_view  uri)

Parse an HMS URI string into one or more endpoints.

Each comma-separated segment is treated as an independent endpoint; surrounding whitespace and an optional thrift:// scheme prefix are stripped. Returns an InvalidArgument error if any segment fails to produce a non-empty host and a port within (0, 65535].

Variable Documentation

◆ kFileInputFormat

constexpr std::string_view iceberg::hive::kFileInputFormat
inlineconstexpr
Initial value:
=
"org.apache.hadoop.mapred.FileInputFormat"

◆ kFileOutputFormat

constexpr std::string_view iceberg::hive::kFileOutputFormat
inlineconstexpr
Initial value:
=
"org.apache.hadoop.mapred.FileOutputFormat"

◆ kHmsDbOwnerTypeProperty

constexpr std::string_view iceberg::hive::kHmsDbOwnerTypeProperty
inlineconstexpr
Initial value:
=
"hive.metastore.database.owner-type"

◆ kLazySimpleSerDe

constexpr std::string_view iceberg::hive::kLazySimpleSerDe
inlineconstexpr
Initial value:
=
"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"

Fallback storage descriptor classes.