read complex data from csv

This commit is contained in:
2022-10-20 06:00:57 +08:00
parent 818ab3b2e5
commit 6478deb7da
13 changed files with 200 additions and 59 deletions
+9 -1
View File
@@ -8,6 +8,7 @@
#
from sre_parse import WHITESPACE
from mo_parsing.helpers import restOfLine
from mo_parsing.infix import delimited_list
from mo_parsing.whitespaces import NO_WHITESPACE, Whitespace
@@ -655,7 +656,8 @@ def parser(literal_string, ident, sqlserver=False):
) / to_json_call
load_data = (
keyword("data") ("file_type")
Optional(keyword("complex")("complex"))
+ keyword("data") ("file_type")
+ keyword("infile")("loc")
+ literal_string ("file")
+ INTO
@@ -667,6 +669,12 @@ def parser(literal_string, ident, sqlserver=False):
+ keyword("by").suppress()
+ literal_string ("term")
)
+ Optional(
keyword("element").suppress()
+ keyword("terminated").suppress()
+ keyword("by").suppress()
+ literal_string ("ele")
)
)
module_func_def = (