Closed sanimesa closed 3 years ago
I can confirm this issue is bugging me as well. Modifying the "basic" testcase to include a NULL column throws an exception later down the line:
File "c:\git\ddlparse\test\test_ddlparse.py", line 1263, in test_parse assert table.columns.to_bigquery_fields() == "[{}]".format(",".join(data["bq_field"]))
I'm still trying to get my head around pyparsing, but it seems the issue is related to this line (648):
Optional(Regex(r"\b(?:NOT\s+)NULL?\b", re.IGNORECASE))("null")
This appears to only match NOT NULL, and not NULL :)
The below SQL produces only one column as output.
Input:
Output: