dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

[BUG][server] Add to! {} is used to mark the custom parameters to be output as-is in sql

Open liuxuedongcn opened this issue 5 years ago • 1 comments

The hdfs path mapped when hive adds partitions is passed in by custom parameters: Sample statement: alter table test add if not exists partition(dt='${time}') location "/.../${time}/"; Custom parameters:time in varchar $[yyyy-MM-dd]

Problem Description: Quotation marks are added to the custom parameters in the Hive load partition SQL, which causes the partition path mapping error: before modification: location "/.../${time}/" Is parsed into location "/.../'2020-01-19'/" After modification : location "/.../${time}/" Is parsed into location "/.../2020-01-19/" After the modification, there are no quotation marks in the hdfs path, which meets the requirements of the partition of the hive table


hive添加分区时所映射的hdfs路径由自定义参数传入 样例语句:alter table test add if not exists partition(dt='${time}') location "/.../${time}/"; 自定义参数:time in varchar $[yyyy-MM-dd]

问题描述: Hive加载分区SQL里的自定义参数上加了引号,导致分区路径映射错误: 修改前 location "/.../${time}/ 被解析成 location "/.../'2020-01-19'/ 修改后 location "/.../${time}/ 被解析成 location "/.../2020-01-19/ 修改后hdfs路径中不再有引号,符合hive表的分区的需求

liuxuedongcn avatar Jan 19 '21 13:01 liuxuedongcn

My idea is to replace this value before SQL pre-compilation

liuxuedongcn avatar Jan 19 '21 13:01 liuxuedongcn