The Glue Data Catalog client, which Spark's Glue catalog and Hive's
Glue metastore use on EMR, could not read back a table it had just
created on Floci: "NullPointerException: Cannot invoke
java.lang.Integer.intValue() because the return value of
Table.retention() is null". Floci's Table had no Retention, and its
StorageDescriptor no StoredAsSubDirectories, SortColumns, BucketColumns,
SkewedInfo or AdditionalLocations, so what the client wrote was
dropped, and the client unboxes Retention, Compressed, NumberOfBuckets,
StoredAsSubDirectories and an Order's SortOrder without a null check.
Past that, a partitioned table came back with each partition, and so
each row, five times: the client reads a table's partitions in five
GetPartitions segments by default, and Floci answered every segment
with all of them.
Now:
- Table keeps Retention and IsRegisteredWithLakeFormation, and
StorageDescriptor keeps AdditionalLocations, BucketColumns,
SortColumns, SkewedInfo and StoredAsSubDirectories, and the table and
descriptor copies carry them.
- every table and partition a catalog action returns (GetTable,
GetTables, SearchTables, GetTableVersion, GetTableVersions,
GetPartition, GetPartitions, BatchGetPartition) reads Retention as 0,
IsRegisteredWithLakeFormation as false, and a storage descriptor's
Compressed, NumberOfBuckets, SortColumns and StoredAsSubDirectories
as false, 0, an empty list and false when they were written without
them, as the CLI reference's get-tables output shows Glue doing. The
stored records keep their nulls: Spectrum reads a partition's missing
Compressed as its table's.
- GetPartitions honours Segment, "a non-overlapping region of a
table's partitions": a partition is in the one segment its values
hash to, a SegmentNumber past the last holds none, and TotalSegments
outside 1 to 10, a negative SegmentNumber or a missing member is a
ValidationException, and a member that is not an integer a
SerializationException.
- a SortColumns entry that is null, lacks Column or SortOrder, or has a
SortOrder other than 0 or 1 fails the whole CreateTable, UpdateTable,
CreatePartition, UpdatePartition, BatchCreatePartition or
BatchUpdatePartition with a ValidationException before anything is
stored, as the client unboxes SortOrder on read.
- the EMR runner gives the client the job's account as its
hive.metastore.glue.catalogid, on a cluster and in an EMR Serverless
run. Given none, the client in emr-7.10.0 asks STS GetCallerIdentity
for it through an STS client no setting points at Floci, so a step
reached real AWS STS and failed. The job's own account is what an
unset one means, and a cluster's spark-hive-site or a run's
spark-defaults one, for a Data Catalog in another account, still wins.
IsRegisteredWithLakeFormation is always false, as Floci does not tie a
table to a location registered with Lake Formation.