You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let escaped_field_name = field_name.replace('"',"\"\"");
1195
+
let escaped_stream_name = stream_name.replace('"',"\"\"");
1196
+
1205
1197
let sql = format!(
1206
-
"select count(*) as distinct_count, \"{field_name}\" from \"{stream_name}\" group by \"{field_name}\" order by distinct_count desc limit {}",
1198
+
"select count(*) as distinct_count, \"{escaped_field_name}\" from \"{escaped_stream_name}\" group by \"{escaped_field_name}\" order by distinct_count desc limit {}",
1207
1199
PARSEABLE.options.max_field_statistics
1208
1200
);
1209
1201
letmut distinct_stats = Vec::new();
1210
1202
ifletOk(df) = ctx.sql(&sql).await{
1211
-
letmut stream = df.execute_stream().await.expect("Failed to execute stream");
1203
+
letmut stream = match df.execute_stream().await{
1204
+
Ok(stream) => stream,
1205
+
Err(e) => {
1206
+
warn!("Failed to execute distinct stats query: {e}");
1207
+
return distinct_stats;// Return empty if query fails
1208
+
}
1209
+
};
1212
1210
whileletSome(batch_result) = stream.next().await{
1213
-
let rb = batch_result.expect("Failed to execute stream");
1211
+
let rb = match batch_result {
1212
+
Ok(batch) => batch,
1213
+
Err(e) => {
1214
+
warn!("Failed to fetch batch in distinct stats query: {e}");
0 commit comments