Skip to content

Commit

Permalink
fix ppl allow list bug (#512)
Browse files Browse the repository at this point in the history
Signed-off-by: xinyual <[email protected]>
  • Loading branch information
xinyual authored Jan 31, 2025
1 parent 9cb89f6 commit 1e82c0b
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 1e82c0b

Please sign in to comment.