Package org.apache.iceberg
Class TableMetadataParser
- java.lang.Object
-
- org.apache.iceberg.TableMetadataParser
-
public class TableMetadataParser extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TableMetadataParser.Codec
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TableMetadata
fromJson(FileIO io, java.lang.String json)
Read TableMetadata from a JSON string.static TableMetadata
fromJson(FileIO io, java.lang.String metadataLocation, java.lang.String json)
Read TableMetadata from a JSON string.static java.lang.String
getFileExtension(java.lang.String codecName)
static java.lang.String
getFileExtension(TableMetadataParser.Codec codec)
static java.lang.String
getOldFileExtension(TableMetadataParser.Codec codec)
static void
internalWrite(TableMetadata metadata, OutputFile outputFile, boolean overwrite)
static void
overwrite(TableMetadata metadata, OutputFile outputFile)
static TableMetadata
read(FileIO io, java.lang.String path)
static TableMetadata
read(FileIO io, InputFile file)
static java.lang.String
toJson(TableMetadata metadata)
static void
write(TableMetadata metadata, OutputFile outputFile)
-
-
-
Method Detail
-
overwrite
public static void overwrite(TableMetadata metadata, OutputFile outputFile)
-
write
public static void write(TableMetadata metadata, OutputFile outputFile)
-
internalWrite
public static void internalWrite(TableMetadata metadata, OutputFile outputFile, boolean overwrite)
-
getFileExtension
public static java.lang.String getFileExtension(java.lang.String codecName)
-
getFileExtension
public static java.lang.String getFileExtension(TableMetadataParser.Codec codec)
-
getOldFileExtension
public static java.lang.String getOldFileExtension(TableMetadataParser.Codec codec)
-
toJson
public static java.lang.String toJson(TableMetadata metadata)
-
read
public static TableMetadata read(FileIO io, java.lang.String path)
-
read
public static TableMetadata read(FileIO io, InputFile file)
-
fromJson
public static TableMetadata fromJson(FileIO io, java.lang.String json)
Read TableMetadata from a JSON string.The TableMetadata's metadata file location will be unset.
- Parameters:
io
- a FileIO used bySnapshot
instancesjson
- a JSON string of table metadata- Returns:
- a TableMetadata object
-
fromJson
public static TableMetadata fromJson(FileIO io, java.lang.String metadataLocation, java.lang.String json)
Read TableMetadata from a JSON string.- Parameters:
io
- a FileIO used bySnapshot
instancesmetadataLocation
- metadata location for the returnedTableMetadata
json
- a JSON string of table metadata- Returns:
- a TableMetadata object
-
-