duckdb 0.2.10-dev446.0 → 0.2.10-dev451.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 +31 -2
- package/src/duckdb.hpp +2 -2
package/package.json
CHANGED
package/src/duckdb.cpp
CHANGED
|
@@ -135059,6 +135059,16 @@ static unique_ptr<ParsedExpression> SummarizeCreateAggregate(const string &aggre
|
|
|
135059
135059
|
return move(cast_function);
|
|
135060
135060
|
}
|
|
135061
135061
|
|
|
135062
|
+
static unique_ptr<ParsedExpression> SummarizeCreateAggregate(const string &aggregate, string column_name,
|
|
135063
|
+
const Value &modifier) {
|
|
135064
|
+
vector<unique_ptr<ParsedExpression>> children;
|
|
135065
|
+
children.push_back(make_unique<ColumnRefExpression>(move(column_name)));
|
|
135066
|
+
children.push_back(make_unique<ConstantExpression>(modifier));
|
|
135067
|
+
auto aggregate_function = make_unique<FunctionExpression>(aggregate, move(children));
|
|
135068
|
+
auto cast_function = make_unique<CastExpression>(LogicalType::VARCHAR, move(aggregate_function));
|
|
135069
|
+
return move(cast_function);
|
|
135070
|
+
}
|
|
135071
|
+
|
|
135062
135072
|
static unique_ptr<ParsedExpression> SummarizeCreateCountStar() {
|
|
135063
135073
|
vector<unique_ptr<ParsedExpression>> children;
|
|
135064
135074
|
auto aggregate_function = make_unique<FunctionExpression>("count_star", move(children));
|
|
@@ -135102,6 +135112,10 @@ BoundStatement Binder::BindSummarize(ShowStatement &stmt) {
|
|
|
135102
135112
|
vector<unique_ptr<ParsedExpression>> max_children;
|
|
135103
135113
|
vector<unique_ptr<ParsedExpression>> unique_children;
|
|
135104
135114
|
vector<unique_ptr<ParsedExpression>> avg_children;
|
|
135115
|
+
vector<unique_ptr<ParsedExpression>> std_children;
|
|
135116
|
+
vector<unique_ptr<ParsedExpression>> q25_children;
|
|
135117
|
+
vector<unique_ptr<ParsedExpression>> q50_children;
|
|
135118
|
+
vector<unique_ptr<ParsedExpression>> q75_children;
|
|
135105
135119
|
vector<unique_ptr<ParsedExpression>> count_children;
|
|
135106
135120
|
vector<unique_ptr<ParsedExpression>> null_percentage_children;
|
|
135107
135121
|
auto select = make_unique<SelectStatement>();
|
|
@@ -135112,8 +135126,19 @@ BoundStatement Binder::BindSummarize(ShowStatement &stmt) {
|
|
|
135112
135126
|
min_children.push_back(SummarizeCreateAggregate("min", plan.names[i]));
|
|
135113
135127
|
max_children.push_back(SummarizeCreateAggregate("max", plan.names[i]));
|
|
135114
135128
|
unique_children.push_back(SummarizeCreateAggregate("approx_count_distinct", plan.names[i]));
|
|
135115
|
-
|
|
135116
|
-
|
|
135129
|
+
if (plan.types[i].IsNumeric()) {
|
|
135130
|
+
avg_children.push_back(SummarizeCreateAggregate("avg", plan.names[i]));
|
|
135131
|
+
std_children.push_back(SummarizeCreateAggregate("stddev", plan.names[i]));
|
|
135132
|
+
q25_children.push_back(SummarizeCreateAggregate("approx_quantile", plan.names[i], Value::FLOAT(0.25)));
|
|
135133
|
+
q50_children.push_back(SummarizeCreateAggregate("approx_quantile", plan.names[i], Value::FLOAT(0.50)));
|
|
135134
|
+
q75_children.push_back(SummarizeCreateAggregate("approx_quantile", plan.names[i], Value::FLOAT(0.75)));
|
|
135135
|
+
} else {
|
|
135136
|
+
avg_children.push_back(make_unique<ConstantExpression>(Value()));
|
|
135137
|
+
std_children.push_back(make_unique<ConstantExpression>(Value()));
|
|
135138
|
+
q25_children.push_back(make_unique<ConstantExpression>(Value()));
|
|
135139
|
+
q50_children.push_back(make_unique<ConstantExpression>(Value()));
|
|
135140
|
+
q75_children.push_back(make_unique<ConstantExpression>(Value()));
|
|
135141
|
+
}
|
|
135117
135142
|
count_children.push_back(SummarizeCreateCountStar());
|
|
135118
135143
|
null_percentage_children.push_back(SummarizeCreateNullPercentage(plan.names[i]));
|
|
135119
135144
|
}
|
|
@@ -135127,6 +135152,10 @@ BoundStatement Binder::BindSummarize(ShowStatement &stmt) {
|
|
|
135127
135152
|
select_node->select_list.push_back(SummarizeWrapUnnest(max_children, "max"));
|
|
135128
135153
|
select_node->select_list.push_back(SummarizeWrapUnnest(unique_children, "approx_unique"));
|
|
135129
135154
|
select_node->select_list.push_back(SummarizeWrapUnnest(avg_children, "avg"));
|
|
135155
|
+
select_node->select_list.push_back(SummarizeWrapUnnest(std_children, "std"));
|
|
135156
|
+
select_node->select_list.push_back(SummarizeWrapUnnest(q25_children, "q25"));
|
|
135157
|
+
select_node->select_list.push_back(SummarizeWrapUnnest(q50_children, "q50"));
|
|
135158
|
+
select_node->select_list.push_back(SummarizeWrapUnnest(q75_children, "q75"));
|
|
135130
135159
|
select_node->select_list.push_back(SummarizeWrapUnnest(count_children, "count"));
|
|
135131
135160
|
select_node->select_list.push_back(SummarizeWrapUnnest(null_percentage_children, "null_percentage"));
|
|
135132
135161
|
select_node->from_table = move(subquery_ref);
|
package/src/duckdb.hpp
CHANGED
|
@@ -10,8 +10,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
10
10
|
|
|
11
11
|
#pragma once
|
|
12
12
|
#define DUCKDB_AMALGAMATION 1
|
|
13
|
-
#define DUCKDB_SOURCE_ID "
|
|
14
|
-
#define DUCKDB_VERSION "0.2.10-
|
|
13
|
+
#define DUCKDB_SOURCE_ID "0edad5d3d"
|
|
14
|
+
#define DUCKDB_VERSION "0.2.10-dev451"
|
|
15
15
|
//===----------------------------------------------------------------------===//
|
|
16
16
|
// DuckDB
|
|
17
17
|
//
|