Skip to content

Commit

Permalink
[Fix](Variant) implement some interface in ColumnNothing
Browse files Browse the repository at this point in the history
IColumnDummy implementation is not suitable for ColumnNothing in ColumnObject
  • Loading branch information
eldenmoon committed Sep 10, 2024
1 parent baefde9 commit bf2193d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions be/src/vec/columns/column_nothing.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ class ColumnNothing final : public COWHelper<IColumnDummy, ColumnNothing> {

ColumnNothing(const ColumnNothing&) = default;

ColumnPtr permute(const Permutation& perm, size_t limit) const override {
return clone_dummy(limit ? std::min(s, limit) : s);
}
Field operator[](size_t) const override {
return {};
}
void get(size_t, Field& f) const override {
f = {};
}
void insert(const Field&) override {
++s;
}

public:
const char* get_family_name() const override { return "Nothing"; }
MutableColumnPtr clone_dummy(size_t s_) const override { return ColumnNothing::create(s_); }
Expand Down
2 changes: 1 addition & 1 deletion regression-test/suites/variant_p0/nested.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ parallel_pipeline_task_num=7,parallel_fragment_exec_instance_num=4,profile_level
properties("replication_num" = "1", "disable_auto_compaction" = "false", "enable_unique_key_merge_on_write" = "true", "variant_enable_flatten_nested" = "true");
"""
sql """insert into var_nested2 select * from var_nested order by k limit 1024"""
qt_sql """select * from var_nested2 order by k limit 10;"""
qt_sql """select /*+SET_VAR(batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=true,enable_distinct_streaming_aggregation=true,parallel_fragment_exec_instance_num=5,parallel_pipeline_task_num=1,profile_level=1,enable_pipeline_engine=false,enable_parallel_scan=true,parallel_scan_max_scanners_count=48,parallel_scan_min_rows_per_scanner=16384,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_filter_type=12,enable_parallel_result_sink=false,enable_nereids_planner=true,rewrite_or_to_in_predicate_threshold=2,enable_function_pushdown=true,enable_common_expr_pushdown=false,enable_local_exchange=false,partitioned_hash_join_rows_threshold=1048576,partitioned_hash_agg_rows_threshold=8,partition_pruning_expand_threshold=10,enable_share_hash_table_for_broadcast_join=false,enable_two_phase_read_opt=true,enable_common_expr_pushdown_for_inverted_index=true,enable_delete_sub_predicate_v2=true,min_revocable_mem=33554432,fetch_remote_schema_timeout_seconds=120,max_fetch_remote_schema_tablet_count=512,enable_join_spill=false,enable_sort_spill=false,enable_agg_spill=false,enable_force_spill=false,data_queue_max_blocks=1,spill_streaming_agg_mem_limit=268435456,external_agg_partition_bits=5) */ * from var_nested2 order by k limit 10;"""
qt_sql """select v['nested'] from var_nested2 where k < 10 order by k limit 10;"""
// explode variant array
order_qt_explode_sql """select count(),cast(vv['xx'] as int) from var_nested lateral view explode_variant_array(v['nested']) tmp as vv where vv['xx'] = 10 group by cast(vv['xx'] as int)"""
Expand Down

0 comments on commit bf2193d

Please sign in to comment.