-
Notifications
You must be signed in to change notification settings - Fork 30
Make bytes available #64
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
Conversation
|
||
@CodecThriftType | ||
public static ThriftType getThriftType() | ||
public static ThriftType getThriftType(ThriftCatalog catalog) |
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 allows us to retrieve metadata for other classes.
position = 0; | ||
} | ||
|
||
public byte[] getBytes() |
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.
We need to retrieve the bytes because our serde is general and it returns bytes https://github.com/prestodb/presto/pull/25242/files#r2127315310
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.
Consider creating a separate TMemoryBuffer
implementation based on the ByteArrayOutputStream
with only write
method available. Consider using the more efficient ByteArrayOutputStream
implementation from Guava.
|
||
@CodecThriftType | ||
public static ThriftType getThriftType() | ||
public static ThriftType getThriftType(ThriftCatalog catalog) |
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.
Please extract the change adding the ThriftCatalog catalog
into a separate commit
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 was trying to use the passed-in catalog to retrieve the metadata for fields within Split because I was manually building the metadata for split. I have updated the code to use annotation for split and custom codec for complicated field within it so we dont need to catalog anymore. My apology for the confusion.
|
||
@CodecThriftType | ||
public static ThriftType getThriftType() | ||
public static ThriftType getThriftType(ThriftCatalog catalog) |
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.
Could you please explain what problem are you trying to solve? Why is it necessary to have access to ThriftCatalog
to define a thrift type? Ideally this method should be pure constant / static.
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 was trying to use the passed-in catalog to retrieve the metadata for fields within Split because I was manually building the metadata for split. I have updated the code to use annotation for split and custom codec for complicated field within it so we dont need to catalog anymore. My apology for the confusion.
position = 0; | ||
} | ||
|
||
public byte[] getBytes() |
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.
Consider creating a separate TMemoryBuffer
implementation based on the ByteArrayOutputStream
with only write
method available. Consider using the more efficient ByteArrayOutputStream
implementation from Guava.
aaa0ee6
to
88487ee
Compare
Uh oh!
There was an error while loading. Please reload this page.