File tree Expand file tree Collapse file tree 2 files changed +1
-40
lines changed
packages/cubejs-schema-compiler Expand file tree Collapse file tree 2 files changed +1
-40
lines changed Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ export class YamlCompiler {
348348 }
349349
350350 private preprocessYamlSqlMultilineValues ( yamlContent : string ) : string {
351- // Convert all folded scalars (sql: >, sql:>, sqlTable: >, sqlTable:> ) to literal scalars
351+ // Convert all folded scalars (sql: >) to literal scalars
352352 // to preserve SQL formatting including comments and whitespace
353353 return yamlContent . replace (
354354 / ( \s + (?: s q l | s q l T a b l e ) : \s * ) > / g,
Original file line number Diff line number Diff line change @@ -131,45 +131,6 @@ describe('YAML SQL Formatting Preservation', () => {
131131 expect ( sql ) . toContain ( 'SELECT id, name FROM table1' ) ;
132132 } ) ;
133133
134- it ( 'handles sqlTable with folded scalar' , async ( ) => {
135- const { compiler, joinGraph, cubeEvaluator } = prepareYamlCompiler (
136- `
137- cubes:
138- - name: TestCube
139- sqlTable: >
140- SELECT col1, col2
141- -- This comment should be preserved
142- FROM source_table
143- WHERE condition = 1
144-
145- dimensions:
146- - name: col1
147- sql: col1
148- type: string
149- primaryKey: true
150- measures:
151- - name: count
152- type: count
153- `
154- ) ;
155-
156- await compiler . compile ( ) ;
157-
158- const query = new PostgresQuery ( { joinGraph, cubeEvaluator, compiler } , {
159- measures : [ 'TestCube.count' ] ,
160- dimensions : [ 'TestCube.col1' ] ,
161- timezone : 'UTC'
162- } ) ;
163-
164- const [ sql ] = query . buildSqlAndParams ( ) ;
165-
166- // Should preserve comments in sqlTable field
167- expect ( sql ) . toContain ( '-- This comment should be preserved' ) ;
168- const lines = sql . split ( '\n' ) ;
169- const commentLine = lines . find ( line => line . includes ( '-- This comment should be preserved' ) ) ;
170- expect ( commentLine ) . toBeDefined ( ) ;
171- } ) ;
172-
173134 it ( 'works correctly for SQL without comments' , async ( ) => {
174135 const { compiler, joinGraph, cubeEvaluator } = prepareYamlCompiler (
175136 `
You can’t perform that action at this time.
0 commit comments