Skip to content

Commit 9ecbc56

Browse files
Fix errors
1 parent d2d8006 commit 9ecbc56

3 files changed

Lines changed: 15 additions & 16 deletions

File tree

src/Parsers/Kusto/KQL_ReleaseNote.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ Please note that the functions listed below only take constant parameters for no
853853
## KQL() function
854854
855855
- create table
856-
`CREATE TABLE kql_table4 ENGINE = Memory AS select *, now() as new_column From kql(Customers | project LastName,Age);`
856+
`CREATE TABLE kql_table4 ENGINE = Memory AS select *, now() as new_column From kql($$Customers | project LastName,Age$$);`
857857
verify the content of `kql_table`
858858
`select * from kql_table`
859859
@@ -867,12 +867,12 @@ Please note that the functions listed below only take constant parameters for no
867867
Age Nullable(UInt8)
868868
) ENGINE = Memory;
869869
```
870-
`INSERT INTO temp select * from kql(Customers|project FirstName,LastName,Age);`
870+
`INSERT INTO temp select * from kql($$Customers|project FirstName,LastName,Age$$);`
871871
verify the content of `temp`
872872
`select * from temp`
873873
874-
- Select from kql()
875-
`Select * from kql(Customers|project FirstName)`
874+
- Select from kql(...)
875+
`Select * from kql($$Customers|project FirstName$$)`
876876
877877
## KQL operators:
878878
- Tabular expression statements
@@ -993,4 +993,3 @@ Please note that the functions listed below only take constant parameters for no
993993
- dcount()
994994
- dcountif()
995995
- bin
996-

src/Parsers/parseQuery.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@ ASTPtr tryParseQuery(
295295
*
296296
* This shortcut is needed to avoid complex backtracking in case of obviously erroneous queries.
297297
*/
298-
if (!ParserKeyword(Keyword::INSERT_INTO).check(token_iterator, expected))
298+
IParser::Pos lookahead(token_iterator);
299+
if (!ParserKeyword(Keyword::INSERT_INTO).ignore(lookahead))
299300
{
300-
IParser::Pos lookahead(token_iterator);
301301
while (lookahead->type != TokenType::Semicolon && lookahead->type != TokenType::EndOfStream)
302302
{
303303
if (lookahead->isError())
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
DROP TABLE IF EXISTS Customers;
22
CREATE TABLE Customers
3-
(
3+
(
44
FirstName Nullable(String),
5-
LastName String,
5+
LastName String,
66
Occupation String,
77
Education String,
88
Age Nullable(UInt8)
99
) ENGINE = Memory;
1010

1111
INSERT INTO Customers VALUES ('Theodore','Diaz','Skilled Manual','Bachelors',28),('Stephanie','Cox','Management abcd defg','Bachelors',33),('Peter','Nara','Skilled Manual','Graduate Degree',26),('Latoya','Shen','Professional','Graduate Degree',25),('Apple','','Skilled Manual','Bachelors',28),(NULL,'why','Professional','Partial College',38);
1212
Select '-- test create table --' ;
13-
Select * from kql(Customers|project FirstName) limit 1;;
13+
Select * from kql($$Customers|project FirstName$$) limit 1;;
1414
DROP TABLE IF EXISTS kql_table1;
15-
CREATE TABLE kql_table1 ENGINE = Memory AS select *, now() as new_column From kql(Customers | project LastName | filter LastName=='Diaz');
15+
CREATE TABLE kql_table1 ENGINE = Memory AS select *, now() as new_column From kql($$Customers | project LastName | filter LastName=='Diaz'$$);
1616
select LastName from kql_table1 limit 1;
1717
DROP TABLE IF EXISTS kql_table2;
1818
CREATE TABLE kql_table2
19-
(
19+
(
2020
FirstName Nullable(String),
21-
LastName String,
21+
LastName String,
2222
Age Nullable(UInt8)
2323
) ENGINE = Memory;
24-
INSERT INTO kql_table2 select * from kql(Customers|project FirstName,LastName,Age | filter FirstName=='Theodore');
24+
INSERT INTO kql_table2 select * from kql($$Customers|project FirstName,LastName,Age | filter FirstName=='Theodore'$$);
2525
select * from kql_table2 limit 1;
26-
-- select * from kql(Customers | where FirstName !in ("test", "test2"));
26+
-- select * from kql($$Customers | where FirstName !in ("test", "test2")$$);
2727
DROP TABLE IF EXISTS Customers;
2828
DROP TABLE IF EXISTS kql_table1;
29-
DROP TABLE IF EXISTS kql_table2;
29+
DROP TABLE IF EXISTS kql_table2;

0 commit comments

Comments
 (0)