BoYiZhang opened a new issue #3240:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3240


   
   When I execute SQL query task, JSON parsing error
   
   
   error info :
   ````
   
   com.fasterxml.jackson.databind.exc.InvalidDefinitionException:
    Cannot find a (Map) Key deserializer for type [simple type, class 
org.apache.dolphinscheduler.dao.entity.UdfFunc]
    
   
   
   `````
   
   
   
![image](https://user-images.githubusercontent.com/39816903/87851699-ecb1ad80-c92d-11ea-8c3d-820f38f5d68d.png)
   
   
   
   
   show code : 
   
   
   TaskExecutionContext taskExecutionContext = 
JSONUtils.parseObject(contextJson, TaskExecutionContext.class);
   
![image](https://user-images.githubusercontent.com/39816903/87851753-69448c00-c92e-11ea-94e0-36b45135e533.png)
   
   
   
   
   test  unit :
   
   ```
       @Test
       public void testJson(){
           String contextJson = 
"{\"taskInstanceId\":2,\"taskName\":\"SQL-QUERY\",\"startTime\":\"2020-07-18 
19:18:58\",\"taskType\":\"SQL\",\"host\":null,\"executePath\":\"/tmp/dolphinscheduler/exec/process/2/17/2/2\",\"logPath\":null,\"taskJson\":\"{\\\"id\\\":\\\"tasks-5736\\\",\\\"name\\\":\\\"SQL-QUERY\\\",\\\"desc\\\":null,\\\"type\\\":\\\"SQL\\\",\\\"runFlag\\\":\\\"NORMAL\\\",\\\"loc\\\":null,\\\"maxRetryTimes\\\":0,\\\"retryInterval\\\":1,\\\"params\\\":{\\\"type\\\":\\\"MYSQL\\\",\\\"datasource\\\":3,\\\"sql\\\":\\\"SELECT
 * FROM 
person\\\",\\\"udfs\\\":\\\"\\\",\\\"sqlType\\\":\\\"0\\\",\\\"title\\\":\\\"SQL-QUERY\\\",\\\"receivers\\\":\\\"[email protected]\\\",\\\"receiversCc\\\":\\\"\\\",\\\"showType\\\":\\\"TABLE\\\",\\\"localParams\\\":[],\\\"connParams\\\":\\\"\\\",\\\"preStatements\\\":[],\\\"postStatements\\\":[]},\\\"preTasks\\\":[],\\\"extras\\\":null,\\\"depList\\\":[],\\\"dependence\\\":{},\\\"conditionResult\\\":{\\\"successNode\\\":[\\\"\\\"],\\\"failedNode
 
\\\":[\\\"\\\"]},\\\"taskInstancePriority\\\":\\\"MEDIUM\\\",\\\"workerGroup\\\":\\\"default\\\",\\\"workerGroupId\\\":null,\\\"timeout\\\":{\\\"strategy\\\":\\\"\\\",\\\"interval\\\":null,\\\"enable\\\":false},\\\"conditionsTask\\\":false,\\\"forbidden\\\":false,\\\"taskTimeoutParameter\\\":{\\\"enable\\\":false,\\\"strategy\\\":null,\\\"interval\\\":0}}\",\"processId\":0,\"appIds\":null,\"processInstanceId\":2,\"scheduleTime\":null,\"globalParams\":null,\"executorId\":2,\"cmdTypeIfComplement\":0,\"tenantCode\":\"sysadmin\",\"queue\":\"default\",\"processDefineId\":17,\"projectId\":2,\"taskParams\":null,\"envFile\":null,\"definedParams\":null,\"taskAppId\":null,\"taskTimeoutStrategy\":0,\"taskTimeout\":0,\"workerGroup\":\"default\",\"resources\":{},\"sqlTaskExecutionContext\":{\"warningGroupId\":0,\"connectionParams\":\"{\\\"type\\\":null,\\\"address\\\":\\\"jdbc:mysql://127.0.0.1:3306\\\",\\\"database\\\":\\\"test\\\",\\\"jdbcUrl\\\":\\\"jdbc:mysql://127.0.0.1:3306/test\\\",\\\"us
 
er\\\":\\\"root\\\",\\\"password\\\":\\\"IUAjJCVeJipyb290\\\"}\",\"udfFuncTenantCodeMap\":null},\"dataxTaskExecutionContext\":{\"dataSourceId\":0,\"sourcetype\":0,\"sourceConnectionParams\":null,\"dataTargetId\":0,\"targetType\":0,\"targetConnectionParams\":null},\"dependenceTaskExecutionContext\":null,\"sqoopTaskExecutionContext\":{\"dataSourceId\":0,\"sourcetype\":0,\"sourceConnectionParams\":null,\"dataTargetId\":0,\"targetType\":0,\"targetConnectionParams\":null},\"procedureTaskExecutionContext\":{\"connectionParams\":null}}"
 ;
   
           TaskExecutionContext taskExecutionContext = 
JSONUtils.parseObject(contextJson, TaskExecutionContext.class);
       }
   }
   
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to