24#include <unordered_map>
39inline constexpr std::string_view kTableTypeKey =
"table_type";
40inline constexpr std::string_view kTableTypeIceberg =
"ICEBERG";
41inline constexpr std::string_view kExternalKey =
"EXTERNAL";
42inline constexpr std::string_view kExternalTrue =
"TRUE";
46inline constexpr std::string_view kLocationProperty =
"location";
53inline constexpr std::string_view kHmsDbOwnerTypeProperty =
54 "hive.metastore.database.owner-type";
58 "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe";
59inline constexpr std::string_view kFileInputFormat =
60 "org.apache.hadoop.mapred.FileInputFormat";
61inline constexpr std::string_view kFileOutputFormat =
62 "org.apache.hadoop.mapred.FileOutputFormat";
67 std::string description;
68 std::string location_uri;
69 std::unordered_map<std::string, std::string> parameters;
70 std::string owner_name;
71 std::string owner_type;
77 std::string table_name;
79 std::string table_type;
81 std::vector<HiveColumn> columns;
82 std::unordered_map<std::string, std::string> parameters;
84 std::string input_format;
85 std::string output_format;
91 std::unordered_map<std::string, std::string> properties;
96 const Namespace& ns,
const std::unordered_map<std::string, std::string>& properties);
105 const TableIdentifier& identifier,
const std::vector<HiveColumn>& columns,
106 std::string_view metadata_location, std::string_view location,
107 const std::unordered_map<std::string, std::string>& table_properties);
111 const std::unordered_map<std::string, std::string>& table_parameters);
116 const std::unordered_map<std::string, std::string>& table_parameters);
121 std::string_view table_name);
Definition expected.h:1199
Render Iceberg schemas as Hive type strings.
Define symbol visibility macros for the Hive catalog library.
Hive catalog APIs.
Definition hive_catalog.h:34
constexpr std::string_view kHmsTableOwnerProperty
HMS table owner key.
Definition hive_utils.h:49
ICEBERG_HIVE_EXPORT Status ValidateNamespace(const Namespace &ns)
Require a single-level namespace.
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....
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 ValidateIcebergTable(const TableIdentifier &identifier, const std::unordered_map< std::string, std::string > &table_parameters)
Require table_type=ICEBERG (case-insensitive).
constexpr std::string_view kMetadataLocationKey
Iceberg-on-HMS parameter keys.
Definition hive_utils.h:38
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::string > GetMetadataLocation(const std::unordered_map< std::string, std::string > &table_parameters)
Return metadata_location, or kNotFound if absent or empty.
constexpr std::string_view kCommentProperty
Property keys lifted into HMS fields.
Definition hive_utils.h:45
constexpr std::string_view kHmsDbOwnerProperty
HMS database owner keys.
Definition hive_utils.h:52
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.
constexpr std::string_view kLazySimpleSerDe
Fallback storage descriptor classes.
Definition hive_utils.h:57
Define Result, Status, and error helpers.
A namespace in a catalog.
Definition table_identifier.h:35
Identifies a table in iceberg catalog.
Definition table_identifier.h:46
Subset of HMS Database used by HiveCatalog.
Definition hive_utils.h:65
Namespace and properties read from HMS.
Definition hive_utils.h:89
Subset of HMS Table used by HiveCatalog.
Definition hive_utils.h:75