Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tardisDB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Blum
tardisDB
Commits
44182754
Commit
44182754
authored
4 years ago
by
Thomas Blum
Browse files
Options
Downloads
Patches
Plain Diff
Make tardis parser type variable
parent
2ac3cb28
No related branches found
Branches containing commit
No related tags found
1 merge request
!8
Feature add copy statement
Pipeline
#39210
failed
4 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/tardisdb/sqlParser/Tokenizer.hpp
+3
-1
3 additions, 1 deletion
include/tardisdb/sqlParser/Tokenizer.hpp
tools/sqlParser/SQLParser.cpp
+6
-3
6 additions, 3 deletions
tools/sqlParser/SQLParser.cpp
with
9 additions
and
4 deletions
include/tardisdb/sqlParser/Tokenizer.hpp
+
3
−
1
View file @
44182754
...
...
@@ -39,9 +39,11 @@ namespace tardisParser {
const
std
::
string
Copy
=
"copy"
;
const
std
::
string
With
=
"with"
;
const
std
::
string
Format
=
"format"
;
const
std
::
string
CSV
=
"csv"
;
const
std
::
string
TBL
=
"tbl"
;
static
std
::
set
<
std
::
string
>
keywordset
=
{
Version
,
Select
,
From
,
Where
,
And
,
Insert
,
Into
,
Values
,
Update
,
Set
,
Delete
,
Create
,
Table
,
Not
,
Null
,
Branch
,
Copy
,
With
,
Format
};
Table
,
Not
,
Null
,
Branch
,
Copy
,
With
,
Format
,
CSV
,
TBL
};
}
// Define all control symbols
...
...
This diff is collapsed.
Click to expand it.
tools/sqlParser/SQLParser.cpp
+
6
−
3
View file @
44182754
...
...
@@ -79,7 +79,7 @@ namespace tardisParser {
}
break
;
case
State
::
CopyFrom
:
if
(
token
.
hasType
(
Type
::
identifier
))
{
if
(
token
.
hasType
(
Type
::
literal
))
{
context
.
copyStmt
->
filePath
=
token
.
value
;
context
.
state
=
State
::
CopyPath
;
}
else
{
...
...
@@ -101,8 +101,11 @@ namespace tardisParser {
}
break
;
case
State
::
CopyFormat
:
if
(
token
.
hasType
(
Type
::
identifier
))
{
context
.
copyStmt
->
format
=
token
.
value
;
if
(
token
.
equalsKeyword
(
Keyword
::
CSV
))
{
context
.
copyStmt
->
format
=
"csv"
;
context
.
state
=
State
::
CopyType
;
}
else
if
(
token
.
equalsKeyword
(
Keyword
::
TBL
))
{
context
.
copyStmt
->
format
=
"tbl"
;
context
.
state
=
State
::
CopyType
;
}
else
{
throw
syntactical_error
(
"Expected format name, found '"
+
token
.
value
+
"'"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment