This commit is contained in:
HSunboy
2018-07-02 18:01:01 +08:00
commit a729770b76
13 changed files with 17964 additions and 0 deletions

21
test/example.js Normal file
View File

@ -0,0 +1,21 @@
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
`,
test1:`create table sql_task_comment_test(id int comment 'id') comment 'sql test';
--sdfsss`,
test2:` INSERT INTO TABLE muyun_test_down4
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;`,
test3:`--alter table sx_622_1 add partition(pa=${"${bdp.system.bizdate}"});
alter table sx_622_1 add partition(pa=${"${bdp.system.cyctime}"});
alter table sx_622_1 add partition(pa=${"${bdp.system.currmonth}"});
alter table sx_622_1 add partition(pa=${"${bdp.system.premonth}"});`
}
module.exports=example;

12
test/index.js Normal file
View File

@ -0,0 +1,12 @@
const dtSqlParser=require("../index");
const example=require("./example");
const testMap=Object.entries(example);
for(let [key,value] of testMap){
console.log(`******${key}********`)
console.log(value)
console.log(`******result********`)
console.log(dtSqlParser.parser.parse(value));
console.log(`********************`)
}