Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from apache:master #1

Merged
merged 3 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion be/src/exec/arrow/parquet_row_group_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class RowGroupReader {
private:
int64_t _range_start_offset;
int64_t _range_size;
int64_t _file_size;
std::map<int, std::vector<ExprContext*>> _slot_conjuncts;
std::unordered_set<int> _filter_group;

Expand Down
66 changes: 0 additions & 66 deletions be/src/olap/like_column_predicate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,72 +39,6 @@ void LikeColumnPredicate::evaluate(ColumnBlock* block, uint16_t* sel, uint16_t*
}
}

void LikeColumnPredicate::evaluate(vectorized::IColumn& column, uint16_t* sel,
uint16_t* size) const {
uint16_t new_size = 0;

if (column.is_nullable()) {
auto* nullable_col = vectorized::check_and_get_column<vectorized::ColumnNullable>(column);
auto& null_map_data = nullable_col->get_null_map_column().get_data();
auto& nested_col = nullable_col->get_nested_column();
if (nested_col.is_column_dictionary()) {
auto* nested_col_ptr = vectorized::check_and_get_column<
vectorized::ColumnDictionary<vectorized::Int32>>(nested_col);
auto& data_array = nested_col_ptr->get_data();
for (uint16_t i = 0; i < *size; i++) {
uint16_t idx = sel[i];
sel[new_size] = idx;
if (null_map_data[idx]) {
new_size += _opposite;
continue;
}

StringValue cell_value = nested_col_ptr->get_value(data_array[idx]);
doris_udf::StringVal target;
cell_value.to_string_val(&target);
new_size += _opposite ^ ((_state->function)(_fn_ctx, target, pattern).val);
}
} else {
for (uint16_t i = 0; i < *size; i++) {
uint16_t idx = sel[i];
sel[new_size] = idx;
if (null_map_data[idx]) {
new_size += _opposite;
continue;
}

StringRef cell_value = nested_col.get_data_at(idx);
doris_udf::StringVal target = cell_value.to_string_val();
new_size += _opposite ^ ((_state->function)(_fn_ctx, target, pattern).val);
}
}
} else {
if (column.is_column_dictionary()) {
auto* nested_col_ptr = vectorized::check_and_get_column<
vectorized::ColumnDictionary<vectorized::Int32>>(column);
auto& data_array = nested_col_ptr->get_data();
for (uint16_t i = 0; i < *size; i++) {
uint16_t idx = sel[i];
sel[new_size] = idx;
StringValue cell_value = nested_col_ptr->get_value(data_array[idx]);
doris_udf::StringVal target;
cell_value.to_string_val(&target);
new_size += _opposite ^ ((_state->function)(_fn_ctx, target, pattern).val);
}
} else {
for (uint16_t i = 0; i < *size; i++) {
uint16_t idx = sel[i];
sel[new_size] = idx;
StringRef cell_value = column.get_data_at(idx);
doris_udf::StringVal target = cell_value.to_string_val();
new_size += _opposite ^ ((_state->function)(_fn_ctx, target, pattern).val);
}
}
}

*size = new_size;
}

void LikeColumnPredicate::evaluate_vec(const vectorized::IColumn& column, uint16_t size,
bool* flags) const {
if (column.is_nullable()) {
Expand Down
1 change: 0 additions & 1 deletion be/src/olap/like_column_predicate.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class LikeColumnPredicate : public ColumnPredicate {

PredicateType type() const override { return PredicateType::EQ; }
void evaluate_vec(const vectorized::IColumn& column, uint16_t size, bool* flags) const override;
void evaluate(vectorized::IColumn& column, uint16_t* sel, uint16_t* size) const;

void evaluate(ColumnBlock* block, uint16_t* sel, uint16_t* size) const override;

Expand Down
19 changes: 11 additions & 8 deletions be/src/vec/common/hash_table/string_hash_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ struct StringHashTableEmpty //-V730
public:
bool has_zero() const { return _has_zero; }

void set_has_zero() {
void set_has_zero(const typename Cell::key_type& key) {
_has_zero = true;
new (zero_value()) Cell();
zero_value()->value.first = key;
}

void set_has_zero(const Cell& other) {
Expand All @@ -118,9 +119,11 @@ struct StringHashTableEmpty //-V730
using ConstLookupResult = const Cell*;

template <typename KeyHolder>
void ALWAYS_INLINE emplace(KeyHolder&&, LookupResult& it, bool& inserted, size_t = 0) {
void ALWAYS_INLINE emplace(KeyHolder&& key_holder, LookupResult& it, bool& inserted,
size_t = 0) {
if (!has_zero()) {
set_has_zero();
const auto& key = key_holder_get_key(key_holder);
set_has_zero(key);
inserted = true;
} else
inserted = false;
Expand Down Expand Up @@ -292,28 +295,28 @@ class StringHashTable : private boost::noncopyable {
break;
}
case 1: {
iterator1.template operator++();
++iterator1;
if (iterator1 == container->m1.end()) {
need_switch_to_next = true;
}
break;
}
case 2: {
iterator2.template operator++();
++iterator2;
if (iterator2 == container->m2.end()) {
need_switch_to_next = true;
}
break;
}
case 3: {
iterator3.template operator++();
++iterator3;
if (iterator3 == container->m3.end()) {
need_switch_to_next = true;
}
break;
}
case 4: {
iterator4.template operator++();
++iterator4;
break;
}
}
Expand Down Expand Up @@ -467,7 +470,7 @@ class StringHashTable : private boost::noncopyable {
const size_t sz = x.size;
if (sz == 0) {
key_holder_discard_key(key_holder);
return func(self.m0, VoidKey {}, 0);
return func(self.m0, std::forward<KeyHolder>(key_holder), 0);
}

if (x.data[sz - 1] == 0) {
Expand Down
1 change: 1 addition & 0 deletions docs/.vuepress/sidebar/en/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ module.exports = [
"spark-sink"
],
},
"cloudcanal",
{
title: "UDF",
directoryPath: "udf/",
Expand Down
3 changes: 2 additions & 1 deletion docs/.vuepress/sidebar/zh-CN/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ module.exports = [
"spark-sink"
],
},
"cloudcanal",
{
title: "自定义函数",
directoryPath: "udf/",
Expand Down Expand Up @@ -790,7 +791,7 @@ module.exports = [
"SHOW-STREAM-LOAD",
"SHOW-SYNC-JOB",
"SHOW-TABLE-ID",
"SHOW-TABLES",
"SHOW-TABLES",
"SHOW-TABLE-STATUS",
"SHOW-TABLET",
"SHOW-TRANSACTION",
Expand Down
35 changes: 35 additions & 0 deletions docs/en/docs/ecosystem/cloudcanal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
{
"title": "CloudCanal Data Import",
"language": "zh-CN"
}
---

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# CloudCanal Data Import

## Introduction

CloudCanal Community Edition is a free data migration and synchronization platform published by [ClouGence Company](https://www.clougence.com) that integrates structure migration, full data migration/check/correction, and incremental real-time synchronization. Product contains complete
Its productization capabilities help enterprises break data silos, complete data integration and interoperability, and make better use of data.
![image.png](../../../.vuepress/public/images/cloudcanal/cloudcanal-1.jpg)

> There is no English version of this document, please switch to the Chinese version.
26 changes: 26 additions & 0 deletions docs/zh-CN/docs/ecosystem/cloudcanal.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
---
{
"title": "CloudCanal 数据导入",
"language": "zh-CN"
}
---

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# CloudCanal 数据导入

## 介绍
Expand Down