-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add support for dropping columns in Memory #22657
Conversation
plugin/trino-memory/src/main/java/io/trino/plugin/memory/MemoryMetadata.java
Outdated
Show resolved
Hide resolved
@@ -117,7 +117,10 @@ public synchronized List<Page> getPages( | |||
done = true; | |||
} | |||
// Append missing columns with null values. This situation happens when a new column is added without additional insert. | |||
for (int j = page.getChannelCount(); j < columnIndexes.length; j++) { | |||
for (int j = 0; j < columnIndexes.length; j++) { | |||
if (columnIndexes[j] < page.getChannelCount()) { |
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.
Is this related to dropping columns, or a bug fix? Should this be in a separate commit?
} | ||
|
||
@Override | ||
public synchronized ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle columnHandle) | ||
{ | ||
MemoryTableHandle handle = (MemoryTableHandle) tableHandle; |
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.
Why this is change necessary?
@@ -16,7 +16,7 @@ | |||
import io.trino.spi.connector.ColumnHandle; | |||
import io.trino.spi.type.Type; | |||
|
|||
public record MemoryColumnHandle(int columnIndex, Type type) | |||
public record MemoryColumnHandle(int columnIndex, String name, Type type, boolean nullable) |
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.
Are these changes required for dropping columns?
8cb6afe
to
b77e28a
Compare
Release notes