-
-
Notifications
You must be signed in to change notification settings - Fork 228
Open
Description
Describe the bug
SQL Parse Error: Expected "#", "--", "/*", ":=", "=", "DATABASE", "SCHEMA", "TABLE", "TEMPORARY", or [ \t\n\r] but "e" found.
remove external
SQL Parse Error: Expected "#", "(", ",", "--", "/*", ";", "AS", "AUTO_INCREMENT", "AVG_ROW_LENGTH", "CHARACTER", "CHARSET", "COLLATE", "COMMENT", "COMPRESSION", "CONNECTION", "DEFAULT", "ENGINE", "IGNORE", "KEY_BLOCK_SIZE", "MAX_ROWS", "MIN_ROWS", "REPLACE", "SELECT", "STATS_SAMPLE_PAGES", "WITH", [ \t\n\r], or end of input but "p" found.
Database Engine
HIVE DDL SQL
To Reproduce
function getParser() {
if (!parser) {
// 👇 动态 require,仅在首次使用时初始化
const NodeSQLParser = require('node-sql-parser')
parser = new NodeSQLParser.Parser()
}
return parser
}
const testSql = `create external table test20260108 (
name string,
salary float
)
comment '建表示例'
partitioned by (
prov_id string,
date_id string
)
row format serde
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
with serdeproperties (
'field.delim'='#',
'serialization.format'='#',
'serialization.encoding'='UTF-8'
)`;
try {
const ast = new getParser().parse(testSql, { database: 'hive' });
console.log('node-sql-parser success!AST:', ast);
} catch (e) {
console.error('fail:', e.message, e.stack);
}
node-sql-parser version: 5.3.13
node version: 16.20.2
Expected behavior
Support for "create external table" statements.
Support for "partitioned" statements.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels