duckdb 0.5.2-dev1970.0 → 0.5.2-dev1980.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/duckdb.cpp +30 -9
- package/src/duckdb.hpp +2 -2
- package/src/parquet-amalgamation.cpp +32561 -32561
package/package.json
CHANGED
package/src/duckdb.cpp
CHANGED
|
@@ -151076,6 +151076,9 @@ private:
|
|
|
151076
151076
|
|
|
151077
151077
|
TableFilterSet *GetTableFilters(LogicalOperator *op);
|
|
151078
151078
|
|
|
151079
|
+
void AddRelationTdom(FilterInfo *filter_info);
|
|
151080
|
+
bool EmptyFilter(FilterInfo *filter_info);
|
|
151081
|
+
|
|
151079
151082
|
idx_t InspectConjunctionAND(idx_t cardinality, idx_t column_index, ConjunctionAndFilter *fil,
|
|
151080
151083
|
unique_ptr<BaseStatistics> base_stats);
|
|
151081
151084
|
idx_t InspectConjunctionOR(idx_t cardinality, idx_t column_index, ConjunctionOrFilter *fil,
|
|
@@ -151201,24 +151204,37 @@ static TableCatalogEntry *GetCatalogTableEntry(LogicalOperator *op) {
|
|
|
151201
151204
|
return nullptr;
|
|
151202
151205
|
}
|
|
151203
151206
|
|
|
151204
|
-
|
|
151205
|
-
|
|
151206
|
-
|
|
151207
|
-
|
|
151207
|
+
// The filter was made on top of a logical sample or other projection,
|
|
151208
|
+
// but no specific columns are referenced. See issue 4978 number 4.
|
|
151209
|
+
bool CardinalityEstimator::EmptyFilter(FilterInfo *filter_info) {
|
|
151210
|
+
if (!filter_info->left_set && !filter_info->right_set) {
|
|
151211
|
+
return true;
|
|
151208
151212
|
}
|
|
151209
|
-
|
|
151210
|
-
|
|
151213
|
+
return false;
|
|
151214
|
+
}
|
|
151215
|
+
|
|
151216
|
+
void CardinalityEstimator::AddRelationTdom(FilterInfo *filter_info) {
|
|
151211
151217
|
D_ASSERT(filter_info->set->count >= 1);
|
|
151212
151218
|
for (const RelationsToTDom &r2tdom : relations_to_tdoms) {
|
|
151213
151219
|
auto &i_set = r2tdom.equivalent_relations;
|
|
151214
151220
|
if (i_set.find(filter_info->left_binding) != i_set.end()) {
|
|
151215
151221
|
// found an equivalent filter
|
|
151216
|
-
return
|
|
151222
|
+
return;
|
|
151217
151223
|
}
|
|
151218
151224
|
}
|
|
151219
151225
|
auto key = ColumnBinding(filter_info->left_binding.table_index, filter_info->left_binding.column_index);
|
|
151220
151226
|
column_binding_set_t tmp({key});
|
|
151221
151227
|
relations_to_tdoms.emplace_back(RelationsToTDom(tmp));
|
|
151228
|
+
}
|
|
151229
|
+
|
|
151230
|
+
bool CardinalityEstimator::SingleColumnFilter(FilterInfo *filter_info) {
|
|
151231
|
+
if (filter_info->left_set && filter_info->right_set) {
|
|
151232
|
+
// Both set
|
|
151233
|
+
return false;
|
|
151234
|
+
}
|
|
151235
|
+
if (EmptyFilter(filter_info)) {
|
|
151236
|
+
return false;
|
|
151237
|
+
}
|
|
151222
151238
|
return true;
|
|
151223
151239
|
}
|
|
151224
151240
|
|
|
@@ -151285,6 +151301,11 @@ void CardinalityEstimator::InitEquivalentRelations(vector<unique_ptr<FilterInfo>
|
|
|
151285
151301
|
// the left and right relation needs to be added to.
|
|
151286
151302
|
for (auto &filter : *filter_infos) {
|
|
151287
151303
|
if (SingleColumnFilter(filter.get())) {
|
|
151304
|
+
// Filter on one relation, (i.e string or range filter on a column).
|
|
151305
|
+
// Grab the first relation and add it to the equivalence_relations
|
|
151306
|
+
AddRelationTdom(filter.get());
|
|
151307
|
+
continue;
|
|
151308
|
+
} else if (EmptyFilter(filter.get())) {
|
|
151288
151309
|
continue;
|
|
151289
151310
|
}
|
|
151290
151311
|
D_ASSERT(filter->left_set->count >= 1);
|
|
@@ -151368,7 +151389,7 @@ double CardinalityEstimator::EstimateCardinalityWithSet(JoinRelationSet *new_set
|
|
|
151368
151389
|
// left and right relations are in the new set, if so you can use that filter.
|
|
151369
151390
|
// You must also make sure that the filters all relations in the given set, so we use subgraphs
|
|
151370
151391
|
// that should eventually merge into one connected graph that joins all the relations
|
|
151371
|
-
// TODO:
|
|
151392
|
+
// TODO: Implement a method to cache subgraphs so you don't have to build them up every
|
|
151372
151393
|
// time the cardinality of a new set is requested
|
|
151373
151394
|
|
|
151374
151395
|
// relations_to_tdoms has already been sorted.
|
|
@@ -157379,7 +157400,7 @@ unique_ptr<LogicalOperator> FilterPushdown::PushdownInnerJoin(unique_ptr<Logical
|
|
|
157379
157400
|
GenerateFilters();
|
|
157380
157401
|
|
|
157381
157402
|
// turn the inner join into a cross product
|
|
157382
|
-
auto cross_product = LogicalCrossProduct
|
|
157403
|
+
auto cross_product = make_unique<LogicalCrossProduct>(move(op->children[0]), move(op->children[1]));
|
|
157383
157404
|
// then push down cross product
|
|
157384
157405
|
return PushdownCrossProduct(move(cross_product));
|
|
157385
157406
|
}
|
package/src/duckdb.hpp
CHANGED
|
@@ -11,8 +11,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
11
11
|
#pragma once
|
|
12
12
|
#define DUCKDB_AMALGAMATION 1
|
|
13
13
|
#define DUCKDB_AMALGAMATION_EXTENDED 1
|
|
14
|
-
#define DUCKDB_SOURCE_ID "
|
|
15
|
-
#define DUCKDB_VERSION "v0.5.2-
|
|
14
|
+
#define DUCKDB_SOURCE_ID "7409d2e2c9"
|
|
15
|
+
#define DUCKDB_VERSION "v0.5.2-dev1980"
|
|
16
16
|
//===----------------------------------------------------------------------===//
|
|
17
17
|
// DuckDB
|
|
18
18
|
//
|