Skip to content

Conversation

@munendrasn
Copy link
Contributor

While working on issue #6763 found that lastEvaluatedKey was not set for subsequent calls in listTables()

@jackye1995 FYI

@github-actions github-actions bot added the AWS label Feb 13, 2023
public List<TableIdentifier> listTables(Namespace namespace) {
List<TableIdentifier> identifiers = Lists.newArrayList();
Map<String, AttributeValue> lastEvaluatedKey;
Map<String, AttributeValue> lastEvaluatedKey = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this change is needed? if not assigned it's default to null

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For local variables, if used without initialisation, compilation fails (using Jdk8). error: variable lastEvaluatedKey might not have been initialized

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, then it looks good to me

@jackye1995
Copy link
Contributor

Could you add an integration test about this?

@munendrasn
Copy link
Contributor Author

munendrasn commented Feb 14, 2023

I thought of updating this test to create more tables, and validate the change.

As DynamoDb Query reads max 1MB of data (when limit is not specified), need to create large number of tables (~10K with current setup) to reproduce the issue. Please let me know if I should go ahead update number of tables to higher number in the tests, or please suggest if there are any alternatives ways to test it

Locally, I could verify the fix by adding limit parameter to the query request and then calling listTables on DynamoDb with & w/o the fix

Copy link
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, that's probably why the bug has never been reported. In that case, I am good for now.

We are working on some refactoring of the AWS integration tests at the moment, and can do something about this case afterwards for scale testing. We can let you know when you can add more tests for the DynamoDB catalog to ensure its correctness.

@amogh-jahagirdar
Copy link
Contributor

+1 for adding some more AWS integration tests specifically focused on scale testing

Copy link
Contributor

@amogh-jahagirdar amogh-jahagirdar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks good to me, since it's more involved to have automated tests for this we can table it for another effort to have better scale tests for our AWS integrations.

Copy link
Contributor

@yyanyy yyanyy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing this!

@jackye1995
Copy link
Contributor

Thanks for the fix! @munendrasn

@jackye1995 jackye1995 merged commit e1a09e7 into apache:master Feb 16, 2023
@munendrasn
Copy link
Contributor Author

Thank you all for the review 🙂

@munendrasn munendrasn deleted the fix-missing-evalutation-key branch February 17, 2023 17:59
krvikash pushed a commit to krvikash/iceberg that referenced this pull request Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants