Skip to content

Commit ab73e73

Browse files
fix: sql query to fetch distinct values in datasets API (#1304)
add escape characters to the stream names in the query call query string - `select DISTINCT(p_src_ip) from \"{stream-name}\"` `\select DISTINCT(p_user_agent) from \"{stream-name}\"`
1 parent 83bc666 commit ab73e73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/prism/logstream/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ impl PrismDatasetRequest {
392392
field: &str,
393393
) -> Result<Vec<String>, QueryError> {
394394
let query = Query {
395-
query: format!("SELECT DISTINCT({field}) FROM {stream_name}"),
395+
query: format!("SELECT DISTINCT({field}) FROM \"{stream_name}\""),
396396
start_time: "1h".to_owned(),
397397
end_time: "now".to_owned(),
398398
send_null: false,

0 commit comments

Comments
 (0)