duckdb 0.5.2-dev845.0 → 0.5.2-dev849.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
- "version": "0.5.2-dev845.0",
4
+ "version": "0.5.2-dev849.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -179146,6 +179146,21 @@ void ExpressionBinder::QualifyColumnNames(Binder &binder, unique_ptr<ParsedExpre
179146
179146
 
179147
179147
  unique_ptr<ParsedExpression> ExpressionBinder::CreateStructExtract(unique_ptr<ParsedExpression> base,
179148
179148
  string field_name) {
179149
+
179150
+ // we need to transform the struct extract if it is inside a lambda expression
179151
+ // because we cannot bind to an existing table, so we remove the dummy table also
179152
+ if (lambda_bindings && base->type == ExpressionType::COLUMN_REF) {
179153
+ auto &lambda_column_ref = (ColumnRefExpression &)*base;
179154
+ D_ASSERT(!lambda_column_ref.column_names.empty());
179155
+
179156
+ if (lambda_column_ref.column_names[0].find(DummyBinding::DUMMY_NAME) != string::npos) {
179157
+ D_ASSERT(lambda_column_ref.column_names.size() == 2);
179158
+ auto lambda_param_name = lambda_column_ref.column_names.back();
179159
+ lambda_column_ref.column_names.clear();
179160
+ lambda_column_ref.column_names.push_back(lambda_param_name);
179161
+ }
179162
+ }
179163
+
179149
179164
  vector<unique_ptr<ParsedExpression>> children;
179150
179165
  children.push_back(move(base));
179151
179166
  children.push_back(make_unique_base<ParsedExpression, ConstantExpression>(Value(move(field_name))));
@@ -179272,7 +179287,8 @@ BindResult ExpressionBinder::BindExpression(ColumnRefExpression &colref_p, idx_t
179272
179287
  if (!expr) {
179273
179288
  return BindResult(binder.FormatError(colref_p, error_message));
179274
179289
  }
179275
- //! Generated column returns generated expression
179290
+
179291
+ // a generated column returns a generated expression, a struct on a column returns a struct extract
179276
179292
  if (expr->type != ExpressionType::COLUMN_REF) {
179277
179293
  auto alias = expr->alias;
179278
179294
  auto result = BindExpression(&expr, depth);
@@ -179281,6 +179297,7 @@ BindResult ExpressionBinder::BindExpression(ColumnRefExpression &colref_p, idx_t
179281
179297
  }
179282
179298
  return result;
179283
179299
  }
179300
+
179284
179301
  auto &colref = (ColumnRefExpression &)*expr;
179285
179302
  D_ASSERT(colref.IsQualified());
179286
179303
  auto &table_name = colref.GetTableName();