- 创建物化视图,使用dictionary_get获取数据
CREATE MATERIALIZED VIEW dict_test_mv
REFRESH ASYNC
AS
SELECT
ocoia.org,
dictionary_get ( "ods_dict_map", "org_name_labels_", true ).dict_label AS org_name -- 锁库库存地的组织名称
FROM
scm.dict_test ocoia;
Refresh materialized view dwd_dict_test_mv failed after retrying 1 times(try-lock 0 times), error-msg : com.starrocks.sql.analyzer.SemanticException: Getting analyzing error. Detail message: dictionary: ods_dict_map has expected keys size: 1 keys: [dict_type_value] plus null_if_not_exist flag(optional) but param given: 3.
at com.starrocks.sql.analyzer.ExpressionAnalyzer$Visitor.visitDictionaryGetExpr(ExpressionAnalyzer.java:1998)
at com.starrocks.sql.analyzer.ExpressionAnalyzer$Visitor.visitDictionaryGetExpr(ExpressionAnalyzer.java:385)
at com.starrocks.sql.ast.DictionaryGetExpr.accept(DictionaryGetExpr.java:143)
at com.starrocks.sql.ast.AstVisitor.visit(AstVisitor.java:71)
at com.starrocks.sql.analyzer.ExpressionAnalyzer.bottomUpAnalyze(ExpressionAnalyzer.java:381)
at com.starrocks.sql.analyzer.ExpressionAnalyzer.bottomUpAnalyze(ExpressionAnalyzer.java:379)
at com.starrocks.sql.analyzer.ExpressionAnalyzer.analyze(ExpressionAnalyzer.java:145)
at com.starrocks.sql.analyzer.ExpressionAnalyzer.analyzeExpression(ExpressionAnalyzer.java:2105)
at com.starrocks.sql.analyzer.SelectAnalyzer.analyzeExpression(SelectAnalyzer.java:743)
at com.starrocks.sql.analyzer.SelectAnalyzer.analyzeSelect(SelectAnalyzer.java:248)
at com.starrocks.sql.analyzer.SelectAnalyzer.analyze(SelectAnalyzer.java:77)
at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.visitSelect(QueryAnalyzer.java:369)
at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.visitSelect(QueryAnalyzer.java:278)
at com.starrocks.sql.ast.SelectRelation.accept(SelectRelation.java:232)
at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.process(QueryAnalyzer.java:283)
at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.visitQueryRelation(QueryAnalyzer.java:298)
at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.visitQueryStatement(QueryAnalyzer.java:288)
at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.visitQueryStatement(QueryAnalyzer.java:278)
at com.starrocks.sql.ast.QueryStatement.accept(QueryStatement.java:70)
at com.starrocks.sql.analyzer.QueryAnalyzer$Visitor.process(QueryAnalyzer.java:283)
at com.starrocks.sql.analyzer.QueryAnalyzer.analyze(QueryAnalyzer.java:123)
at com.starrocks.sql.analyzer.InsertAnalyzer.analyzeWithDeferredLock(InsertAnalyzer.java:74)
at com.starrocks.sql.analyzer.InsertAnalyzer.analyze(InsertAnalyzer.java:62)
at com.starrocks.sql.analyzer.Analyzer$AnalyzerVisitor.visitInsertStatement(Analyzer.java:389)
at com.starrocks.sql.analyzer.Analyzer$AnalyzerVisitor.visitInsertStatement(Analyzer.java:167)
at com.starrocks.sql.ast.InsertStmt.accept(InsertStmt.java:293)
at com.starrocks.sql.ast.AstVisitor.visit(AstVisitor.java:71)
at com.starrocks.sql.analyzer.Analyzer.analyze(Analyzer.java:164)
at com.starrocks.scheduler.mv.MVPCTRefreshPlanBuilder.analyzeAndBuildInsertPlan(MVPCTRefreshPlanBuilder.java:78)
at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.prepareRefreshPlan(PartitionBasedMvRefreshProcessor.java:505)
at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.doRefreshMaterializedView(PartitionBasedMvRefreshProcessor.java:456)
at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.doRefreshMaterializedViewWithRetry(PartitionBasedMvRefreshProcessor.java:366)
at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.doMvRefresh(PartitionBasedMvRefreshProcessor.java:325)
at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.processTaskRun(PartitionBasedMvRefreshProcessor.java:199)
at com.starrocks.scheduler.TaskRun.executeTaskRun(TaskRun.java:270)
at com.starrocks.scheduler.TaskRunExecutor.lambda$executeTaskRun$0(TaskRunExecutor.java:58)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)