HuaHuaY commented on code in PR #386:
URL: https://github.com/apache/iceberg-cpp/pull/386#discussion_r2597464575
##########
src/iceberg/table_metadata.h:
##########
@@ -458,14 +467,41 @@ enum class ICEBERG_EXPORT MetadataFileCodecType {
kGzip,
};
-/// \brief Utility class for table metadata
-struct ICEBERG_EXPORT TableMetadataUtil {
+struct ICEBERG_EXPORT CodecTypeUtil {
+ /// \brief Returns the MetadataFileCodecType corresponding to the given
string.
+ ///
+ /// \param name The string to parse.
+ /// \return The MetadataFileCodecType corresponding to the given string.
+ static Result<MetadataFileCodecType> CodecFromString(const std::string_view&
name);
+
/// \brief Get the codec type from the table metadata file name.
///
/// \param file_name The name of the table metadata file.
/// \return The codec type of the table metadata file.
static Result<MetadataFileCodecType> CodecFromFileName(std::string_view
file_name);
+ /// \brief Get the file extension from the codec type.
+ /// \param codec The codec name.
+ /// \return The file extension of the codec.
+ static Result<std::string> CodecNameToFileExtension(const std::string_view&
codec);
+
+ /// \brief Get the file extension from the codec type.
+ /// \param codec The codec type.
+ /// \return The file extension of the codec.
+ static std::string CodecTypeToFileExtension(MetadataFileCodecType codec);
+
+ inline static constexpr std::string_view kTableMetadataFileSuffix =
".metadata.json";
Review Comment:
Sorry that I have no time last week so I didn't review your previous PR.
This project is under at least C++23, so we don't need inline to avoid ODR
violations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]