simple-ddl-parser icon indicating copy to clipboard operation
simple-ddl-parser copied to clipboard

array parsing in hql failes

Open herokri opened this issue 2 years ago • 4 comments

Hi Found this bug provided test:

   ddl = """
    CREATE TABLE IF NOT EXISTS default.salesorderdetail(
            column_abc ARRAY<string>,
            )
    """
    result = DDLParser(ddl, silent=False, normalize_names=True).run(output_mode="hql", group_by_type=True)
    expected = {
        "tables": [
            {
                "if_not_exists": True,
                "columns": [
                    {
                        "name": "column_abc",
                        "type": "ARRAY <string>",
                        "size": None,
                        "references": None,
                        "unique": False,
                        "nullable": True,
                        "default": None,
                        "check": None,
                    }]
            }]
    }

    assert expected == result

Error Message:

p = LexToken(RT,'ARRAY',1,65)

def p_error(self, p):
    if not self.silent:
      raise DDLParserError(f"Unknown statement at {p}")

E simple_ddl_parser.ddl_parser.DDLParserError: Unknown statement at LexToken(RT,'ARRAY',1,65)

herokri avatar Nov 02 '22 15:11 herokri

@herokri thanks for reporting - will take a look on it on weekends

xnuinside avatar Nov 02 '22 17:11 xnuinside

@xnuinside Any updates on this plz..?

hanaluana avatar Mar 03 '23 08:03 hanaluana

@hanaluana , hi, I don’t have a time last several months because of personal issues. Didn’t work on it yet

xnuinside avatar Mar 03 '23 08:03 xnuinside