-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug for not able to get sourceTables from metadata #883
Fix bug for not able to get sourceTables from metadata #883
Conversation
Signed-off-by: Sean Kao <seankao@amazon.com>
Signed-off-by: Sean Kao <seankao@amazon.com>
*/ | ||
def getSourceTablesFromMetadata(metadata: FlintMetadata): Array[String] = { | ||
logInfo(s"Getting source tables from metadata $metadata") | ||
metadata.properties.get("sourceTables") match { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can metadata.properties
to be null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no
FlintMetadata is constructed with an empty properties
map as member when there isn't any property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to enforce a single and language-independent format in metadata, e.g. JSON array?
Not quite sure.. Or do you mean using json string? Like
|
Yeah, just trying to understand where this problem comes from? Is Scala or Java array stored in metadata? |
Signed-off-by: Sean Kao <seankao@amazon.com>
76c9e0e
to
ce5fea8
Compare
mainly comes from this line of scala code. I was putting scala Array[String] here. Now I've changed it to use ArrayList. so for both cases ( |
* add logs Signed-off-by: Sean Kao <seankao@amazon.com> * match Array when reading sourceTables Signed-off-by: Sean Kao <seankao@amazon.com> * add test cases Signed-off-by: Sean Kao <seankao@amazon.com> * use ArrayList only Signed-off-by: Sean Kao <seankao@amazon.com> --------- Signed-off-by: Sean Kao <seankao@amazon.com> (cherry picked from commit dd9c0cf) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* add logs Signed-off-by: Sean Kao <seankao@amazon.com> * match Array when reading sourceTables Signed-off-by: Sean Kao <seankao@amazon.com> * add test cases Signed-off-by: Sean Kao <seankao@amazon.com> * use ArrayList only Signed-off-by: Sean Kao <seankao@amazon.com> --------- Signed-off-by: Sean Kao <seankao@amazon.com> (cherry picked from commit dd9c0cf) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* add logs * match Array when reading sourceTables * add test cases * use ArrayList only --------- (cherry picked from commit dd9c0cf) Signed-off-by: Sean Kao <seankao@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…oject#883) (opensearch-project#893) * add logs * match Array when reading sourceTables * add test cases * use ArrayList only --------- (cherry picked from commit dd9c0cf) Signed-off-by: Sean Kao <seankao@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* add logs * match Array when reading sourceTables * add test cases * use ArrayList only --------- (cherry picked from commit dd9c0cf) Signed-off-by: Sean Kao <seankao@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…oject#883) * add logs Signed-off-by: Sean Kao <seankao@amazon.com> * match Array when reading sourceTables Signed-off-by: Sean Kao <seankao@amazon.com> * add test cases Signed-off-by: Sean Kao <seankao@amazon.com> * use ArrayList only Signed-off-by: Sean Kao <seankao@amazon.com> --------- Signed-off-by: Sean Kao <seankao@amazon.com>
Description
Using custom implementation for
FlintIndexMetadataService
exposes a bug where we incorrectly get emptysourceTables
fromFlintMetadata
.Depending on how the
FlintMetadata
is generated, themetadata.properties.get("sourceTables")
could either be of type java array or scala array.This PR fixes the bug, now considering both cases.
Also added some logs for troubleshooting in production environment.
Related Issues
_meta
as read cache for frontend user to access #746By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.