-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy node tables from npy files #1396
Conversation
46ebc4b
to
f5a2d4c
Compare
803d7c2
to
b34614f
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1396 +/- ##
========================================
Coverage 92.71% 92.71%
========================================
Files 642 646 +4
Lines 22102 22293 +191
========================================
+ Hits 20491 20669 +178
- Misses 1611 1624 +13
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add an end-to-end test for a npy node file?
src/antlr4/Cypher.g4
Outdated
@@ -17,7 +17,10 @@ oC_Cypher | |||
: SP ? oC_AnyCypherOption? SP? ( oC_Statement | kU_DDL | kU_CopyCSV ) ( SP? ';' )? SP? EOF ; | |||
|
|||
kU_CopyCSV | |||
: COPY SP oC_SchemaName SP FROM SP kU_FilePaths ( SP? '(' SP? kU_ParsingOptions SP? ')' )? ; | |||
: COPY SP oC_SchemaName kU_CopyCSV_Properties? SP FROM SP kU_FilePaths (SP? ',' SP? kU_FilePaths)* ( SP? '(' SP? kU_ParsingOptions SP? ')' )? ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do a different rule for COPY NPY since it has a different interpretation of multiple files (aligned on column), so let's have
kU_CopyCSV (btw open an issue about renaming all CopyCSV to Copy because we are copying different file formats now) as it is and
kU_CopyNPY whose grammar is
COPY SP oC_SchemaName SP FROM NPY SP kU_FilePaths
We don't specify columns any more, instead we expect file paths to match all columns as defined in DDL (so that we have the same constraint as copy)
src/antlr4/Cypher.g4
Outdated
: COPY SP oC_SchemaName SP FROM SP kU_FilePaths ( SP? '(' SP? kU_ParsingOptions SP? ')' )? ; | ||
: COPY SP oC_SchemaName kU_CopyCSV_Properties? SP FROM SP kU_FilePaths (SP? ',' SP? kU_FilePaths)* ( SP? '(' SP? kU_ParsingOptions SP? ')' )? ; | ||
|
||
kU_CopyCSV_Properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
inline std::string getTableName() const { return tableName; } | ||
inline std::unordered_map<std::string, std::unique_ptr<ParsedExpression>> const* | ||
getParsingOptions() const { | ||
return &parsingOptions; | ||
} | ||
|
||
private: | ||
std::vector<std::string> filePaths; | ||
std::vector<std::vector<std::string>> filePaths; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file can be reverted.
src/parser/transformer.cpp
Outdated
std::move(tableName), std::move(parsingOptions)); | ||
} | ||
|
||
std::vector<std::vector<std::string>> Transformer::transformFilePaths( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this. And you will have a transformCopyNpy instead.
} | ||
return boundFilePaths; | ||
} | ||
|
||
std::unordered_map<common::property_id_t, std::string> Binder::bindPropertyToNpyMap( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is up to u. But I think you can simply bind to vector so that it aligns with the order in schema. Also we don't need to support multiple npy files to 1 column as an experimental feature.
54c57db
to
d41588d
Compare
No description provided.