GH-836: Added support of ExtensionType for ComplexCopier#837
GH-836: Added support of ExtensionType for ComplexCopier#837lidavidm merged 6 commits intoapache:mainfrom
Conversation
|
@lidavidm Could you plz take a look? |
lidavidm
left a comment
There was a problem hiding this comment.
Why do we need the factory, vs. being able to copy the "storage type" directly?
| throw new UnsupportedOperationException( | ||
| "EXTENSIONTYPE are not supported yet. Please provide an ExtensionTypeWriterFactory." ); |
There was a problem hiding this comment.
I don't think we can ever support extension without the factory right?
| throw new UnsupportedOperationException( | |
| "EXTENSIONTYPE are not supported yet. Please provide an ExtensionTypeWriterFactory." ); | |
| throw new IllegalArgumentException( | |
| "Must provide ExtensionTypeWriterFactory" ); |
There was a problem hiding this comment.
yep, we need a factory to determine writer impl for extension type.
| @Override | ||
| public void copyFrom( | ||
| int fromIndex, int thisIndex, ValueVector from, ExtensionTypeWriterFactory writerFactory) { | ||
| throw new UnsupportedOperationException(); |
There was a problem hiding this comment.
Should these be abstract methods instead?
There was a problem hiding this comment.
No, because this method is used only with complex type vectors and they have implementation; for non-complex, it's not supported, and this behavior is covered here
If we use just the storage type, original (extension) type/vector will be missed |
|
@lidavidm Would you mind taking another look at this PR when you have a chance? We would really appreciate your feedback. Thanks! |
lidavidm
left a comment
There was a problem hiding this comment.
I guess my question is then, how does this work if we have more than one extension type (e.g. a struct vector with two extension type fields), given that everything is based around having 0 or 1 ExtensionTypeWriterFactorys?
Because ExtensionTypeWriterFactory.getWriterImpl will return a writer based on vector type, so if will be several extension types - getWriterImpl should just handle this something like |
|
Works for me. Incidentally, ExtensionTypeWriterFactory is type-parameterized but it seems we never actually use it that way - can you file an issue to drop that and have |
|
|
There's still pre-commit failures - might be worth running the formatter locally? |
|
@lidavidm could you re-check plz? |
|
Thanks! |
…e#837) Updated ComplexCopier to support ExtensionType - it contains two **copy** methods ``` public static void copy(FieldReader input, FieldWriter output) //for not breaking existing logic public static void copy(FieldReader input, FieldWriter output, ExtensionTypeWriterFactory extensionTypeWriterFactory) ``` Also updated ComplexCopier tests. Closes apache#836.
…e#837) Updated ComplexCopier to support ExtensionType - it contains two **copy** methods ``` public static void copy(FieldReader input, FieldWriter output) //for not breaking existing logic public static void copy(FieldReader input, FieldWriter output, ExtensionTypeWriterFactory extensionTypeWriterFactory) ``` Also updated ComplexCopier tests. Closes apache#836.
What's Changed
Updated ComplexCopier to support ExtensionType - it contains two copy methods
Also updated ComplexCopier tests.
Closes #836.