taozhi8833998 / taozhi8833998/node-sql-parser

Hive DDL SQL "external" statement support

Open
#2,628 0 comments 0 reactions 1 assignee View on GitHub

@taozhi8833998 is already working on this.

Since Jan 8, 2026.

Dominant language
PEG.js
Stars
1k
Forks
244
PR merge metrics
No merged PRs in 30d

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.