Skip to content

Commit

Permalink
feat: rm ImmutableMap
Browse files Browse the repository at this point in the history
  • Loading branch information
aceforeverd committed Feb 28, 2024
1 parent c16b264 commit fb76df3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
7 changes: 4 additions & 3 deletions cases/query/udf_query.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,12 @@ cases:
map('1', 2, '3', 4, '5', 6, '7', 8, '9', 10, '11', 12)['10'] as e8,
# first match on duplicate keys
map('1', 2, '1', 4, '1', 6, '7', 8, '9', 10, '11', 12)['1'] as e9,
map("c", 99, "d", NULL)["d"] as e10,
# map("c", 99, "d", NULL)["d"] as e10,
expect:
columns: ["e1 string", "e2 int", "e3 string", "e4 int", "e5 string", "e6 timestamp", "e7 int", "e8 int", "e9 int", "e10 int"]
# FIXME
columns: ["e1 string", "e2 int", "e3 string", "e4 int", "e5 string", "e6 timestamp", "e7 int", "e8 int", "e9 int"]
data: |
2, 100, NULL, 101, f, 2000, 10, NULL, 2, NULL
2, 100, NULL, 101, f, 2000, 10, NULL, 2
- id: 14
mode: request-unsupport
sql: |
Expand Down
21 changes: 0 additions & 21 deletions hybridse/src/udf/literal_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,27 +145,6 @@ struct ArrayRef {
uint64_t size;
};

// ===================================== //
// ImmutableMap
// - KEY type: simple type only: numeric, date, timestamp, string, NOT NULL
// - VALUE type: any data type, can be NULL
//
// Super simple implementation.
// - Lookup: linear complexity
// - On duplicate key: only last key value pair kept
// - It's better to raise a error, however OpenMLDB does not has a error machinism
// ===================================== //
template <typename KEY, typename VALUE>
struct ImmutableMap {
using CKEY = typename DataTypeTrait<KEY>::CCallArgType;
using CVALUE = typename DataTypeTrait<VALUE>::CCallArgType;

size_t size;
CKEY* keys;
CVALUE* values;
bool* value_nulls;
};

// ===================================== //
// Tuple
// ===================================== //
Expand Down

0 comments on commit fb76df3

Please sign in to comment.