Fix bug for not able to get sourceTables from metadata#883
Fix bug for not able to get sourceTables from metadata#883seankao-az merged 4 commits intoopensearch-project:mainfrom
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.
Can metadata.properties to be null?
There was a problem hiding this comment.
no
FlintMetadata is constructed with an empty properties map as member when there isn't any property
dai-chen
left a comment
There was a problem hiding this comment.
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
FlintIndexMetadataServiceexposes a bug where we incorrectly get emptysourceTablesfromFlintMetadata.Depending on how the
FlintMetadatais 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
_metaas 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.