Skip to content

GH-552: [Vector] Add absent methods to the UnionFixedSizeListWriter#1052

Merged
jbonofre merged 3 commits intoapache:mainfrom
axreldable:manual-fix-size-writer-align-list
Mar 11, 2026
Merged

GH-552: [Vector] Add absent methods to the UnionFixedSizeListWriter#1052
jbonofre merged 3 commits intoapache:mainfrom
axreldable:manual-fix-size-writer-align-list

Conversation

@axreldable
Copy link
Contributor

@axreldable axreldable commented Mar 7, 2026

What's Changed

Add absent methods to the UnionFixedSizeListWriter.

  1. Aligned the UnionFixedSizeListWriter template with the UnionListWriter template, which added the following previously absent methods to the generated UnionFixedSizeListWriter class:
- duration() methods
    - DurationWriter duration()
    - DurationWriter duration(String name, org.apache.arrow.vector.types.TimeUnit unit)
    - DurationWriter duration(String name)
- timeStampSecTZ() methods
    - TimeStampSecTZWriter timeStampSecTZ()
    - TimeStampSecTZWriter timeStampSecTZ(String name, String timezone)
    - TimeStampSecTZWriter timeStampSecTZ(String name)
- timeStampMilliTZ() methods
    - TimeStampMilliTZWriter timeStampMilliTZ()
    - TimeStampMilliTZWriter timeStampMilliTZ(String name, String timezone)
    - TimeStampMilliTZWriter timeStampMilliTZ(String name)
- timeStampMicroTZ() methods
    - TimeStampMicroTZWriter timeStampMicroTZ()
    - TimeStampMicroTZWriter timeStampMicroTZ(String name, String timezone)
    - TimeStampMicroTZWriter timeStampMicroTZ(String name)
- timeStampNanoTZ() methods
    - TimeStampNanoTZWriter timeStampNanoTZ()
    - TimeStampNanoTZWriter timeStampNanoTZ(String name, String timezone)
    - TimeStampNanoTZWriter timeStampNanoTZ(String name)
- fixedSizeBinary() methods
    - FixedSizeBinaryWriter fixedSizeBinary()
    - FixedSizeBinaryWriter fixedSizeBinary(String name, int byteWidth)
    - FixedSizeBinaryWriter fixedSizeBinary(String name)
- write() methods for Duration
    - void writeDuration(long value)
    - void write(DurationHolder holder)
- write() methods for TimeStampSecTZ 
    - void writeTimeStampSecTZ(long value)
    - void write(TimeStampSecTZHolder holder)
- write() methods for TimeStampMilliTZ
    - void writeTimeStampMilliTZ(long value)
    - void write(TimeStampMilliTZHolder holder)
- write() methods for TimeStampMicroTZ
    - void writeTimeStampMicroTZ(long value)
    - void write(TimeStampMicroTZHolder holder)
- write() methods for TimeStampNanoTZ
    - void writeTimeStampNanoTZ(long value)
    - void write(TimeStampNanoTZHolder holder)
- write() methods for FixedSizeBinary
    - void writeFixedSizeBinary(ArrowBuf buffer)
    - void write(FixedSizeBinaryHolder holder)
  1. Add structName = name; for 2 existing methods (align them with other similar methods):
- DecimalWriter decimal(String name)
- Decimal256Writer decimal256(String name)
  1. Remove unused assignments from the UnionListWriter template + add missing overrides.

This fix adds override annotations to the UnionListWriter generated class and extend/fix the code of the UnionFixedSizeListWriter generated class. So, the change is backward compatible.

See the gists for the generated writer classes:


Inspired by this PR.


Closes #552 .

@github-actions

This comment has been minimized.

@axreldable
Copy link
Contributor Author

Please add the enhancement label.

@jbonofre jbonofre added the enhancement PRs that add or improve features. label Mar 9, 2026
@github-actions github-actions bot added this to the 19.0.0 milestone Mar 9, 2026
Copy link
Member

@jbonofre jbonofre left a comment

Choose a reason for hiding this comment

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

LGTM, thanks !

I have just a couple of minor comments.

@@ -123,8 +123,6 @@ public void setPosition(int index) {
<#assign lowerName = minor.class?uncap_first />
<#if lowerName == "int" ><#assign lowerName = "integer" /></#if>
<#assign upperName = minor.class?upper_case />
Copy link
Member

Choose a reason for hiding this comment

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

To be consistent with UnionFixedSizeListWrite, maybe we should add @Override on writes...(long start, ArrowBuf buffer, ArrowType arrowType) methods ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, let me add it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added missing override annotations to the UnionListWriter

assertEquals(expectedField, writer.getField());
}
}

Copy link
Member

Choose a reason for hiding this comment

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

Do we need a test around write(TimeStampNanoTZHolder) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, let me add it as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add the testWriterUsingHolderTimeStampNanoTZField test.

@jbonofre
Copy link
Member

@axreldable do you mind to do the two minor changes I proposed ? I would like to merge this one for Arrow Java 19.0.0 release. Thanks !

@axreldable
Copy link
Contributor Author

@axreldable do you mind to do the two minor changes I proposed ? I would like to merge this one for Arrow Java 19.0.0 release. Thanks !

@jbonofre , sure, added. Could you please kick off the build?

@jbonofre
Copy link
Member

@axreldable here we go 😄 Thanks !

I will merge as soon as CI is happy 😄

@jbonofre jbonofre merged commit 4a7fb4e into apache:main Mar 11, 2026
27 checks passed
@axreldable axreldable deleted the manual-fix-size-writer-align-list branch March 11, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement PRs that add or improve features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UnionFixedSizeListWriter does not support TimeStamp*TZ

2 participants