@@ -130,58 +130,58 @@ private static Object avroDecimalValue(String s) {
130130 }
131131
132132 private static final PrimitiveCase [] PRIMITIVES = new PrimitiveCase [] {
133- new PrimitiveCase (null , variant (b -> b .appendNull ())),
134- new PrimitiveCase (true , variant (b -> b .appendBoolean (true ))),
135- new PrimitiveCase (false , variant (b -> b .appendBoolean (false ))),
136- new PrimitiveCase ((byte ) 34 , variant (b -> b .appendByte ((byte ) 34 ))),
137- new PrimitiveCase ((byte ) -34 , variant (b -> b .appendByte ((byte ) -34 ))),
138- new PrimitiveCase ((short ) 1234 , variant (b -> b .appendShort ((short ) 1234 ))),
139- new PrimitiveCase ((short ) -1234 , variant (b -> b .appendShort ((short ) -1234 ))),
140- new PrimitiveCase (12345 , variant (b -> b .appendInt (12345 ))),
141- new PrimitiveCase (-12345 , variant (b -> b .appendInt (-12345 ))),
142- new PrimitiveCase (9876543210L , variant (b -> b .appendLong (9876543210L ))),
143- new PrimitiveCase (-9876543210L , variant (b -> b .appendLong (-9876543210L ))),
144- new PrimitiveCase (10.11F , variant (b -> b .appendFloat (10.11F ))),
145- new PrimitiveCase (-10.11F , variant (b -> b .appendFloat (-10.11F ))),
146- new PrimitiveCase (14.3D , variant (b -> b .appendDouble (14.3D ))),
147- new PrimitiveCase (-14.3D , variant (b -> b .appendDouble (-14.3D ))),
148- // Dates and timestamps aren't very interesting in Variant tests, since they are passed
149- // to and from the API as integers. So just test arbitrary integer values.
150- new PrimitiveCase (12345 , variant (b -> b .appendDate (12345 ))),
151- new PrimitiveCase (-12345 , variant (b -> b .appendDate (-12345 ))),
152- new PrimitiveCase (9876543210L , variant (b -> b .appendTimestampTz (9876543210L ))),
153- new PrimitiveCase (-9876543210L , variant (b -> b .appendTimestampTz (-9876543210L ))),
154- new PrimitiveCase (9876543210L , variant (b -> b .appendTimestampNtz (9876543210L ))),
155- new PrimitiveCase (-9876543210L , variant (b -> b .appendTimestampNtz (-9876543210L ))),
156- new PrimitiveCase (9876543210L , variant (b -> b .appendTimestampNanosTz (9876543210L ))),
157- new PrimitiveCase (-9876543210L , variant (b -> b .appendTimestampNanosTz (-9876543210L ))),
158- new PrimitiveCase (9876543210L , variant (b -> b .appendTimestampNanosNtz (9876543210L ))),
159- new PrimitiveCase (-9876543210L , variant (b -> b .appendTimestampNanosNtz (-9876543210L ))),
160- new PrimitiveCase (
161- avroDecimalValue ("123456.7890" ),
162- variant (b -> b .appendDecimal (new BigDecimal ("123456.7890" )))), // decimal4
163- new PrimitiveCase (
164- avroDecimalValue ("-123456.7890" ),
165- variant (b -> b .appendDecimal (new BigDecimal ("-123456.7890" )))), // decimal4
166- new PrimitiveCase (
167- avroDecimalValue ("1234567890.987654321" ),
168- variant (b -> b .appendDecimal (new BigDecimal ("1234567890.987654321" )))), // decimal8
169- new PrimitiveCase (
170- avroDecimalValue ("-1234567890.987654321" ),
171- variant (b -> b .appendDecimal (new BigDecimal ("-1234567890.987654321" )))), // decimal8
172- new PrimitiveCase (
173- avroDecimalValue ("9876543210.123456789" ),
174- variant (b -> b .appendDecimal (new BigDecimal ("9876543210.123456789" )))), // decimal16
175- new PrimitiveCase (
176- avroDecimalValue ("-9876543210.123456789" ),
177- variant (b -> b .appendDecimal (new BigDecimal ("-9876543210.123456789" )))), // decimal16
178- new PrimitiveCase (
179- ByteBuffer .wrap (new byte [] {0x0a , 0x0b , 0x0c , 0x0d }),
180- variant (b -> b .appendBinary (ByteBuffer .wrap (new byte [] {0x0a , 0x0b , 0x0c , 0x0d })))),
181- new PrimitiveCase ("parquet" , variant (b -> b .appendString ("parquet" ))),
182- new PrimitiveCase (
183- UUID .fromString ("f24f9b64-81fa-49d1-b74e-8c09a6e31c56" ),
184- variant (b -> b .appendUUID (UUID .fromString ("f24f9b64-81fa-49d1-b74e-8c09a6e31c56" ))))
133+ new PrimitiveCase (null , variant (b -> b .appendNull ())),
134+ new PrimitiveCase (true , variant (b -> b .appendBoolean (true ))),
135+ new PrimitiveCase (false , variant (b -> b .appendBoolean (false ))),
136+ new PrimitiveCase ((byte ) 34 , variant (b -> b .appendByte ((byte ) 34 ))),
137+ new PrimitiveCase ((byte ) -34 , variant (b -> b .appendByte ((byte ) -34 ))),
138+ new PrimitiveCase ((short ) 1234 , variant (b -> b .appendShort ((short ) 1234 ))),
139+ new PrimitiveCase ((short ) -1234 , variant (b -> b .appendShort ((short ) -1234 ))),
140+ new PrimitiveCase (12345 , variant (b -> b .appendInt (12345 ))),
141+ new PrimitiveCase (-12345 , variant (b -> b .appendInt (-12345 ))),
142+ new PrimitiveCase (9876543210L , variant (b -> b .appendLong (9876543210L ))),
143+ new PrimitiveCase (-9876543210L , variant (b -> b .appendLong (-9876543210L ))),
144+ new PrimitiveCase (10.11F , variant (b -> b .appendFloat (10.11F ))),
145+ new PrimitiveCase (-10.11F , variant (b -> b .appendFloat (-10.11F ))),
146+ new PrimitiveCase (14.3D , variant (b -> b .appendDouble (14.3D ))),
147+ new PrimitiveCase (-14.3D , variant (b -> b .appendDouble (-14.3D ))),
148+ // Dates and timestamps aren't very interesting in Variant tests, since they are passed
149+ // to and from the API as integers. So just test arbitrary integer values.
150+ new PrimitiveCase (12345 , variant (b -> b .appendDate (12345 ))),
151+ new PrimitiveCase (-12345 , variant (b -> b .appendDate (-12345 ))),
152+ new PrimitiveCase (9876543210L , variant (b -> b .appendTimestampTz (9876543210L ))),
153+ new PrimitiveCase (-9876543210L , variant (b -> b .appendTimestampTz (-9876543210L ))),
154+ new PrimitiveCase (9876543210L , variant (b -> b .appendTimestampNtz (9876543210L ))),
155+ new PrimitiveCase (-9876543210L , variant (b -> b .appendTimestampNtz (-9876543210L ))),
156+ new PrimitiveCase (9876543210L , variant (b -> b .appendTimestampNanosTz (9876543210L ))),
157+ new PrimitiveCase (-9876543210L , variant (b -> b .appendTimestampNanosTz (-9876543210L ))),
158+ new PrimitiveCase (9876543210L , variant (b -> b .appendTimestampNanosNtz (9876543210L ))),
159+ new PrimitiveCase (-9876543210L , variant (b -> b .appendTimestampNanosNtz (-9876543210L ))),
160+ new PrimitiveCase (
161+ avroDecimalValue ("123456.7890" ),
162+ variant (b -> b .appendDecimal (new BigDecimal ("123456.7890" )))), // decimal4
163+ new PrimitiveCase (
164+ avroDecimalValue ("-123456.7890" ),
165+ variant (b -> b .appendDecimal (new BigDecimal ("-123456.7890" )))), // decimal4
166+ new PrimitiveCase (
167+ avroDecimalValue ("1234567890.987654321" ),
168+ variant (b -> b .appendDecimal (new BigDecimal ("1234567890.987654321" )))), // decimal8
169+ new PrimitiveCase (
170+ avroDecimalValue ("-1234567890.987654321" ),
171+ variant (b -> b .appendDecimal (new BigDecimal ("-1234567890.987654321" )))), // decimal8
172+ new PrimitiveCase (
173+ avroDecimalValue ("9876543210.123456789" ),
174+ variant (b -> b .appendDecimal (new BigDecimal ("9876543210.123456789" )))), // decimal16
175+ new PrimitiveCase (
176+ avroDecimalValue ("-9876543210.123456789" ),
177+ variant (b -> b .appendDecimal (new BigDecimal ("-9876543210.123456789" )))), // decimal16
178+ new PrimitiveCase (
179+ ByteBuffer .wrap (new byte [] {0x0a , 0x0b , 0x0c , 0x0d }),
180+ variant (b -> b .appendBinary (ByteBuffer .wrap (new byte [] {0x0a , 0x0b , 0x0c , 0x0d })))),
181+ new PrimitiveCase ("parquet" , variant (b -> b .appendString ("parquet" ))),
182+ new PrimitiveCase (
183+ UUID .fromString ("f24f9b64-81fa-49d1-b74e-8c09a6e31c56" ),
184+ variant (b -> b .appendUUID (UUID .fromString ("f24f9b64-81fa-49d1-b74e-8c09a6e31c56" ))))
185185 };
186186
187187 private ByteBuffer EMPTY_METADATA = fullVariant (b -> b .appendNull ()).getMetadataBuffer ();
@@ -204,19 +204,19 @@ public TestCase(ByteBuffer value, ByteBuffer metadata) {
204204
205205 public TestReadVariant () throws Exception {
206206 TEST_METADATA = fullVariant (b -> {
207- VariantObjectBuilder ob = b .startObject ();
208- ob .appendKey ("a" );
209- ob .appendNull ();
210- ob .appendKey ("b" );
211- ob .appendNull ();
212- ob .appendKey ("c" );
213- ob .appendNull ();
214- ob .appendKey ("d" );
215- ob .appendNull ();
216- ob .appendKey ("e" );
217- ob .appendNull ();
218- b .endObject ();
219- })
207+ VariantObjectBuilder ob = b .startObject ();
208+ ob .appendKey ("a" );
209+ ob .appendNull ();
210+ ob .appendKey ("b" );
211+ ob .appendNull ();
212+ ob .appendKey ("c" );
213+ ob .appendNull ();
214+ ob .appendKey ("d" );
215+ ob .appendNull ();
216+ ob .appendKey ("e" );
217+ ob .appendNull ();
218+ b .endObject ();
219+ })
220220 .getMetadataBuffer ();
221221
222222 TEST_OBJECT = variant (TEST_METADATA , b -> {
0 commit comments