You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible this is a non-issue. I'm not sure if this (the failing query) is valid SQL or not. Perhaps it's valid SQL when sent in the query, but once it gets normalized (newlines removed) it's not valid SQL.
❌ This query fails (note the comment -- Some comment inside the VALUES() function (the result is the same even if the comment starts at the beginning of the line):
The reason for this is actually external to Seafowl: the curl's -d option strips the control characters (CR, LF) from the query. Hence, the raw query received by Seafowl in example #2 is
WITH t ( c_int16_smallint, c_int32_int ) AS ( VALUES( -- Some comment 42::SMALLINT, 99::INT ) ) SELECT * FROM t;
Note that the part of the query after the comment has turned into a comment, which leads to the parsing error. The /* Some comment */ variant has a closing delimiter, so it doesn't interfere with the parsing.
This shouldn't be an issue with other clients. For instance in Python:
In [99]: query="""WITH t ( ...: c_int16_smallint, ...: c_int32_int ...: ) AS ( ...: VALUES( ...: -- Some comment ...: 42::SMALLINT, ...: 99::INT ...: ) ...: ) SELECT * FROM t; ...: """In [100]: r=requests.post("http://localhost:8080/q", json={"query": query}, headers={"content-type": "application/json"})
In [101]: print(r.text)
{"c_int16_smallint":42,"c_int32_int":99}
whereby the query received by Seafowl has explicit line breaks:
WITH t (\n c_int16_smallint,\n c_int32_int\n ) AS (\n VALUES(\n -- Some comment\n 42::SMALLINT,\n 99::INT\n )\n ) SELECT * FROM t;\n
It's possible this is a non-issue. I'm not sure if this (the failing query) is valid SQL or not. Perhaps it's valid SQL when sent in the query, but once it gets normalized (newlines removed) it's not valid SQL.
✅ This query succeeds (no comment):
❌ This query fails (note the comment
-- Some comment
inside theVALUES()
function (the result is the same even if the comment starts at the beginning of the line):✅ This query succeeds (note the
/* Some comment */
:The text was updated successfully, but these errors were encountered: