File tree Expand file tree Collapse file tree 2 files changed +6
-29
lines changed
cubejs-databricks-jdbc-driver/src
cubejs-schema-compiler/src/adapter Expand file tree Collapse file tree 2 files changed +6
-29
lines changed Original file line number Diff line number Diff line change @@ -144,42 +144,19 @@ export class DatabricksQuery extends BaseQuery {
144144 return `\`${ name } \`` ;
145145 }
146146
147- public getFieldIndex ( id : string ) {
148- const dimension = this . dimensionsForSelect ( ) . find ( ( d : any ) => d . dimension === id ) ;
149- if ( dimension ) {
150- return super . getFieldIndex ( id ) ;
147+ public override getFieldIndex ( id : string ) : string | number | null {
148+ const idx = super . getFieldIndex ( id ) ;
149+ if ( idx !== null ) {
150+ return idx ;
151151 }
152+
152153 return this . escapeColumnName ( this . aliasName ( id , false ) ) ;
153154 }
154155
155156 public unixTimestampSql ( ) {
156157 return 'unix_timestamp()' ;
157158 }
158159
159- public orderHashToString ( hash : any ) {
160- if ( ! hash || ! hash . id ) {
161- return null ;
162- }
163-
164- const fieldIndex = this . getFieldIndex ( hash . id ) ;
165- if ( fieldIndex === null ) {
166- return null ;
167- }
168-
169- const dimensionsForSelect = this . dimensionsForSelect ( ) ;
170- const dimensionColumns = R . flatten (
171- dimensionsForSelect . map ( ( s : any ) => s . selectColumns ( ) && s . aliasName ( ) )
172- )
173- . filter ( s => ! ! s ) ;
174-
175- if ( dimensionColumns . length ) {
176- const direction = hash . desc ? 'DESC' : 'ASC' ;
177- return `${ fieldIndex } ${ direction } ` ;
178- }
179-
180- return null ;
181- }
182-
183160 public defaultRefreshKeyRenewalThreshold ( ) {
184161 return 120 ;
185162 }
Original file line number Diff line number Diff line change @@ -2568,7 +2568,7 @@ export class BaseQuery {
25682568 }
25692569
25702570 /**
2571- * XXX: String as return value is added because of HiveQuery.getFieldIndex()
2571+ * XXX: String as return value is added because of HiveQuery.getFieldIndex() and DatabricksQuery.getFieldIndex()
25722572 * @protected
25732573 * @param {string } id member name in form of "cube.member[.granularity]"
25742574 * @returns {number|string|null }
You can’t perform that action at this time.
0 commit comments