Skip to content

Add COPY for import and export #139

Merged
mrks merged 11 commits intohyrise:masterfrom
dey4ss:sql-copy
Jan 8, 2020
Merged

Add COPY for import and export #139
mrks merged 11 commits intohyrise:masterfrom
dey4ss:sql-copy

Conversation

@dey4ss
Copy link
Copy Markdown
Member

@dey4ss dey4ss commented Jan 6, 2020

Comment thread src/parser/bison_parser.y Outdated
%type <group_t> opt_group
%type <alias_t> opt_table_alias table_alias opt_alias alias
%type <with_description_t> with_description
%type <import_type_t> opt_file_type import_file_type
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you harmonize the mix of file_type, import_file_type, and import_type?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I myself would prefer using FileType instead of ImportType in general for both Import and Export statement (so it would sense for both). I just thought renaming it could be a thing regarding downwards compatibility.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, in that case, please add a comment.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I get it right and renaming ImportType to FileType and altering its values to kFileCSV, ... with just adding a comment there that this has been done is okay?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thought was to leave it as it, but add comments where appropriate that this is done for compat reasons

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, are those two comments enough?

Comment thread src/parser/bison_parser.y Outdated
Comment thread src/parser/bison_parser.y Outdated
Comment thread src/parser/bison_parser.y
* COPY students TO 'test/students.tbl' (WITH FORMAT TBL)
******************************/
export_statement:
COPY table_name TO file_path opt_file_type {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this uses opt_file_type, too, it is weird that opt_file_type has a import_file_type in an export context

DIRECT
SORTED

COPY
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this file serve a purpose?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, I just thought it is somehow common to update it

Comment thread src/sql/ExportStatement.h
namespace hsql {
// Represents SQL Export statements.
struct ExportStatement : SQLStatement {
ExportStatement(ImportType type);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ImportType?

@mrks mrks merged commit e3cfc80 into hyrise:master Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants