[source-dynamodb] Incorrect detection of primary key #40730
Labels
area/connectors
Connector related issues
autoteam
community
connectors/source/dynamodb
Stale
team/use
type/bug
Something isn't working
Connector Name
Dynamodb
Connector Version
0.3.2
What step the error happened?
Other
Relevant information
Summary
I am experiencing an issue when creating a new connection with Airbyte, where the source is DynamoDB and the destination is Snowflake. The primary key auto-detected by the system is incorrect. The detected primary key uses a dot notation chain built from all keys defined for the DynamoDB table, rather than correctly identifying the top-level primary key.
Details
My DynamoDB table has the following key structure:
Issue
Airbyte incorrectly detects the primary key as
bookedAt.externalBankAccountId.id.merchantId
, which is not a valid key in the table. This causes issues since Airbyte supports only top-level primary keys.Code Analysis
The problem seems to originate from the method used to detect the primary key. The relevant code snippet can be found here and here
According to the AWS CLI documentation, the
attributeDefinitions
method returns all attributes, not just the primary key. See official docs. Below the results I am getting within theattributeDefinitions
:However, my assumption is that the correct method to be used (the property to be accessed is
KeySchema
.Proposed Solution
Replace the usage of
attributeDefinitions
in favour ofkeySchema
to retrieve the primary key.I am willing to test and develop this fix but would appreciate guidance on the setup, development process, and contribution workflow as this is my first time contributing to this project and using Java. 🙏 #first-issue #help-welcome
Relevant log output
Contribute
The text was updated successfully, but these errors were encountered: