File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -805,16 +805,18 @@ export class PawSQLTreeProvider
805805 analysisId : analysis . analysisId ,
806806 } ) ;
807807
808- statements = summary . data . summaryStatementInfo . map ( ( stmt ) => {
809- return new StatementItem (
810- `${ stmt . stmtName } ` ,
811- stmt . analysisStmtId ,
812- analysis . analysisId ,
813- analysis . analysisName ,
814- analysis . workspaceId ,
815- stmt . stmtText
816- ) ;
817- } ) ;
808+ statements = ( summary . data ?. summaryStatementInfo ?? [ ] )
809+ . filter ( ( item ) => item !== null && item !== undefined )
810+ . map ( ( stmt ) => {
811+ return new StatementItem (
812+ `${ stmt . stmtName ?? "" } ` ,
813+ stmt . analysisStmtId ,
814+ analysis . analysisId ,
815+ analysis . analysisName ,
816+ analysis . workspaceId ,
817+ stmt . stmtText ?? ""
818+ ) ;
819+ } ) ;
818820
819821 if ( statements . length > 0 ) {
820822 const firstStatement = statements [ 0 ] ;
@@ -891,17 +893,19 @@ export class PawSQLTreeProvider
891893 analysisId : analysis . analysisId ,
892894 } ) ;
893895
894- const statements = response . data . summaryStatementInfo . map (
895- ( stmt : any ) =>
896- new StatementItem (
897- `${ stmt . stmtName } ` ,
898- stmt . analysisStmtId ,
899- analysis . analysisId ,
900- analysis . label ,
901- analysis . workspaceId ,
902- stmt . sql
903- )
904- ) ;
896+ const statements = ( response . data ?. summaryStatementInfo ?? [ ] )
897+ . filter ( ( item ) => item !== null && item !== undefined )
898+ . map (
899+ ( stmt ) =>
900+ new StatementItem (
901+ `${ stmt . stmtName } ` ,
902+ stmt . analysisStmtId ,
903+ analysis . analysisId ,
904+ analysis . label ,
905+ analysis . workspaceId ,
906+ stmt . stmtText
907+ )
908+ ) ;
905909
906910 // 缓存分析下的语句
907911 this . analysisStatementCache . set ( analysis , statements ) ;
Original file line number Diff line number Diff line change 1414 "analysis.over.limit" : " Opt. quota runs out, please upgrade your plan." ,
1515 "plan.user.exceeded.maximum.opt.times" : " Opt. quota runs out, please upgrade your plan." ,
1616 "workspace.not.exist" : " Workspace does not exist." ,
17- "workspace.has.no.analysis" : " Workspace optimization list is empty " ,
17+ "workspace.has.no.analysis" : " No optimizations in this workspace " ,
1818 "analysis.not.exist" : " Analysis does not exist." ,
1919 "open.in.browser" : " More Details at " ,
2020 "SQL_OPTIMIZED" : " SQL optimization is complete." ,
You can’t perform that action at this time.
0 commit comments