fix escape bug
This commit is contained in:
@ -1,9 +1,12 @@
|
||||
const example={
|
||||
test0:`--alter table sx_622_1 add partition(pa=${"${bdp.system.bizdate}"});
|
||||
SELECT muyun_test_down1.id, muyun_test_down1.name, muyun_test_down2.age
|
||||
FROM muyun_test_down1
|
||||
JOIN muyun_test_down2
|
||||
ON muyun_test_down1.id = muyun_test_down2.id
|
||||
test0:`create table t_csv(
|
||||
id int,
|
||||
name string,
|
||||
address string,
|
||||
sex tinyint
|
||||
)row format serde'org.apache.hadoop.hive.serde2.OpenCSVSerde'with serdeproperties(
|
||||
"separatorChar"=",",
|
||||
"quoteChar"="'","escapeChar"="")stored as textfile;
|
||||
`,
|
||||
test1:`/*asf*/create table sql_task_comment_test(id int comment 'id') comment 'sql test';
|
||||
--sdfsss`,
|
||||
|
@ -1,13 +1,15 @@
|
||||
const dtSqlParser=require("../index");
|
||||
const example=require("./example");
|
||||
const testMap=Object.entries(example);
|
||||
const filterSql=dtSqlParser.filter.filterComments;
|
||||
const splitSql=dtSqlParser.filter.splitSql;
|
||||
|
||||
for(let [key,value] of testMap){
|
||||
console.log(`******${key}********`)
|
||||
console.log(value)
|
||||
console.log(`******result********`)
|
||||
console.log(dtSqlParser.parser.parseSyntax(value));
|
||||
// console.log(dtSqlParser.filter.splitSql(value))
|
||||
// console.log(dtSqlParser.parser.parseSyntax(value));
|
||||
console.log(splitSql(filterSql(value)))
|
||||
console.log(`********************`)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user