Skip to content

Commit

Permalink
feat: disable empty list feature
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <xpf6677@163.com>
  • Loading branch information
Peefy committed Nov 14, 2023
1 parent 55ad0ee commit f16f763
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions kclvm/runtime/src/api/kclvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ pub struct ContextConfig {
pub list_option_mode: bool,
/// Whether to emit none value in the plan process.
pub disable_none: bool,
/// Whether to output empty list in the plan process.
pub plan_empty_list: bool,
/// Whether to emit empty list in the plan process.
pub disable_empty_list: bool,
}

#[derive(PartialEq, Eq, Clone, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion kclvm/runtime/src/value/val_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fn filter_results(ctx: &Context, key_values: &ValueRef, opts: &PlanOptions) -> V
let schema_in_list_count = ignore_schema_count + standalone_list.len();
let value = &value.as_list_ref().values;
// Plan empty list to values.
if value.is_empty() && ctx.cfg.plan_empty_list {
if value.is_empty() && !ctx.cfg.disable_empty_list {
let result = results.get_mut(0).unwrap();
result.dict_update_key_value(key.as_str(), ValueRef::list(None));
}
Expand Down

0 comments on commit f16f763

Please sign in to comment.