The Web API Reference gives SegmentNumber a minimum of 0 and says "if
the total number of segments is 4, SegmentNumber values range from 0
through 3", but not what a SegmentNumber of TotalSegments or more
returns. Floci returns no partitions for one, and
GlueCatalogClientFieldsIntegrationTest pins it. glue.md's GetPartitions
row now says that answer is Floci's reading.
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.
* feat(glue): data quality rulesets
CreateDataQualityRuleset, GetDataQualityRuleset, UpdateDataQualityRuleset
and DeleteDataQualityRuleset answered InvalidAction, and
ListDataQualityRulesets always returned an empty list, so Terraform's
aws_glue_data_quality_ruleset failed at its first apply.
Rulesets are now stored per account and Region by name, with their
description, DQDL text, target table, security configuration and created
and last modified times, and tagged through the shared tag store by their
dataQualityRuleset ARN. Update replaces only the members the request sets.
List returns them in name order with RuleCount, filtered by name,
description, target table, created and last modified times and tags, and
paged by MaxResults and NextToken. Errors follow the model:
AlreadyExistsException for a duplicate, EntityNotFoundException for an
unknown name, InvalidInputException for a missing or oversized member.
Rulesets are stored, not evaluated.
Closes#6830
* fix(glue): match a ruleset's catalog and take its store from the caller
The ListDataQualityRulesets target table filter compared only TableName and
DatabaseName, so filtering for one catalog also returned a ruleset on the
same table in another. A CatalogId in the filter now has to match too, with
a target table that names no catalog in the account's own.
The package-private GlueService constructor built the ruleset store itself;
it now takes it as an argument, as it does every other store.
* fix(glue): reuse hasTags and AwsJsonTimestamp for ruleset listing
The ruleset tag filter now goes through hasTags, as jobs, crawlers and
triggers do, and the list filter's timestamps through
AwsJsonTimestamp.epochSeconds, so a timestamp sent as a string is refused
with InvalidInputException as the SDKs never send one.
---------
Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
* fix(glue): paginate security configurations
Honor GetSecurityConfigurations page size and continuation tokens using the existing Glue paging helper. Enforce the documented 1-200 range and preserve account and region isolation.
* refactor(glue): share action-specific pagination limits
Centralize range validation for security configurations, workflows and triggers. Defer list loading until after validation to preserve dependent-job error ordering and keep the existing default and general helper limit.
Extend the shared read-time defaults to long, double, decimal, date, and boolean statistics so primitive-count readers receive zeros. Preserve supplied values, optional bounds, and stored records.
Glue had no workflows: CreateWorkflow, StartWorkflowRun and the rest
answered InvalidAction. Add CreateWorkflow, GetWorkflow, ListWorkflows,
BatchGetWorkflows, UpdateWorkflow, DeleteWorkflow, StartWorkflowRun,
StopWorkflowRun, ResumeWorkflowRun, GetWorkflowRun, GetWorkflowRuns,
GetWorkflowRunProperties and PutWorkflowRunProperties, and let triggers
belong to a workflow.
StartWorkflowRun fires the workflow's starting triggers inside a new
run. The workflow's conditional triggers fire only on job runs and
crawls of that run, evaluate AND within it, and start their actions in
it; job runs get --WORKFLOW_NAME and --WORKFLOW_RUN_ID. A run completes
once nothing in it runs and nothing more fires. GetWorkflow and
GetWorkflowRun report the graph of trigger, job and crawler nodes.
Closes#4380
Glue had no triggers: CreateTrigger and the rest answered InvalidAction.
Add CreateTrigger, GetTrigger, GetTriggers, ListTriggers,
BatchGetTriggers, UpdateTrigger, DeleteTrigger, StartTrigger and
StopTrigger.
StartTrigger runs an ON_DEMAND trigger's actions. An activated
CONDITIONAL trigger fires when a watched job run or crawl finishes in
the named state, evaluated after every Glue request, so a chain of
triggers completes within the request that starts it when runs finish
at once. Runs started by a trigger carry its TriggerName. SCHEDULED
triggers are stored and can be activated but do not fire on a timer.
Part of #4380
A crawler could be defined but never run: StartCrawler answered
InvalidAction and a crawler stayed READY with no LastCrawl. Add
StartCrawler, StopCrawler, GetCrawlerMetrics, ListCrawlers,
BatchGetCrawlers, UpdateCrawlerSchedule, StartCrawlerSchedule and
StopCrawlerSchedule.
Crawls follow the crawler state machine without reading data and are
settled on read, as job runs are;
floci.services.glue.crawler-run-duration-seconds (default 0) can keep a
crawler RUNNING. UpdateCrawler and DeleteCrawler are refused while a
crawl runs, and DeleteCrawler removes the crawl history.
Part of #4380
A job could be created but never run: StartJobRun and the other run
actions answered InvalidAction. Add StartJobRun, GetJobRun, GetJobRuns,
BatchStopJobRun, ListJobs and BatchGetJobs.
Runs follow Glue's state machine without executing the script. They are
settled on read, so floci.services.glue.job-run-duration-seconds (default
0, succeed at once) can keep a run RUNNING long enough to stop it or hit
MaxConcurrentRuns. DeleteJob also removes the job's runs.
Part of #4380
* feat(glue): add security configuration CRUD
Implement AWS Glue security configuration create, get, list, and delete operations with encrypted configuration round trips, account and region isolation, persistence, and integration coverage.
* fix(glue): close catalog encryption handler case
Close the PutDataCatalogEncryptionSettings switch arm so the merged security configuration cases compile.
* test(glue): cover empty security configuration lists
Restore coverage for the empty GetSecurityConfigurations response and keep the test setup aligned with the rebased GlueService constructor.
* refactor(glue): name security configuration length limit
Use a named constant for the documented 255-character security configuration name limit.
* fix(glue): serialize security configuration timestamps
* feat(glue): catalog resource policy and Data Catalog encryption settings
Add PutResourcePolicy, GetResourcePolicy, GetResourcePolicies and
DeleteResourcePolicy with the PolicyExistsCondition and
PolicyHashCondition checks Terraform relies on, and Get/Put
DataCatalogEncryptionSettings with the documented defaults.
ConnectionPasswordEncryption is applied rather than stored: while it is
on, CreateConnection and UpdateConnection encrypt PASSWORD and the four
Kafka passwords with the configured KMS key and keep them under their
documented ENCRYPTED_* names, so reads return the ciphertext and a
missing key is GlueEncryptionException.
Closes#4023
* docs(glue): cite the source for connection password encryption timing and drop an unsourced claim
The developer guide states that whether a password is encrypted was
decided when the connection was created or updated, which is the
source for connections keeping their plaintext; the missing-key error
is described as the error CreateConnection and UpdateConnection list
rather than as AWS behaviour. Also replaces a var in the compat test
with the explicit type.
* feat(glue): Data Catalog connections
Add CreateConnection, GetConnection, GetConnections, UpdateConnection,
DeleteConnection, BatchDeleteConnection and TestConnection. A connection
precedes every job and crawler in a Glue stack and Terraform reads it on
each plan, so without it a stack with an aws_glue_connection could not
get past its first plan.
Behaviour follows the Glue API reference: HidePassword omits PASSWORD
and ENCRYPTED_PASSWORD, UpdateConnection redefines the connection rather
than merging into it, ConnectionInput is validated against the documented
limits and enumerations, credentials are accepted and never returned,
and TestConnection accepts a well-formed request with an empty body
without opening a socket.
Closes#3938
* feat(glue): cap BatchDeleteConnection at 25 names and document HidePassword's scope
The API reference caps ConnectionNameList at 25 entries; a longer list
is now InvalidInputException. HidePassword's coverage of the Kafka
credential keys is not documented by AWS, so the docs page states that
Floci removes PASSWORD and ENCRYPTED_PASSWORD only.
GetTableVersion answers one archived version by VersionId, or the
current table when none is given; an unknown version is
EntityNotFoundException and a non-integer one InvalidInputException.
DeleteTableVersion and BatchDeleteTableVersion drop archived versions,
the batch form reporting per-version Errors; the current version is
refused, as AWS refuses it on the console and the API, since DeleteTable
is the way to drop it.
BatchDeletePartition deletes up to 25 partitions and reports the ones
not found in Errors, the shape the other batch partition calls use.
SearchTables searches every table of the catalog: SearchText as a
substring of name, database, description, owner, columns and parameter
values (exact when quoted), Filters with the API reference's tokenised
match for string keys and a Comparator for the time fields, SortCriteria
on the same fields, and MaxResults with NextToken paging.
Closes#3826
* feat(athena): read Iceberg-format Glue tables via iceberg_scan
Glue tables written by pyiceberg's GlueCatalog (Parameters.table_type=
ICEBERG) never populate StorageDescriptor.InputFormat/SerializationLibrary,
so GlueViewDdlBuilder's format-sniffing heuristic always fell through to
read_csv_auto and failed parsing the table's binary Parquet data files.
Detect Iceberg tables via Parameters.table_type and build the view from
iceberg_scan(Parameters.metadata_location) instead, following the table's
real manifest list rather than globbing every Parquet file physically
present under its location -- which also fixes silently wrong results for
any table with more than one snapshot (updates, deletes, repeated
appends), not just the CSV-parse failure on a single-snapshot table.
The iceberg extension is installed/loaded once, only when the DDL batch
actually contains an Iceberg table. A table flagged ICEBERG but missing
metadata_location falls back to the existing format-sniffed heuristic.
Verified against a live build: pyiceberg write -> Athena SELECT returns
correct rows for both a single-snapshot and a two-snapshot table; full
athena + glue test suites (352 tests) pass with no regressions.
Fixes#3737
This change was implemented by Claude (Anthropic's AI coding assistant),
working on behalf of @maurice1979 who filed the linked issue.
* docs(athena): fix formatting and clarify Iceberg handling explanation
Corrected formatting and clarified the explanation regarding Iceberg
tables and their handling in DuckDB.
Signed-off-by: Jordi Vidal de LLobatera <is.maurice@protonmail.com>
* docs(glue): cross-reference Iceberg handling from glue.md; fix em dash
docs/services/glue.md still described only the InputFormat/SerdeInfo
format-sniffing heuristic for choosing a DuckDB read function, without
mentioning that Iceberg-format tables (Parameters.table_type=ICEBERG)
bypass it entirely via iceberg_scan, per the change in the previous
commit. Added a short cross-reference to Athena's format-inference docs
so glue.md doesn't describe stale, pre-fix behavior.
Also removed an em dash from GlueViewDdlBuilder's new Javadoc, per this
repo's own AGENTS.md style rule (no em dashes; colons, commas, or
periods instead). The matching instance in docs/services/athena.md was
already fixed via the Copilot autofix suggestion.
Both findings came from the Copilot pull request review on #3738.
This change was implemented by Claude (Anthropic's AI coding assistant),
working on behalf of @maurice1979.
---------
Signed-off-by: Jordi Vidal de LLobatera <is.maurice@protonmail.com>
* feat(glue): implement partition indexes
CreatePartitionIndex and DeletePartitionIndex were missing, and
GetPartitionIndexes was a stub that resolved the table and then always
returned an empty list. A client could create an index and read back
nothing, and Terraform's aws_glue_partition_index could not apply at all.
Behaviour captured against real Glue in us-west-2, on a table partitioned
by tenant/year/month/day:
- an index key must name a partition column, else InvalidInputException
"IndexKeys not a part of PartitionColumns. Verify the indexKeys : [x]"
- keys need not be a prefix of the partition keys, and need not be in
partition order: [year] and [month, tenant] are both accepted
- a repeated index name gives AlreadyExistsException "... already exists
with the same name."
- a repeated key list under a new name is refused too: "... already
exists with the same keys." The comparison is order sensitive, so
[year, month] and [month, year] are distinct indexes
- a fourth index gives ResourceNumberLimitExceededException "Partition
index limit exceeded. Maximum: 3", and the cap is evaluated before the
duplicate checks
- deleting an unknown index gives EntityNotFoundException "Index with the
given indexName : x does not exist."
- a read resolves each key to its name and type from the table's
partition keys, while a create carries names only
Indexes live in their own store keyed by the table key, so the existing
deleteTable cascade sweeps them and a recreated table starts clean.
One deliberate divergence: an index is stored ACTIVE immediately. Real
Glue creates asynchronously, reports CREATING while it backfills, and
refuses a concurrent create on the same table. Settling immediately keeps
tests free of polling, and a client that waits for ACTIVE (the Terraform
provider does) completes on its first read.
Verified end to end against a local floci: the SDK round-trips create,
read and delete, every error above matches the capture, and a real
aws_glue_partition_index applies and destroys cleanly.
* feat(glue): expose the partition index lifecycle
The first cut stored an index ACTIVE on create and removed it on delete,
treating the lifecycle as an internal detail. It is not: a caller reads
IndexStatus from GetPartitionIndexes and can branch on it, so collapsing
the states changed an AWS-visible contract.
Captured against real Glue in us-west-2:
- a new index reports CREATING for roughly 12 seconds, then ACTIVE
- a deleted index reports DELETING before it disappears
- while either is in progress, another create on the same table gives
ResourceNumberLimitExceededException "Index <name> is in <STATE>
state. Only 1 index can be created or deleted simultaneously per
table."
- an index that is still CREATING cannot be deleted: Glue reports
EntityNotFoundException "Index with the given indexName : <name> does
not exist." even while a read lists it as CREATING. Measured in
isolation, with nothing else in flight
The transitions are driven by reads rather than wall-clock time, so they
stay deterministic and tests need no sleeps: each GetPartitionIndexes
reports the current state and settles it, so the next read sees the
outcome. A client that polls converges on its second call.
FAILED is not emulated; it only arises from a backfill failure.
Verified with a real aws_glue_partition_index against a local floci:
apply polls CREATING to ACTIVE and completes, a refresh reports no drift,
and destroy passes through DELETING.
Also replaces var with explicit types and drops inline fully-qualified
names in the tests, per the AGENTS.md rule.
* docs(glue): correct two javadocs left behind by the index lifecycle
Both still said an index is stored ACTIVE immediately, which stopped being
true when createPartitionIndex started storing CREATING and letting
GetPartitionIndexes settle it.
* fix(glue): serialize partition index writes against their own reads
createPartitionIndex reads the stored indexes, checks the cap and the duplicate
rules, then writes, with nothing holding that together. Two concurrent creates
on a table at two indexes both saw room under the cap of three and both wrote,
leaving four. Nothing repairs that afterwards.
create, delete and the settling loop in getPartitionIndexes now carry the same
synchronized treatment updateTable already uses for its own check-then-write.
* feat(glue): implement CRUD operations for Jobs and Crawlers
* fix(glue): resolve edge cases in jobs, crawlers, and tagging implementation
- Fix DynamoDBTarget ScanAll/ScanRate JsonProperty casing
- Support MaxResults and NextToken pagination in GetJobs and GetCrawlers
- Throw EntityNotFoundException for unknown Job/Crawler deletions
- Retain existing configuration values during Crawler updates
- Use centralized ResourceGroupsTaggingService for non-schema TagResource/UntagResource/GetTags actions
* test(glue): add CRUD, pagination, and tagging tests for Jobs and Crawlers
* fix(glue): validate pagination limits and ARN existence for tagging
* fix(glue): enforce AWS-compliant validation, semantics, and responses
- Add required field validation to Job and Crawler CRUD operations.
- Persist SourceControlDetails and ProfileName across Job updates.
- Set default State (READY) and Version for Crawlers on creation.
- Standardize empty-body responses to bare Response.ok() per AWS specs.
- Add handler-level integration tests for request payload parsing.
- Refactor GlueServiceTest to use valid mock objects and standard imports.
* fix(glue): add missing ARN validation for databases, tables, and UDFs
- Restore EntityNotFoundException when attempting to tag nonexistent Databases, Tables, or UserDefinedFunctions.
- Expand tagging tests to verify behavior for these resources.
* chore(glue): apply AWS defaults for Job creation and remove unused Crawler DTOs
- Apply default GlueVersion (5.1) and Timeout (480/2880 based on version) for newly created Jobs.
- Remove empty Create/Update/DeleteCrawlerResponse models since they are unused.
* fix(glue): throw EntityNotFoundException for unmodeled resource ARNs
- Prevent validateResourceExists from silently passing when an ARN type isn't supported (e.g. connections).
- Any ARN not matching jobs, crawlers, databases, tables, or UDFs now throws.
* docs: fill supported action descriptions
* docs(elb): describe listener default rule as non-deletable, not immutable
The CreateListener row called the default rule "immutable", which contradicts
the ModifyListener row (updates default actions) and the file's own note that
the rule can be changed via ModifyListener. The rule cannot be deleted or
reprioritized, but its action is mutable, so "non-deletable" is accurate.
* feat(glue): add Glue Schema Registry support
* Move Glue SDK coverage to compatibility tests
* Align protobuf compatibility expectations
* Resolve services index merge conflict
* Remove unused Lombok compatibility dependency
* Serialize Glue schema registry timestamps as strings
* Tighten Glue schema registry name validation
* Avoid duplicate schema registry index rebuild
* Limit schema registry in-memory constructor visibility
* Clone Glue tables before resolving schema references
* Align Glue schema registry response shapes
* Extract Glue schema version resolver helper
Both validateSchemaReference and withResolvedSchemaReference duplicated
the latest-version computation and the four-argument getSchemaVersion
call. Pull that into a private resolveSchemaVersion(SchemaReference)
helper so the call sites read at one level of abstraction and a future
change to the resolution rule lands in one place.
* Fix Glue schema version list projection
---------
Signed-off-by: Tristan Burch <tburch@users.noreply.github.com>
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Hector Ventura <hectorvent@gmail.com>
* feat(athena): real SQL execution via floci-duck DuckDB sidecar
- Lazy-start floci/floci-duck:latest on first StartQueryExecution call;
reuse the running container for all subsequent queries
- Inject Glue tables as CREATE OR REPLACE VIEW statements via setup_sql
before the user SQL so DDL runs outside the COPY(...) wrapper
- SerDe-aware format inference: inferReadFunction now checks
SerdeInfo.SerializationLibrary in addition to InputFormat, so standard
AWS JSON tables (TextInputFormat + JsonSerDe) map to read_json_auto
- ImageCacheService: skip Docker Hub pull when image is already present
locally, preventing local builds from being overwritten
- Add AthenaIntegrationTest (5 unit integration tests)
- Add AthenaTest and DataLakeTest SDK compatibility tests
- Update docs: athena.md (full rewrite), glue.md, README, CHANGELOG
* fix: docker image check fix
* feat: implement local Data Lake stack (Athena, Glue, and Firehose)
* fix: adding athena, firehose and glue documentation
* fix: updating dataLateTest