-
Notifications
You must be signed in to change notification settings - Fork 106
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
Alter table add column #1186
Alter table add column #1186
Conversation
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 we should start following the principle to separate query processing with storage details. So let's discuss and move towards that.
src/storage/store/rel_table.cpp
Outdated
@@ -341,6 +341,11 @@ void RelTable::initEmptyRelsForNewNode(nodeID_t& nodeID) { | |||
listsUpdatesStore->initNewlyAddedNodes(nodeID); | |||
} | |||
|
|||
void RelTable::addProperty(Property property, TableSchema* tableSchema) { | |||
fwdRelTableData->addProperty(property, tableSchema, wal, bufferManager); |
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.
You can pass wal
and bufferManager
as private fields to DirectedRelTableData
, so you don't need to pass them here.
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.
WAL is also used by relTable, so we need to store WAL in relTable. I don't think it is a good idea to store it in DirectedRelTableData as well.
@@ -222,6 +222,31 @@ void InMemOverflowFile::copyListOverflow(InMemOverflowFile* srcInMemOverflowFile | |||
dstKUList->size * numBytesOfListElement); | |||
} | |||
|
|||
void InMemOverflowFile::copyListOverflow( |
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 function has potential deadlocks. See #1112
709e1a9
to
67dba6c
Compare
67dba6c
to
1de5fd0
Compare
This PR adds support for adding column to an existing node/rel table.
The grammar for adding column is:
ALTER TABLE person ADD COLUMN count INTEGER DEFAULT 25;
If the user doesn't give a default value, the newly added column will be filled with null values.