Skip to content

Commit

Permalink
fix ppl allow list bug (#512) (#513)
Browse files Browse the repository at this point in the history
(cherry picked from commit 1e82c0b)

Signed-off-by: xinyual <[email protected]>
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>
  • Loading branch information
1 parent 1b18d19 commit 35d7f39
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/org/opensearch/agent/tools/PPLTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -489,13 +489,14 @@ private String constructTableInfoByPPLResultForSpark(Map<String, Object> schema,
StringJoiner tableInfoJoiner = new StringJoiner("\n");
for (String key : sortedKeys) {
String line = "";
if (ALLOWED_FIELDS_TYPE.contains(fieldsToType.get(key))) {
if (ALLOWED_FIELD_TYPE_FOR_SPARK.contains(fieldsToType.get(key))) {
line = "- " + key + ": " + fieldsToType.get(key);
if (fieldsToSample.containsKey(key)) {
line += " (" + fieldsToSample.get(key) + ")";
}
tableInfoJoiner.add(line);
}
if (fieldsToSample.containsKey(key)) {
line += " (" + fieldsToSample.get(key) + ")";
}
tableInfoJoiner.add(line);

}
return tableInfoJoiner.toString();

Expand Down

0 comments on commit 35d7f39

Please sign in to comment.