File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
packages/malloy/src/model Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -2898,13 +2898,15 @@ class QueryQuery extends QueryField {
2898
2898
if ( qs . parent === undefined || ji . parent === undefined ) {
2899
2899
throw new Error ( 'Internal Error, nested structure with no parent.' ) ;
2900
2900
}
2901
- const fieldExpression = this . parent . dialect . sqlFieldReference (
2902
- qs . parent . getSQLIdentifier ( ) ,
2903
- qsDef . name ,
2904
- 'struct' ,
2905
- qs . parent . structDef . type === 'array' ,
2906
- isScalarArray ( this . parent . structDef )
2907
- ) ;
2901
+ const fieldExpression = hasExpression ( qsDef )
2902
+ ? this . exprToSQL ( this . rootResult , this . parent , qsDef . e )
2903
+ : this . parent . dialect . sqlFieldReference (
2904
+ qs . parent . getSQLIdentifier ( ) ,
2905
+ qsDef . name ,
2906
+ 'struct' ,
2907
+ qs . parent . structDef . type === 'array' ,
2908
+ isScalarArray ( this . parent . structDef )
2909
+ ) ;
2908
2910
// we need to generate primary key. If parent has a primary key combine
2909
2911
// console.log(ji.alias, fieldExpression, this.inNestedPipeline());
2910
2912
s += `${ this . parent . dialect . sqlUnnestAlias (
You can’t perform that action at this time.
0 commit comments