From 3c466ee0c7e5b019e50d4ba9af7bf98add7d5232 Mon Sep 17 00:00:00 2001 From: Kyle Carter Date: Thu, 21 Dec 2023 03:06:08 -0700 Subject: [PATCH 01/56] AVRO-3377: Deserialization of record of mangled Java class throws ClassCastException (#1527) * AVRO-3377: Mangle class identifier if required when initializing class Use same mangling code that existed in the compiler (now moved to the core library) to mangle type identifer so that the correct class can be found more often. * Cleaning up after merge --- .../apache/avro/specific/SpecificData.java | 146 +++++++++-- .../avro/specific/TestSpecificData.java | 5 + .../java/org/apache/avro/specific/int$.java | 227 ++++++++++++++++++ .../apache/avro/compiler/schema/Schemas.java | 6 +- .../compiler/specific/SpecificCompiler.java | 79 +----- .../specific/TestSpecificCompiler.java | 6 +- pom.xml | 1 + 7 files changed, 373 insertions(+), 97 deletions(-) create mode 100644 lang/java/avro/src/test/java/org/apache/avro/specific/int$.java diff --git a/lang/java/avro/src/main/java/org/apache/avro/specific/SpecificData.java b/lang/java/avro/src/main/java/org/apache/avro/specific/SpecificData.java index 0476b2e2fc1..c30616e17a3 100644 --- a/lang/java/avro/src/main/java/org/apache/avro/specific/SpecificData.java +++ b/lang/java/avro/src/main/java/org/apache/avro/specific/SpecificData.java @@ -111,6 +111,32 @@ public class SpecificData extends GenericData { // Class names used internally by the avro code generator "Builder")); + /* Reserved words for accessor/mutator methods */ + public static final Set ACCESSOR_MUTATOR_RESERVED_WORDS = new HashSet<>( + Arrays.asList("class", "schema", "classSchema")); + + static { + // Add reserved words to accessor/mutator reserved words + ACCESSOR_MUTATOR_RESERVED_WORDS.addAll(RESERVED_WORDS); + } + + /* Reserved words for type identifiers */ + public static final Set TYPE_IDENTIFIER_RESERVED_WORDS = new HashSet<>( + Arrays.asList("var", "yield", "record")); + + static { + // Add reserved words to type identifier reserved words + TYPE_IDENTIFIER_RESERVED_WORDS.addAll(RESERVED_WORDS); + } + + /* Reserved words for error types */ + public static final Set ERROR_RESERVED_WORDS = new HashSet<>(Arrays.asList("message", "cause")); + + static { + // Add accessor/mutator reserved words to error reserved words + ERROR_RESERVED_WORDS.addAll(ACCESSOR_MUTATOR_RESERVED_WORDS); + } + /** * Read/write some common builtin classes as strings. Representing these as * strings isn't always best, as they aren't always ordered ideally, but at @@ -238,6 +264,89 @@ protected Schema getEnumSchema(Object datum) { }.getClass(); private static final Schema NULL_SCHEMA = Schema.create(Schema.Type.NULL); + /** + * Utility to mangle the fully qualified class name into a valid symbol. + */ + public static String mangleFullyQualified(String fullName) { + int lastDot = fullName.lastIndexOf('.'); + + if (lastDot < 0) { + return mangleTypeIdentifier(fullName); + } else { + String namespace = fullName.substring(0, lastDot); + String typeName = fullName.substring(lastDot + 1); + + return mangle(namespace) + "." + mangleTypeIdentifier(typeName); + } + } + + /** + * Utility for template use. Adds a dollar sign to reserved words. + */ + public static String mangle(String word) { + return mangle(word, false); + } + + /** + * Utility for template use. Adds a dollar sign to reserved words. + */ + public static String mangle(String word, boolean isError) { + return mangle(word, isError ? ERROR_RESERVED_WORDS : RESERVED_WORDS); + } + + /** + * Utility for template use. Adds a dollar sign to reserved words in type + * identifiers. + */ + public static String mangleTypeIdentifier(String word) { + return mangleTypeIdentifier(word, false); + } + + /** + * Utility for template use. Adds a dollar sign to reserved words in type + * identifiers. + */ + public static String mangleTypeIdentifier(String word, boolean isError) { + return mangle(word, isError ? ERROR_RESERVED_WORDS : TYPE_IDENTIFIER_RESERVED_WORDS); + } + + /** + * Utility for template use. Adds a dollar sign to reserved words. + */ + public static String mangle(String word, Set reservedWords) { + return mangle(word, reservedWords, false); + } + + public static String mangleMethod(String word, boolean isError) { + return mangle(word, isError ? ERROR_RESERVED_WORDS : ACCESSOR_MUTATOR_RESERVED_WORDS, true); + } + + /** + * Utility for template use. Adds a dollar sign to reserved words. + */ + public static String mangle(String word, Set reservedWords, boolean isMethod) { + if (isBlank(word)) { + return word; + } + if (word.contains(".")) { + // If the 'word' is really a full path of a class we must mangle just the + String[] packageWords = word.split("\\."); + String[] newPackageWords = new String[packageWords.length]; + + for (int i = 0; i < packageWords.length; i++) { + String oldName = packageWords[i]; + newPackageWords[i] = mangle(oldName, reservedWords, false); + } + + return String.join(".", newPackageWords); + } + if (reservedWords.contains(word) || (isMethod && reservedWords + .contains(Character.toLowerCase(word.charAt(0)) + ((word.length() > 1) ? word.substring(1) : "")))) { + return word + "$"; + } + return word; + } + /** Undoes mangling for reserved words. */ protected static String unmangle(String word) { while (word.endsWith("$")) { @@ -246,6 +355,21 @@ protected static String unmangle(String word) { return word; } + private static boolean isBlank(CharSequence cs) { + int strLen = cs == null ? 0 : cs.length(); + if (strLen == 0) { + return true; + } else { + for (int i = 0; i < strLen; ++i) { + if (!Character.isWhitespace(cs.charAt(i))) { + return false; + } + } + + return true; + } + } + /** Return the class that implements a schema, or null if none exists. */ public Class getClass(Schema schema) { switch (schema.getType()) { @@ -331,26 +455,8 @@ public static String getClassName(Schema schema) { String name = schema.getName(); if (namespace == null || "".equals(namespace)) return name; - - StringBuilder classNameBuilder = new StringBuilder(); - String[] words = namespace.split("\\."); - - for (int i = 0; i < words.length; i++) { - String word = words[i]; - classNameBuilder.append(word); - - if (RESERVED_WORDS.contains(word)) { - classNameBuilder.append(RESERVED_WORD_ESCAPE_CHAR); - } - - if (i != words.length - 1 || !word.endsWith("$")) { // back-compatibly handle $ - classNameBuilder.append("."); - } - } - - classNameBuilder.append(name); - - return classNameBuilder.toString(); + String dot = namespace.endsWith("$") ? "" : "."; // back-compatibly handle $ + return mangle(namespace) + dot + mangleTypeIdentifier(name); } // cache for schemas created from Class objects. Use ClassValue to avoid diff --git a/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificData.java b/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificData.java index 4fe9abb6bd5..5c8cad85331 100644 --- a/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificData.java +++ b/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificData.java @@ -185,4 +185,9 @@ void classNameContainingReservedWords() { assertEquals("db.public$.table.AnyName", SpecificData.getClassName(schema)); } + + @Test + void testCanGetClassOfMangledType() { + assertEquals("org.apache.avro.specific.int$", SpecificData.getClassName(int$.getClassSchema())); + } } diff --git a/lang/java/avro/src/test/java/org/apache/avro/specific/int$.java b/lang/java/avro/src/test/java/org/apache/avro/specific/int$.java new file mode 100644 index 00000000000..586d4219124 --- /dev/null +++ b/lang/java/avro/src/test/java/org/apache/avro/specific/int$.java @@ -0,0 +1,227 @@ +/** + * Autogenerated by Avro + * + * DO NOT EDIT DIRECTLY + */ +package org.apache.avro.specific; + +import org.apache.avro.message.BinaryMessageDecoder; +import org.apache.avro.message.BinaryMessageEncoder; +import org.apache.avro.message.SchemaStore; + +@AvroGenerated +public class int$ extends SpecificRecordBase implements SpecificRecord { + private static final long serialVersionUID = 3003385205621277651L; + + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser() + .parse("{\"type\":\"record\",\"name\":\"int\",\"namespace\":\"org.apache.avro.specific\",\"fields\":[]}"); + + public static org.apache.avro.Schema getClassSchema() { + return SCHEMA$; + } + + private static final SpecificData MODEL$ = new SpecificData(); + + private static final BinaryMessageEncoder ENCODER = new BinaryMessageEncoder<>(MODEL$, SCHEMA$); + + private static final BinaryMessageDecoder DECODER = new BinaryMessageDecoder<>(MODEL$, SCHEMA$); + + /** + * Return the BinaryMessageEncoder instance used by this class. + * + * @return the message encoder used by this class + */ + public static BinaryMessageEncoder getEncoder() { + return ENCODER; + } + + /** + * Return the BinaryMessageDecoder instance used by this class. + * + * @return the message decoder used by this class + */ + public static BinaryMessageDecoder getDecoder() { + return DECODER; + } + + /** + * Create a new BinaryMessageDecoder instance for this class that uses the + * specified {@link SchemaStore}. + * + * @param resolver a {@link SchemaStore} used to find schemas by fingerprint + * @return a BinaryMessageDecoder instance for this class backed by the given + * SchemaStore + */ + public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { + return new BinaryMessageDecoder<>(MODEL$, SCHEMA$, resolver); + } + + /** + * Serializes this int to a ByteBuffer. + * + * @return a buffer holding the serialized data for this instance + * @throws java.io.IOException if this instance could not be serialized + */ + public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { + return ENCODER.encode(this); + } + + /** + * Deserializes a int from a ByteBuffer. + * + * @param b a byte buffer holding serialized data for an instance of this class + * @return a int instance decoded from the given buffer + * @throws java.io.IOException if the given bytes could not be deserialized into + * an instance of this class + */ + public static int$ fromByteBuffer(java.nio.ByteBuffer b) throws java.io.IOException { + return DECODER.decode(b); + } + + public SpecificData getSpecificData() { + return MODEL$; + } + + public org.apache.avro.Schema getSchema() { + return SCHEMA$; + } + + // Used by DatumWriter. Applications should not call. + public Object get(int field$) { + switch (field$) { + default: + throw new IndexOutOfBoundsException("Invalid index: " + field$); + } + } + + // Used by DatumReader. Applications should not call. + @SuppressWarnings(value = "unchecked") + public void put(int field$, Object value$) { + switch (field$) { + default: + throw new IndexOutOfBoundsException("Invalid index: " + field$); + } + } + + /** + * Creates a new int$ RecordBuilder. + * + * @return A new int$ RecordBuilder + */ + public static Builder newBuilder() { + return new Builder(); + } + + /** + * Creates a new int$ RecordBuilder by copying an existing Builder. + * + * @param other The existing builder to copy. + * @return A new int$ RecordBuilder + */ + public static Builder newBuilder(Builder other) { + if (other == null) { + return new Builder(); + } else { + return new Builder(other); + } + } + + /** + * Creates a new int$ RecordBuilder by copying an existing int$ instance. + * + * @param other The existing instance to copy. + * @return A new int$ RecordBuilder + */ + public static Builder newBuilder(int$ other) { + if (other == null) { + return new Builder(); + } else { + return new Builder(other); + } + } + + /** + * RecordBuilder for int$ instances. + */ + @AvroGenerated + public static class Builder extends SpecificRecordBuilderBase + implements org.apache.avro.data.RecordBuilder { + + /** Creates a new Builder */ + private Builder() { + super(SCHEMA$, MODEL$); + } + + /** + * Creates a Builder by copying an existing Builder. + * + * @param other The existing Builder to copy. + */ + private Builder(Builder other) { + super(other); + } + + /** + * Creates a Builder by copying an existing int$ instance + * + * @param other The existing instance to copy. + */ + private Builder(int$ other) { + super(SCHEMA$, MODEL$); + } + + @Override + @SuppressWarnings("unchecked") + public int$ build() { + try { + int$ record = new int$(); + return record; + } catch (org.apache.avro.AvroMissingFieldException e) { + throw e; + } catch (Exception e) { + throw new org.apache.avro.AvroRuntimeException(e); + } + } + } + + @SuppressWarnings("unchecked") + private static final org.apache.avro.io.DatumWriter WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$ + .createDatumWriter(SCHEMA$); + + @Override + public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { + WRITER$.write(this, SpecificData.getEncoder(out)); + } + + @SuppressWarnings("unchecked") + private static final org.apache.avro.io.DatumReader READER$ = (org.apache.avro.io.DatumReader) MODEL$ + .createDatumReader(SCHEMA$); + + @Override + public void readExternal(java.io.ObjectInput in) throws java.io.IOException { + READER$.read(this, SpecificData.getDecoder(in)); + } + + @Override + protected boolean hasCustomCoders() { + return true; + } + + @Override + public void customEncode(org.apache.avro.io.Encoder out) throws java.io.IOException { + } + + @Override + public void customDecode(org.apache.avro.io.ResolvingDecoder in) throws java.io.IOException { + org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); + if (fieldOrder == null) { + } else { + for (int i = 0; i < 0; i++) { + switch (fieldOrder[i].pos()) { + default: + throw new java.io.IOException("Corrupt ResolvingDecoder."); + } + } + } + } +} diff --git a/lang/java/compiler/src/main/java/org/apache/avro/compiler/schema/Schemas.java b/lang/java/compiler/src/main/java/org/apache/avro/compiler/schema/Schemas.java index ec8ff778983..0c0e5ab6725 100644 --- a/lang/java/compiler/src/main/java/org/apache/avro/compiler/schema/Schemas.java +++ b/lang/java/compiler/src/main/java/org/apache/avro/compiler/schema/Schemas.java @@ -29,7 +29,7 @@ import org.apache.avro.LogicalType; import org.apache.avro.Schema; import org.apache.avro.Schema.Field; -import org.apache.avro.compiler.specific.SpecificCompiler; +import org.apache.avro.specific.SpecificData; /** * Avro Schema utilities, to traverse... @@ -84,9 +84,9 @@ public static boolean hasGeneratedJavaClass(final Schema schema) { public static String getJavaClassName(final Schema schema) { String namespace = schema.getNamespace(); if (namespace == null) { - return SpecificCompiler.mangle(schema.getName()); + return SpecificData.mangle(schema.getName()); } else { - return namespace + '.' + SpecificCompiler.mangle(schema.getName()); + return namespace + '.' + SpecificData.mangle(schema.getName()); } } diff --git a/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java b/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java index c6917a25f94..e7c854c57f7 100644 --- a/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java +++ b/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java @@ -26,7 +26,6 @@ import java.lang.reflect.InvocationTargetException; import java.nio.file.Files; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -52,7 +51,6 @@ import org.apache.avro.generic.GenericData; import org.apache.avro.generic.GenericData.StringType; import org.apache.avro.specific.SpecificData; -import org.apache.commons.lang3.StringUtils; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; @@ -60,8 +58,6 @@ import org.slf4j.LoggerFactory; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.apache.avro.specific.SpecificData.RESERVED_WORDS; -import static org.apache.avro.specific.SpecificData.RESERVED_WORD_ESCAPE_CHAR; /** * Generate specific Java interfaces and classes for protocols and schemas. @@ -142,32 +138,6 @@ public boolean isCreateAllArgsConstructor() { return createAllArgsConstructor; } - /* Reserved words for accessor/mutator methods */ - protected static final Set ACCESSOR_MUTATOR_RESERVED_WORDS = new HashSet<>( - Arrays.asList("class", "schema", "classSchema")); - - static { - // Add reserved words to accessor/mutator reserved words - ACCESSOR_MUTATOR_RESERVED_WORDS.addAll(RESERVED_WORDS); - } - - /* Reserved words for type identifiers */ - protected static final Set TYPE_IDENTIFIER_RESERVED_WORDS = new HashSet<>( - Arrays.asList("var", "yield", "record")); - - static { - // Add reserved words to type identifier reserved words - TYPE_IDENTIFIER_RESERVED_WORDS.addAll(RESERVED_WORDS); - } - - /* Reserved words for error types */ - protected static final Set ERROR_RESERVED_WORDS = new HashSet<>(Arrays.asList("message", "cause")); - - static { - // Add accessor/mutator reserved words to error reserved words - ERROR_RESERVED_WORDS.addAll(ACCESSOR_MUTATOR_RESERVED_WORDS); - } - private static final String FILE_HEADER = "/**\n" + " * Autogenerated by Avro\n" + " *\n" + " * DO NOT EDIT DIRECTLY\n" + " */\n"; @@ -834,7 +804,7 @@ private String javaType(Schema schema, boolean checkConvertedLogicalType) { case RECORD: case ENUM: case FIXED: - return mangleFullyQualified(schema.getFullName()); + return SpecificData.mangleFullyQualified(schema.getFullName()); case ARRAY: return "java.util.List<" + javaType(schema.getElementType()) + ">"; case MAP: @@ -866,19 +836,6 @@ private String javaType(Schema schema, boolean checkConvertedLogicalType) { } } - private String mangleFullyQualified(String fullName) { - int lastDot = fullName.lastIndexOf('.'); - - if (lastDot < 0) { - return mangleTypeIdentifier(fullName); - } else { - String namespace = fullName.substring(0, lastDot); - String typeName = fullName.substring(lastDot + 1); - - return mangle(namespace) + "." + mangleTypeIdentifier(typeName); - } - } - private LogicalType getLogicalType(Schema schema) { if (enableDecimalLogicalType || !(schema.getLogicalType() instanceof LogicalTypes.Decimal)) { return schema.getLogicalType(); @@ -1103,14 +1060,14 @@ public static String nullToEmpty(String x) { * Utility for template use. Adds a dollar sign to reserved words. */ public static String mangle(String word) { - return mangle(word, false); + return SpecificData.mangle(word, false); } /** * Utility for template use. Adds a dollar sign to reserved words. */ public static String mangle(String word, boolean isError) { - return mangle(word, isError ? ERROR_RESERVED_WORDS : RESERVED_WORDS); + return SpecificData.mangle(word, isError); } /** @@ -1118,7 +1075,7 @@ public static String mangle(String word, boolean isError) { * identifiers. */ public static String mangleTypeIdentifier(String word) { - return mangleTypeIdentifier(word, false); + return SpecificData.mangleTypeIdentifier(word, false); } /** @@ -1126,40 +1083,21 @@ public static String mangleTypeIdentifier(String word) { * identifiers. */ public static String mangleTypeIdentifier(String word, boolean isError) { - return mangle(word, isError ? ERROR_RESERVED_WORDS : TYPE_IDENTIFIER_RESERVED_WORDS); + return SpecificData.mangle(word, isError); } /** * Utility for template use. Adds a dollar sign to reserved words. */ public static String mangle(String word, Set reservedWords) { - return mangle(word, reservedWords, false); + return SpecificData.mangle(word, reservedWords, false); } /** * Utility for template use. Adds a dollar sign to reserved words. */ public static String mangle(String word, Set reservedWords, boolean isMethod) { - if (StringUtils.isBlank(word)) { - return word; - } - if (word.contains(".")) { - // If the 'word' is really a full path of a class we must mangle just the - String[] packageWords = word.split("\\."); - String[] newPackageWords = new String[packageWords.length]; - - for (int i = 0; i < packageWords.length; i++) { - String oldName = packageWords[i]; - newPackageWords[i] = mangle(oldName, reservedWords, false); - } - - return String.join(".", newPackageWords); - } - if (reservedWords.contains(word) || (isMethod && reservedWords - .contains(Character.toLowerCase(word.charAt(0)) + ((word.length() > 1) ? word.substring(1) : "")))) { - return word + RESERVED_WORD_ESCAPE_CHAR; - } - return word; + return SpecificData.mangle(word, reservedWords, isMethod); } /** @@ -1293,8 +1231,7 @@ private static String generateMethodName(Schema schema, Field field, String pref int indexNameConflict = calcNameIndex(field.name(), schema); StringBuilder methodBuilder = new StringBuilder(prefix); - String fieldName = mangle(field.name(), schema.isError() ? ERROR_RESERVED_WORDS : ACCESSOR_MUTATOR_RESERVED_WORDS, - true); + String fieldName = SpecificData.mangleMethod(field.name(), schema.isError()); boolean nextCharToUpper = true; for (int ii = 0; ii < fieldName.length(); ii++) { diff --git a/lang/java/compiler/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java b/lang/java/compiler/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java index a55aaec31f3..94f6924035e 100644 --- a/lang/java/compiler/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java +++ b/lang/java/compiler/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java @@ -676,9 +676,9 @@ public void testManglingReservedIdentifiers(String schema, boolean throwsTypeExc String dstDirPrefix) throws IOException { Set reservedIdentifiers = new HashSet<>(); reservedIdentifiers.addAll(SpecificData.RESERVED_WORDS); - reservedIdentifiers.addAll(SpecificCompiler.TYPE_IDENTIFIER_RESERVED_WORDS); - reservedIdentifiers.addAll(SpecificCompiler.ACCESSOR_MUTATOR_RESERVED_WORDS); - reservedIdentifiers.addAll(SpecificCompiler.ERROR_RESERVED_WORDS); + reservedIdentifiers.addAll(SpecificData.TYPE_IDENTIFIER_RESERVED_WORDS); + reservedIdentifiers.addAll(SpecificData.ACCESSOR_MUTATOR_RESERVED_WORDS); + reservedIdentifiers.addAll(SpecificData.ERROR_RESERVED_WORDS); for (String reserved : reservedIdentifiers) { try { Schema s = new Schema.Parser().parse(schema.replace("__test__", reserved)); diff --git a/pom.xml b/pom.xml index 392e9b4d032..f7a191b99b5 100644 --- a/pom.xml +++ b/pom.xml @@ -395,6 +395,7 @@ lang/rust/.requirements-precommit.txt lang/java/avro/src/test/java/org/apache/avro/specific/TestRecordWithLogicalTypes.java lang/java/avro/src/test/java/org/apache/avro/specific/TestRecordWithoutLogicalTypes.java + lang/java/avro/src/test/java/org/apache/avro/specific/int$.java lang/java/ipc-netty/src/test/resources/**/*.txt lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/NullSafeAnnotationsFieldsTest.java lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Player.java From 7f7b1932cb700836a894fd9a53b17852ec3cd786 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 10:44:37 +0200 Subject: [PATCH 02/56] Bump anyhow from 1.0.75 to 1.0.76 in /lang/rust (#2644) Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.75 to 1.0.76. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.75...1.0.76) --- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 4 ++-- lang/rust/avro/Cargo.toml | 2 +- lang/rust/avro_test_helper/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index 1c66a9c913e..713bc1279cb 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -58,9 +58,9 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "59d2a3357dde987206219e78ecfbbb6e8dad06cbb65292758d3270e6254f7355" [[package]] name = "apache-avro" diff --git a/lang/rust/avro/Cargo.toml b/lang/rust/avro/Cargo.toml index ae8522bbef5..c6fbb587d72 100644 --- a/lang/rust/avro/Cargo.toml +++ b/lang/rust/avro/Cargo.toml @@ -82,7 +82,7 @@ quad-rand = { default-features = false, version = "0.2.1" } rand = { default-features = false, version = "0.8.5", features = ["default"] } [dev-dependencies] -anyhow = { default-features = false, version = "1.0.75", features = ["std"] } +anyhow = { default-features = false, version = "1.0.76", features = ["std"] } apache-avro-test-helper = { default-features = false, version = "0.17.0", path = "../avro_test_helper" } criterion = { default-features = false, version = "0.5.1" } hex-literal = { default-features = false, version = "0.4.1" } diff --git a/lang/rust/avro_test_helper/Cargo.toml b/lang/rust/avro_test_helper/Cargo.toml index 5f97b7f2ab9..f37ffb29314 100644 --- a/lang/rust/avro_test_helper/Cargo.toml +++ b/lang/rust/avro_test_helper/Cargo.toml @@ -31,7 +31,7 @@ readme = "README.md" [dependencies] -anyhow = { default-features = false, version = "1.0.75", features = ["std"] } +anyhow = { default-features = false, version = "1.0.76", features = ["std"] } better-panic = { default-features = false, version = "0.3.0" } ctor = { default-features = false, version = "0.2.6" } env_logger = { default-features = false, version = "0.10.1" } From 8d6a676acbb03c1ee3afe8cabc29e7ce02f6c49d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 10:45:07 +0200 Subject: [PATCH 03/56] Bump syn from 2.0.41 to 2.0.42 in /lang/rust (#2645) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.41 to 2.0.42. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.41...2.0.42) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 4 ++-- lang/rust/avro_derive/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index 713bc1279cb..ae9576a01d2 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -1207,9 +1207,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.41" +version = "2.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269" +checksum = "5b7d0a2c048d661a1a59fcd7355baa232f7ed34e0ee4df2eef3c1c1c0d3852d8" dependencies = [ "proc-macro2", "quote", diff --git a/lang/rust/avro_derive/Cargo.toml b/lang/rust/avro_derive/Cargo.toml index 97130a2f155..6a69c710efc 100644 --- a/lang/rust/avro_derive/Cargo.toml +++ b/lang/rust/avro_derive/Cargo.toml @@ -37,7 +37,7 @@ darling = { default-features = false, version = "0.20.3" } proc-macro2 = { default-features = false, version = "1.0.70" } quote = { default-features = false, version = "1.0.33" } serde_json = { workspace = true } -syn = { default-features = false, version = "2.0.41", features = ["full", "fold"] } +syn = { default-features = false, version = "2.0.42", features = ["full", "fold"] } [dev-dependencies] apache-avro = { default-features = false, path = "../avro", features = ["derive"] } From cc9d99bb94fcd8dd42416c58b7b633e4fd1bfa3b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 06:34:36 +0200 Subject: [PATCH 04/56] Bump proc-macro2 from 1.0.70 to 1.0.71 in /lang/rust (#2647) Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.70 to 1.0.71. - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.70...1.0.71) --- updated-dependencies: - dependency-name: proc-macro2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 4 ++-- lang/rust/avro_derive/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index ae9576a01d2..8204a2bfa58 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -913,9 +913,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" dependencies = [ "unicode-ident", ] diff --git a/lang/rust/avro_derive/Cargo.toml b/lang/rust/avro_derive/Cargo.toml index 6a69c710efc..05a6fc82d5a 100644 --- a/lang/rust/avro_derive/Cargo.toml +++ b/lang/rust/avro_derive/Cargo.toml @@ -34,7 +34,7 @@ proc-macro = true [dependencies] darling = { default-features = false, version = "0.20.3" } -proc-macro2 = { default-features = false, version = "1.0.70" } +proc-macro2 = { default-features = false, version = "1.0.71" } quote = { default-features = false, version = "1.0.33" } serde_json = { workspace = true } syn = { default-features = false, version = "2.0.42", features = ["full", "fold"] } From f6b61ed6b2249549d966189feed54a51b9a85e70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Dec 2023 14:46:47 +0100 Subject: [PATCH 05/56] Bump com.fasterxml.jackson:jackson-bom in /lang/java (#2649) Bumps [com.fasterxml.jackson:jackson-bom](https://github.com/FasterXML/jackson-bom) from 2.16.0 to 2.16.1. - [Commits](https://github.com/FasterXML/jackson-bom/compare/jackson-bom-2.16.0...jackson-bom-2.16.1) --- updated-dependencies: - dependency-name: com.fasterxml.jackson:jackson-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/java/pom.xml b/lang/java/pom.xml index 799d004212d..7c89e542c71 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -44,7 +44,7 @@ 1.59.0 3.3.5 2.2 - 2.16.0 + 2.16.1 9.4.52.v20230823 5.0.4 5.10.0 From 8e651d8a1f91c9d279388cb22afe8c092b49a216 Mon Sep 17 00:00:00 2001 From: Fokko Driesprong Date: Thu, 28 Dec 2023 14:47:25 +0100 Subject: [PATCH 06/56] AVRO-3919: [Spec] Clarify UUID type (#2646) With an example as we have with the other types as well. --- doc/content/en/docs/++version++/Specification/_index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/content/en/docs/++version++/Specification/_index.md b/doc/content/en/docs/++version++/Specification/_index.md index 152741a0b13..3edee7c8d0d 100755 --- a/doc/content/en/docs/++version++/Specification/_index.md +++ b/doc/content/en/docs/++version++/Specification/_index.md @@ -829,6 +829,14 @@ The `uuid` logical type represents a random generated universally unique identif A `uuid` logical type annotates an Avro `string`. The string has to conform with [RFC-4122](https://www.ietf.org/rfc/rfc4122.txt) +The following schema represents a uuid: +```json +{ + "type": "string", + "logicalType": "uuid" +} +``` + ### Date The `date` logical type represents a date within the calendar, with no reference to a particular time zone or time of day. From a0b277ffcc18ce7f0bc1faa0e0b8c61326e93753 Mon Sep 17 00:00:00 2001 From: Tim Perkins Date: Thu, 28 Dec 2023 12:18:52 -0500 Subject: [PATCH 07/56] AVRO-3921: [ruby] Test against Ruby 3.3 (#2655) --- .github/workflows/test-lang-ruby.yml | 4 +++- lang/ruby/test/test_logical_types.rb | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-lang-ruby.yml b/.github/workflows/test-lang-ruby.yml index a3c53f910f3..4c8f963dd45 100644 --- a/.github/workflows/test-lang-ruby.yml +++ b/.github/workflows/test-lang-ruby.yml @@ -43,6 +43,7 @@ jobs: - '3.0' - '3.1' - '3.2' + - '3.3' steps: - uses: actions/checkout@v4 @@ -83,6 +84,7 @@ jobs: - '3.0' - '3.1' - '3.2' + - '3.3' steps: - uses: actions/checkout@v4 @@ -165,4 +167,4 @@ jobs: - name: Build run: | set -x - ./build.sh clean test \ No newline at end of file + ./build.sh clean test diff --git a/lang/ruby/test/test_logical_types.rb b/lang/ruby/test/test_logical_types.rb index 3aeb3498397..3dd7ce183f5 100644 --- a/lang/ruby/test/test_logical_types.rb +++ b/lang/ruby/test/test_logical_types.rb @@ -141,7 +141,7 @@ def test_logical_type_default_value "null" ], "default": "\u0000" - } + } ] }') @@ -215,7 +215,7 @@ def test_logical_type_default_value sales_tax_record = { "sales" => BigDecimal("12.34"), "tax" => BigDecimal("0.000"), - "invoice_date" => Time.at(0).to_date, + "invoice_date" => Date.new(1970, 1, 1), # time-millis is not supported "invoice_time" => 0, "created_at" => Time.at(0).utc, From df74c9f8a70dec64fec38446de3c896dfb378784 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Tue, 2 Jan 2024 20:14:01 +0200 Subject: [PATCH 08/56] NO-ISSUE: [Rust] Fix clippy errors for Rust 1.75.0 Signed-off-by: Martin Tzvetanov Grigorov --- lang/rust/avro/src/schema.rs | 4 ++-- lang/rust/avro/src/types.rs | 2 +- lang/rust/avro_derive/tests/derive.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/rust/avro/src/schema.rs b/lang/rust/avro/src/schema.rs index 258ea87b0f5..6ebbb21a8ca 100644 --- a/lang/rust/avro/src/schema.rs +++ b/lang/rust/avro/src/schema.rs @@ -737,7 +737,7 @@ impl RecordField { }); if !resolved { - let schema: Option<&Schema> = schemas.get(0); + let schema: Option<&Schema> = schemas.first(); return match schema { Some(first_schema) => Err(Error::GetDefaultUnion( SchemaKind::from(first_schema), @@ -2541,7 +2541,7 @@ mod tests { match schema_a { Schema::Record(RecordSchema { fields, .. }) => { - let f1 = fields.get(0); + let f1 = fields.first(); let ref_schema = Schema::Ref { name: Name::new("B")?, diff --git a/lang/rust/avro/src/types.rs b/lang/rust/avro/src/types.rs index c3fde21e490..97d6b7174f7 100644 --- a/lang/rust/avro/src/types.rs +++ b/lang/rust/avro/src/types.rs @@ -2927,7 +2927,7 @@ Field with name '"b"' is not a member of the map items"#, let schemas = Schema::parse_list(&[main_schema, referenced_schema])?; - let main_schema = schemas.get(0).unwrap(); + let main_schema = schemas.first().unwrap(); let schemata: Vec<_> = schemas.iter().skip(1).collect(); let resolve_result = avro_value.clone().resolve_schemata(main_schema, schemata); diff --git a/lang/rust/avro_derive/tests/derive.rs b/lang/rust/avro_derive/tests/derive.rs index 89488b7e577..1fab03203f6 100644 --- a/lang/rust/avro_derive/tests/derive.rs +++ b/lang/rust/avro_derive/tests/derive.rs @@ -1565,7 +1565,7 @@ mod test_derive { let derived_schema = TestRawIdent::get_schema(); if let Schema::Record(RecordSchema { fields, .. }) = derived_schema { - let field = fields.get(0).expect("TestRawIdent must contain a field"); + let field = fields.first().expect("TestRawIdent must contain a field"); assert_eq!(field.name, "type"); } else { panic!("Unexpected schema type for {derived_schema:?}") From b76e87c8ca90bb2e8c41064293e90ce7129abc1e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 20:54:20 +0200 Subject: [PATCH 09/56] Bump anyhow from 1.0.76 to 1.0.79 in /lang/rust (#2669) Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.76 to 1.0.79. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.76...1.0.79) --- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 4 ++-- lang/rust/avro/Cargo.toml | 2 +- lang/rust/avro_test_helper/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index 8204a2bfa58..a6a796bce79 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -58,9 +58,9 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anyhow" -version = "1.0.76" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59d2a3357dde987206219e78ecfbbb6e8dad06cbb65292758d3270e6254f7355" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "apache-avro" diff --git a/lang/rust/avro/Cargo.toml b/lang/rust/avro/Cargo.toml index c6fbb587d72..6018edef2e8 100644 --- a/lang/rust/avro/Cargo.toml +++ b/lang/rust/avro/Cargo.toml @@ -82,7 +82,7 @@ quad-rand = { default-features = false, version = "0.2.1" } rand = { default-features = false, version = "0.8.5", features = ["default"] } [dev-dependencies] -anyhow = { default-features = false, version = "1.0.76", features = ["std"] } +anyhow = { default-features = false, version = "1.0.79", features = ["std"] } apache-avro-test-helper = { default-features = false, version = "0.17.0", path = "../avro_test_helper" } criterion = { default-features = false, version = "0.5.1" } hex-literal = { default-features = false, version = "0.4.1" } diff --git a/lang/rust/avro_test_helper/Cargo.toml b/lang/rust/avro_test_helper/Cargo.toml index f37ffb29314..a8159d17064 100644 --- a/lang/rust/avro_test_helper/Cargo.toml +++ b/lang/rust/avro_test_helper/Cargo.toml @@ -31,7 +31,7 @@ readme = "README.md" [dependencies] -anyhow = { default-features = false, version = "1.0.76", features = ["std"] } +anyhow = { default-features = false, version = "1.0.79", features = ["std"] } better-panic = { default-features = false, version = "0.3.0" } ctor = { default-features = false, version = "0.2.6" } env_logger = { default-features = false, version = "0.10.1" } From f49e4c847e5f19c13db5f7d416f03babdfb93b5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 20:55:55 +0200 Subject: [PATCH 10/56] Bump quote from 1.0.33 to 1.0.35 in /lang/rust (#2668) Bumps [quote](https://github.com/dtolnay/quote) from 1.0.33 to 1.0.35. - [Release notes](https://github.com/dtolnay/quote/releases) - [Commits](https://github.com/dtolnay/quote/compare/1.0.33...1.0.35) --- updated-dependencies: - dependency-name: quote dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 8 ++++---- lang/rust/avro_derive/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index a6a796bce79..ea5644bbed1 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -913,9 +913,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.71" +version = "1.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" +checksum = "2de98502f212cfcea8d0bb305bd0f49d7ebdd75b64ba0a68f937d888f4e0d6db" dependencies = [ "unicode-ident", ] @@ -944,9 +944,9 @@ checksum = "658fa1faf7a4cc5f057c9ee5ef560f717ad9d8dc66d975267f709624d6e1ab88" [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] diff --git a/lang/rust/avro_derive/Cargo.toml b/lang/rust/avro_derive/Cargo.toml index 05a6fc82d5a..6168a899a96 100644 --- a/lang/rust/avro_derive/Cargo.toml +++ b/lang/rust/avro_derive/Cargo.toml @@ -35,7 +35,7 @@ proc-macro = true [dependencies] darling = { default-features = false, version = "0.20.3" } proc-macro2 = { default-features = false, version = "1.0.71" } -quote = { default-features = false, version = "1.0.33" } +quote = { default-features = false, version = "1.0.35" } serde_json = { workspace = true } syn = { default-features = false, version = "2.0.42", features = ["full", "fold"] } From 3d22333ee3928a6ee6b9742a825b48b913e4aa45 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 20:56:30 +0200 Subject: [PATCH 11/56] Bump thiserror from 1.0.51 to 1.0.55 in /lang/rust (#2667) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.51 to 1.0.55. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.51...1.0.55) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 8 ++++---- lang/rust/avro/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index ea5644bbed1..736feee17b3 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -1218,18 +1218,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.51" +version = "1.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" +checksum = "6e3de26b0965292219b4287ff031fcba86837900fe9cd2b34ea8ad893c0953d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.51" +version = "1.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" +checksum = "268026685b2be38d7103e9e507c938a1fcb3d7e6eb15e87870b617bf37b6d581" dependencies = [ "proc-macro2", "quote", diff --git a/lang/rust/avro/Cargo.toml b/lang/rust/avro/Cargo.toml index 6018edef2e8..2800d4326de 100644 --- a/lang/rust/avro/Cargo.toml +++ b/lang/rust/avro/Cargo.toml @@ -68,7 +68,7 @@ serde_json = { workspace = true } snap = { default-features = false, version = "1.1.0", optional = true } strum = { default-features = false, version = "0.25.0" } strum_macros = { default-features = false, version = "0.25.3" } -thiserror = { default-features = false, version = "1.0.51" } +thiserror = { default-features = false, version = "1.0.55" } typed-builder = { default-features = false, version = "0.18.0" } uuid = { default-features = false, version = "1.6.1", features = ["serde", "std"] } xz2 = { default-features = false, version = "0.1.7", optional = true } From dd8f21acc54acf585c33c8513f76a2a677b3eef7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 20:57:21 +0200 Subject: [PATCH 12/56] Bump serde from 1.0.193 to 1.0.194 in /lang/rust (#2665) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.193 to 1.0.194. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.193...v1.0.194) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 12 ++++++------ lang/rust/Cargo.toml | 2 +- lang/rust/avro_derive/Cargo.toml | 2 +- lang/rust/wasm-demo/Cargo.toml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index 736feee17b3..3f02e0a24c2 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -1100,18 +1100,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.194" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.194" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0" dependencies = [ "proc-macro2", "quote", @@ -1207,9 +1207,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.42" +version = "2.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b7d0a2c048d661a1a59fcd7355baa232f7ed34e0ee4df2eef3c1c1c0d3852d8" +checksum = "89456b690ff72fddcecf231caedbe615c59480c93358a93dfae7fc29e3ebbf0e" dependencies = [ "proc-macro2", "quote", diff --git a/lang/rust/Cargo.toml b/lang/rust/Cargo.toml index 23ee3249f38..ef1bb84a68b 100644 --- a/lang/rust/Cargo.toml +++ b/lang/rust/Cargo.toml @@ -42,7 +42,7 @@ documentation = "https://docs.rs/apache-avro" # dependencies used by more than one members [workspace.dependencies] log = { default-features = false, version = "0.4.20" } -serde = { default-features = false, version = "1.0.193", features = ["derive"] } +serde = { default-features = false, version = "1.0.194", features = ["derive"] } serde_json = { default-features = false, version = "1.0.108", features = ["std"] } [profile.release.package.hello-wasm] diff --git a/lang/rust/avro_derive/Cargo.toml b/lang/rust/avro_derive/Cargo.toml index 6168a899a96..916b0cfcd08 100644 --- a/lang/rust/avro_derive/Cargo.toml +++ b/lang/rust/avro_derive/Cargo.toml @@ -42,4 +42,4 @@ syn = { default-features = false, version = "2.0.42", features = ["full", "fold" [dev-dependencies] apache-avro = { default-features = false, path = "../avro", features = ["derive"] } proptest = { default-features = false, version = "1.4.0", features = ["std"] } -serde = { default-features = false, version = "1.0.193", features = ["derive"] } +serde = { default-features = false, version = "1.0.194", features = ["derive"] } diff --git a/lang/rust/wasm-demo/Cargo.toml b/lang/rust/wasm-demo/Cargo.toml index 6ad9e65cdf7..32c202a7f24 100644 --- a/lang/rust/wasm-demo/Cargo.toml +++ b/lang/rust/wasm-demo/Cargo.toml @@ -36,7 +36,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] apache-avro = { path = "../avro" } -serde = { default-features = false, version = "1.0.193", features = ["derive"] } +serde = { default-features = false, version = "1.0.194", features = ["derive"] } wasm-bindgen = "0.2.88" [dev-dependencies] From e00e85cd4db6eab8616af8ae0d15c3684593f316 Mon Sep 17 00:00:00 2001 From: Tim Perkins Date: Tue, 2 Jan 2024 14:49:38 -0500 Subject: [PATCH 13/56] AVRO-3922: [ruby] add timestamp-nanos support (#2658) --- lang/ruby/lib/avro/logical_types.rb | 35 ++++++++++++++++++++++------ lang/ruby/test/random_data.rb | 2 ++ lang/ruby/test/test_io.rb | 5 +++- lang/ruby/test/test_logical_types.rb | 22 +++++++++++++++++ 4 files changed, 56 insertions(+), 8 deletions(-) diff --git a/lang/ruby/lib/avro/logical_types.rb b/lang/ruby/lib/avro/logical_types.rb index 1d1fb6f7528..48e0ded5098 100644 --- a/lang/ruby/lib/avro/logical_types.rb +++ b/lang/ruby/lib/avro/logical_types.rb @@ -214,30 +214,50 @@ def self.decode(int) end module TimestampMillis + SUBUNITS_PER_SECOND = 1000 + def self.encode(value) return value.to_i if value.is_a?(Numeric) time = value.to_time - time.to_i * 1000 + time.usec / 1000 + time.to_i * SUBUNITS_PER_SECOND + time.usec / SUBUNITS_PER_SECOND end def self.decode(int) - s, ms = int / 1000, int % 1000 - Time.at(s, ms * 1000).utc + s, ms = int.divmod(SUBUNITS_PER_SECOND) + Time.at(s, ms, :millisecond).utc end end module TimestampMicros + SUBUNITS_PER_SECOND = 1000_000 + + def self.encode(value) + return value.to_i if value.is_a?(Numeric) + + time = value.to_time + time.to_i * SUBUNITS_PER_SECOND + time.usec + end + + def self.decode(int) + s, us = int.divmod(SUBUNITS_PER_SECOND) + Time.at(s, us, :microsecond).utc + end + end + + module TimestampNanos + SUBUNITS_PER_SECOND = 1000_000_000 + def self.encode(value) return value.to_i if value.is_a?(Numeric) time = value.to_time - time.to_i * 1000_000 + time.usec + time.to_i * SUBUNITS_PER_SECOND + time.nsec end def self.decode(int) - s, us = int / 1000_000, int % 1000_000 - Time.at(s, us).utc + s, ns = int.divmod(SUBUNITS_PER_SECOND) + Time.at(s, ns, :nanosecond).utc end end @@ -260,7 +280,8 @@ def self.decode(datum) }, "long" => { "timestamp-millis" => TimestampMillis, - "timestamp-micros" => TimestampMicros + "timestamp-micros" => TimestampMicros, + "timestamp-nanos" => TimestampNanos }, }.freeze diff --git a/lang/ruby/test/random_data.rb b/lang/ruby/test/random_data.rb index 8d84058b552..1c87a4be84b 100644 --- a/lang/ruby/test/random_data.rb +++ b/lang/ruby/test/random_data.rb @@ -89,6 +89,8 @@ def logical_nextdata(schm, _d=0) Avro::LogicalTypes::TimestampMicros.decode(rand_long) when 'timestamp-millis' Avro::LogicalTypes::TimestampMillis.decode(rand_long) + when 'timestamp-nanos' + Avro::LogicalTypes::TimestampNanos.decode(rand_long) end end diff --git a/lang/ruby/test/test_io.rb b/lang/ruby/test/test_io.rb index afbd81e477e..c2b5ffc722c 100644 --- a/lang/ruby/test/test_io.rb +++ b/lang/ruby/test/test_io.rb @@ -94,7 +94,10 @@ def test_record_with_logical_type "logicalType": "timestamp-micros"}}, {"name": "ts2", "type": {"type": "long", - "logicalType": "timestamp-millis"}}]} + "logicalType": "timestamp-millis"}}, + {"name": "ts3", + "type": {"type": "long", + "logicalType": "timestamp-nanos"}}]} EOS check(record_schema) end diff --git a/lang/ruby/test/test_logical_types.rb b/lang/ruby/test/test_logical_types.rb index 3dd7ce183f5..cb83bdc5d1d 100644 --- a/lang/ruby/test/test_logical_types.rb +++ b/lang/ruby/test/test_logical_types.rb @@ -92,6 +92,28 @@ def test_timestamp_micros_long_conversion assert_equal Time.utc(2015, 5, 28, 21, 46, 53, 221843), type.decode(1432849613221843) end + def test_timestamp_nanos_long + schema = Avro::Schema.parse <<-SCHEMA + { "type": "long", "logicalType": "timestamp-nanos" } + SCHEMA + + time = Time.at(628232400, 123456789, :nanosecond) + assert_equal 'timestamp-nanos', schema.logical_type + assert_encode_and_decode time, schema + assert_preencoded Avro::LogicalTypes::TimestampNanos.encode(time), schema, time.utc + end + + def test_timestamp_nanos_long_conversion + type = Avro::LogicalTypes::TimestampNanos + + now = Time.now.utc + + assert_equal Time.at(now.to_i, now.nsec, :nanosecond).utc, type.decode(type.encode(now)) + assert_equal 1432849613221843789, type.encode(Time.at(1432849613, 221843789, :nanosecond).utc) + assert_equal 1432849613221843789, type.encode(DateTime.new(2015, 5, 28, 21, 46, 53.221843789)) + assert_equal Time.at(1432849613, 221843789, :nanosecond).utc, type.decode(1432849613221843789) + end + def test_parse_fixed_duration schema = Avro::Schema.parse <<-SCHEMA { "type": "fixed", "size": 12, "name": "fixed_dur", "logicalType": "duration" } From c5523dc84453af377b714a729e3de47ad9a759b5 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 3 Jan 2024 10:51:04 +0200 Subject: [PATCH 14/56] Update serde_json to 1.0.110 Signed-off-by: Martin Tzvetanov Grigorov --- lang/rust/Cargo.lock | 4 ++-- lang/rust/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index 3f02e0a24c2..33432ab782a 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -1120,9 +1120,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "6fbd975230bada99c8bb618e0c365c2eefa219158d5c6c29610fd09ff1833257" dependencies = [ "itoa", "ryu", diff --git a/lang/rust/Cargo.toml b/lang/rust/Cargo.toml index ef1bb84a68b..9e0a0ad873c 100644 --- a/lang/rust/Cargo.toml +++ b/lang/rust/Cargo.toml @@ -43,7 +43,7 @@ documentation = "https://docs.rs/apache-avro" [workspace.dependencies] log = { default-features = false, version = "0.4.20" } serde = { default-features = false, version = "1.0.194", features = ["derive"] } -serde_json = { default-features = false, version = "1.0.108", features = ["std"] } +serde_json = { default-features = false, version = "1.0.110", features = ["std"] } [profile.release.package.hello-wasm] # Tell `rustc` to optimize for small code size. From 1dbfef088a5c5d92e72ef31e43e51e0e1f24facb Mon Sep 17 00:00:00 2001 From: Brian Cullen Date: Wed, 3 Jan 2024 09:53:56 +0100 Subject: [PATCH 15/56] AVRO-3889: [Java][Build] Maven IDL Generation Modification Check (#2564) Check if the IDL source file has changed before regenerating the Java classes to prevent unnecessary recompilation when using maven. Co-authored-by: Brian Cullen --- .../java/org/apache/avro/mojo/IDLMojo.java | 6 +- .../org/apache/avro/mojo/TestIDLMojo.java | 51 +++++++++++++- .../unit/idl/pom-incremental-compilation.xml | 67 +++++++++++++++++++ 3 files changed, 119 insertions(+), 5 deletions(-) create mode 100644 lang/java/maven-plugin/src/test/resources/unit/idl/pom-incremental-compilation.xml diff --git a/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/IDLMojo.java b/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/IDLMojo.java index d6db625d1de..54f49b04fb5 100644 --- a/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/IDLMojo.java +++ b/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/IDLMojo.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.net.URL; import java.net.URLClassLoader; +import java.nio.file.Path; import java.util.ArrayList; import java.util.List; @@ -84,7 +85,8 @@ protected void doCompile(String filename, File sourceDirectory, File outputDirec Thread.currentThread().setContextClassLoader(projPathLoader); try { IdlReader parser = new IdlReader(); - IdlFile idlFile = parser.parse(sourceDirectory.toPath().resolve(filename)); + Path sourceFilePath = sourceDirectory.toPath().resolve(filename); + IdlFile idlFile = parser.parse(sourceFilePath); for (String warning : idlFile.getWarnings()) { getLog().warn(warning); } @@ -109,7 +111,7 @@ protected void doCompile(String filename, File sourceDirectory, File outputDirec compiler.addCustomConversion(projPathLoader.loadClass(customConversion)); } compiler.setOutputCharacterEncoding(project.getProperties().getProperty("project.build.sourceEncoding")); - compiler.compileToDestination(null, outputDirectory); + compiler.compileToDestination(sourceFilePath.toFile(), outputDirectory); } finally { Thread.currentThread().setContextClassLoader(contextClassLoader); } diff --git a/lang/java/maven-plugin/src/test/java/org/apache/avro/mojo/TestIDLMojo.java b/lang/java/maven-plugin/src/test/java/org/apache/avro/mojo/TestIDLMojo.java index 94cc5b29e52..ab6cd7c9668 100644 --- a/lang/java/maven-plugin/src/test/java/org/apache/avro/mojo/TestIDLMojo.java +++ b/lang/java/maven-plugin/src/test/java/org/apache/avro/mojo/TestIDLMojo.java @@ -18,7 +18,10 @@ package org.apache.avro.mojo; import java.io.File; -import java.util.Collections; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.attribute.FileTime; import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -37,8 +40,15 @@ public class TestIDLMojo extends AbstractAvroMojoTest { private File injectingVelocityToolsTestPom = new File(getBasedir(), "src/test/resources/unit/idl/pom-injecting-velocity-tools.xml"); + private File incrementalCompilationTestPom = new File(getBasedir(), + "src/test/resources/unit/idl/pom-incremental-compilation.xml"); + @Test public void testIdlProtocolMojo() throws Exception { + // Clear output directory to ensure files are recompiled. + final File outputDir = new File(getBasedir(), "target/test-harness/idl/test/"); + FileUtils.deleteDirectory(outputDir); + final IDLMojo mojo = (IDLMojo) lookupMojo("idl", testPom); final TestLog log = new TestLog(); mojo.setLog(log); @@ -46,7 +56,6 @@ public void testIdlProtocolMojo() throws Exception { assertNotNull(mojo); mojo.execute(); - final File outputDir = new File(getBasedir(), "target/test-harness/idl/test/"); final Set generatedFiles = new HashSet<>( asList("IdlPrivacy.java", "IdlTest.java", "IdlUser.java", "IdlUserWrapper.java")); assertFilesExist(outputDir, generatedFiles); @@ -60,6 +69,10 @@ public void testIdlProtocolMojo() throws Exception { @Test public void testSetCompilerVelocityAdditionalTools() throws Exception { + // Clear output directory to ensure files are recompiled. + final File outputDir = new File(getBasedir(), "target/test-harness/idl-inject/test/"); + FileUtils.deleteDirectory(outputDir); + final IDLProtocolMojo mojo = (IDLProtocolMojo) lookupMojo("idl-protocol", injectingVelocityToolsTestPom); final TestLog log = new TestLog(); mojo.setLog(log); @@ -67,7 +80,6 @@ public void testSetCompilerVelocityAdditionalTools() throws Exception { assertNotNull(mojo); mojo.execute(); - final File outputDir = new File(getBasedir(), "target/test-harness/idl-inject/test"); final Set generatedFiles = new HashSet<>( asList("IdlPrivacy.java", "IdlTest.java", "IdlUser.java", "IdlUserWrapper.java")); @@ -79,4 +91,37 @@ public void testSetCompilerVelocityAdditionalTools() throws Exception { // The previous test already verifies the warnings. assertFalse(log.getLogEntries().isEmpty()); } + + @Test + public void testIDLProtocolMojoSupportsIncrementalCompilation() throws Exception { + // Ensure that the IDL files have already been compiled once. + final IDLMojo mojo = (IDLMojo) lookupMojo("idl", incrementalCompilationTestPom); + final TestLog log = new TestLog(); + mojo.setLog(log); + + assertNotNull(mojo); + mojo.execute(); + + // Remove one file to ensure it is recreated and the others are not. + final Path outputDirPath = Paths.get(getBasedir(), "target/test-harness/idl-incremental/test/"); + final File outputDir = outputDirPath.toFile(); + + final Path idlPrivacyFilePath = outputDirPath.resolve("IdlPrivacy.java"); + final FileTime idpPrivacyModificationTime = Files.getLastModifiedTime(idlPrivacyFilePath); + Files.delete(idlPrivacyFilePath); + + final Path idlUserFilePath = outputDirPath.resolve("IdlUser.java"); + final FileTime idlUserModificationTime = Files.getLastModifiedTime(idlUserFilePath); + + mojo.execute(); + + // Asserting contents is done in previous tests so just assert existence. + final Set generatedFiles = new HashSet<>( + asList("IdlPrivacy.java", "IdlTest.java", "IdlUser.java", "IdlUserWrapper.java")); + assertFilesExist(outputDir, generatedFiles); + + assertTrue(idlPrivacyFilePath.toFile().exists()); + assertEquals(Files.getLastModifiedTime(idlUserFilePath), idlUserModificationTime); + assertTrue(Files.getLastModifiedTime(idlPrivacyFilePath).compareTo(idpPrivacyModificationTime) > 0); + } } diff --git a/lang/java/maven-plugin/src/test/resources/unit/idl/pom-incremental-compilation.xml b/lang/java/maven-plugin/src/test/resources/unit/idl/pom-incremental-compilation.xml new file mode 100644 index 00000000000..ddf8ff0bd08 --- /dev/null +++ b/lang/java/maven-plugin/src/test/resources/unit/idl/pom-incremental-compilation.xml @@ -0,0 +1,67 @@ + + + + 4.0.0 + + + avro-parent + org.apache.avro + 1.12.0-SNAPSHOT + ../../../../../../../../../pom.xml + + + avro-maven-plugin-test + jar + + testproject + + + + + avro-maven-plugin + + + idl + + idl-protocol + + + + + ${basedir}/src/test + ${basedir}/target/test-harness/idl-incremental + String + + + + + + + + org.apache.avro + avro + ${parent.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + From 218200cb8cfc681fed4f3e8e764f886ad043406c Mon Sep 17 00:00:00 2001 From: Fokko Driesprong Date: Wed, 3 Jan 2024 14:57:02 +0100 Subject: [PATCH 16/56] AVRO-3923: [Docs] Add 1.11.3 release blog (#2656) --- .../en/blog/releases/avro-1.11.3-released.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100755 doc/content/en/blog/releases/avro-1.11.3-released.md diff --git a/doc/content/en/blog/releases/avro-1.11.3-released.md b/doc/content/en/blog/releases/avro-1.11.3-released.md new file mode 100755 index 00000000000..50a0eef3fcf --- /dev/null +++ b/doc/content/en/blog/releases/avro-1.11.3-released.md @@ -0,0 +1,79 @@ +--- +title: "Avro 1.11.3" +linkTitle: "Avro 1.11.3" +date: 2023-09-22 +--- + + + +The Apache Avro community is pleased to announce the release of Avro 1.11.3! + +All signed release artifacts, signatures and verification instructions can +be found }}">here + +This release [addresses 39 Jira issues](https://issues.apache.org/jira/issues/?jql=project%3DAVRO%20AND%20fixVersion%3D1.11.3). + +## Highlights + +Java +- [AVRO-3789](https://issues.apache.org/jira/browse/AVRO-3789): Comparing maps in GenericData is wrong for certain combinations and fails for empty maps +- [AVRO-3713](https://issues.apache.org/jira/browse/AVRO-3713): Thread scalability problem with the use of SynchronizedMap +- [AVRO-3486](https://issues.apache.org/jira/browse/AVRO-3486): Protocol namespace not parsed correctly if protocol is defined by full name +- [AVRO-2771](https://issues.apache.org/jira/browse/AVRO-2771): Allow having Error in a Record +- [AVRO-3819](https://issues.apache.org/jira/browse/AVRO-3819): Rationalize the system properties that limit allocation + +Python +- [AVRO-3819](https://issues.apache.org/jira/browse/AVRO-3819): Rationalize the system properties that limit allocation +- [AVRO-312](https://issues.apache.org/jira/browse/AVRO-312): Generate documentation for Python with Sphinx + +Rust +- [AVRO-3853](https://issues.apache.org/jira/browse/AVRO-3853): Support local-timestamp logical types for the Rust SDK +- [AVRO-3851](https://issues.apache.org/jira/browse/AVRO-3851): Validate default value for record fields and enums on parsing +- [AVRO-3847](https://issues.apache.org/jira/browse/AVRO-3847): Record field doesn't accept default value if field type is union and the type of default value is pre-defined name +- [AVRO-3846](https://issues.apache.org/jira/browse/AVRO-3846): Race condition can happen among serde tests +- [AVRO-3838](https://issues.apache.org/jira/browse/AVRO-3838): Replace regex crate with regex-lite +- [AVRO-3837](https://issues.apache.org/jira/browse/AVRO-3837): Disallow invalid namespaces for the Rust binding +- [AVRO-3835](https://issues.apache.org/jira/browse/AVRO-3835): Get rid of byteorder and zerocopy dependencies +- [AVRO-3830](https://issues.apache.org/jira/browse/AVRO-3830): Handle namespace properly if a name starts with dot +- [AVRO-3827](https://issues.apache.org/jira/browse/AVRO-3827): Disallow duplicate field names +- [AVRO-3787](https://issues.apache.org/jira/browse/AVRO-3787): Deserialization fails to use default if an enum in a record in a union is given an unknown symbol +- [AVRO-3786](https://issues.apache.org/jira/browse/AVRO-3786): Deserialization results in FindUnionVariant error if the writer and reader have the same symbol but at different positions +- + +In addition: +- Upgrade dependencies to latest versions, including CVE fixes. +- Testing and build improvements. +- Performance fixes, other bug fixes, better documentation and more. + +Known issues: ∅ + +## Language SDK / Convenience artifacts + +* C#: https://www.nuget.org/packages/Apache.Avro/1.11.3 +* Java: https://repo1.maven.org/maven2/org/apache/avro/avro/1.11.3/ +* Javascript: https://www.npmjs.com/package/avro-js/v/1.11.3 +* Perl: https://metacpan.org/release/Avro +* Python 3: https://pypi.org/project/avro/1.11.3 +* Ruby: https://rubygems.org/gems/avro/versions/1.11.3 +* Rust: https://crates.io/crates/apache-avro/0.16.0 + +Thanks to everyone for contributing! From e5ca1517b7d80454fa7137e3ef53b4335416de09 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Jan 2024 09:30:31 +0200 Subject: [PATCH 17/56] Bump thiserror from 1.0.55 to 1.0.56 in /lang/rust (#2671) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.55 to 1.0.56. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.55...1.0.56) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 8 ++++---- lang/rust/avro/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index 33432ab782a..a2322f882c2 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -1218,18 +1218,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.55" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3de26b0965292219b4287ff031fcba86837900fe9cd2b34ea8ad893c0953d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.55" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "268026685b2be38d7103e9e507c938a1fcb3d7e6eb15e87870b617bf37b6d581" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", diff --git a/lang/rust/avro/Cargo.toml b/lang/rust/avro/Cargo.toml index 2800d4326de..90b58331cb6 100644 --- a/lang/rust/avro/Cargo.toml +++ b/lang/rust/avro/Cargo.toml @@ -68,7 +68,7 @@ serde_json = { workspace = true } snap = { default-features = false, version = "1.1.0", optional = true } strum = { default-features = false, version = "0.25.0" } strum_macros = { default-features = false, version = "0.25.3" } -thiserror = { default-features = false, version = "1.0.55" } +thiserror = { default-features = false, version = "1.0.56" } typed-builder = { default-features = false, version = "0.18.0" } uuid = { default-features = false, version = "1.6.1", features = ["serde", "std"] } xz2 = { default-features = false, version = "0.1.7", optional = true } From 4295bc2289d5e16525beaae622d929067716dbd9 Mon Sep 17 00:00:00 2001 From: Renjie Liu Date: Thu, 4 Jan 2024 19:02:09 +0800 Subject: [PATCH 18/56] AVRO-3925: Fix decimal serialization format (#2673) --- lang/rust/avro/src/schema.rs | 142 ++++++++++++++++++++++++++++------- 1 file changed, 113 insertions(+), 29 deletions(-) diff --git a/lang/rust/avro/src/schema.rs b/lang/rust/avro/src/schema.rs index 6ebbb21a8ca..ef9aa33ee88 100644 --- a/lang/rust/avro/src/schema.rs +++ b/lang/rust/avro/src/schema.rs @@ -49,7 +49,7 @@ fn schema_name_r() -> &'static Regex { Regex::new( r"^((?P([A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*)?)\.)?(?P[A-Za-z_][A-Za-z0-9_]*)$", ) - .unwrap() + .unwrap() }) } @@ -836,6 +836,33 @@ pub struct FixedSchema { pub attributes: BTreeMap, } +impl FixedSchema { + fn serialize_to_map(&self, mut map: S::SerializeMap) -> Result + where + S: Serializer, + { + map.serialize_entry("type", "fixed")?; + if let Some(ref n) = self.name.namespace { + map.serialize_entry("namespace", n)?; + } + map.serialize_entry("name", &self.name.name)?; + if let Some(ref docstr) = self.doc { + map.serialize_entry("doc", docstr)?; + } + map.serialize_entry("size", &self.size)?; + + if let Some(ref aliases) = self.aliases { + map.serialize_entry("aliases", aliases)?; + } + + for attr in &self.attributes { + map.serialize_entry(attr.0, attr.1)?; + } + + Ok(map) + } +} + /// A description of a Union schema. /// /// `scale` defaults to 0 and is an integer greater than or equal to 0 and `precision` is an @@ -1883,31 +1910,9 @@ impl Serialize for Schema { } map.end() } - Schema::Fixed(FixedSchema { - ref name, - ref doc, - ref size, - ref aliases, - ref attributes, - }) => { + Schema::Fixed(ref fixed_schema) => { let mut map = serializer.serialize_map(None)?; - map.serialize_entry("type", "fixed")?; - if let Some(ref n) = name.namespace { - map.serialize_entry("namespace", n)?; - } - map.serialize_entry("name", &name.name)?; - if let Some(ref docstr) = doc { - map.serialize_entry("doc", docstr)?; - } - map.serialize_entry("size", size)?; - - if let Some(ref aliases) = aliases { - map.serialize_entry("aliases", aliases)?; - } - - for attr in attributes { - map.serialize_entry(attr.0, attr.1)?; - } + map = fixed_schema.serialize_to_map::(map)?; map.end() } Schema::Decimal(DecimalSchema { @@ -1916,12 +1921,26 @@ impl Serialize for Schema { ref inner, }) => { let mut map = serializer.serialize_map(None)?; - map.serialize_entry("type", &*inner.clone())?; + match inner.as_ref() { + Schema::Fixed(fixed_schema) => { + map = fixed_schema.serialize_to_map::(map)?; + } + Schema::Bytes => { + map.serialize_entry("type", "bytes")?; + } + others => { + return Err(serde::ser::Error::custom(format!( + "DecimalSchema inner type must be Fixed or Bytes, got {:?}", + SchemaKind::from(others) + ))); + } + } map.serialize_entry("logicalType", "decimal")?; map.serialize_entry("scale", scale)?; map.serialize_entry("precision", precision)?; map.end() } + Schema::BigDecimal => { let mut map = serializer.serialize_map(None)?; map.serialize_entry("type", "bytes")?; @@ -2210,7 +2229,7 @@ pub mod derive { } } - macro_rules! impl_schema( + macro_rules! impl_schema ( ($type:ty, $variant_constructor:expr) => ( impl AvroSchemaComponent for $type { fn get_schema_in_ctxt(_: &mut Names, _: &Namespace) -> Schema { @@ -3341,7 +3360,7 @@ mod tests { schema, Schema::Union(UnionSchema::new(vec![ Schema::Null, - Schema::TimestampMicros + Schema::TimestampMicros, ])?) ); @@ -5271,7 +5290,7 @@ mod tests { match Schema::parse_str(schema_str) { Err(Error::FieldNameDuplicate(_)) => (), other => { - return Err(format!("Expected Error::FieldNameDuplicate, got {other:?}").into()) + return Err(format!("Expected Error::FieldNameDuplicate, got {other:?}").into()); } }; @@ -6396,4 +6415,69 @@ mod tests { Ok(()) } + + #[test] + fn test_avro_3925_serialize_decimal_inner_fixed() -> TestResult { + let schema = Schema::Decimal(DecimalSchema { + precision: 36, + scale: 10, + inner: Box::new(Schema::Fixed(FixedSchema { + name: Name::new("decimal_36_10").unwrap(), + aliases: None, + doc: None, + size: 16, + attributes: Default::default(), + })), + }); + + let serialized_json = serde_json::to_string_pretty(&schema)?; + + let expected_json = r#"{ + "type": "fixed", + "name": "decimal_36_10", + "size": 16, + "logicalType": "decimal", + "scale": 10, + "precision": 36 +}"#; + + assert_eq!(serialized_json, expected_json); + Ok(()) + } + + #[test] + fn test_avro_3925_serialize_decimal_inner_bytes() -> TestResult { + let schema = Schema::Decimal(DecimalSchema { + precision: 36, + scale: 10, + inner: Box::new(Schema::Bytes), + }); + + let serialized_json = serde_json::to_string_pretty(&schema)?; + + let expected_json = r#"{ + "type": "bytes", + "logicalType": "decimal", + "scale": 10, + "precision": 36 +}"#; + + assert_eq!(serialized_json, expected_json); + Ok(()) + } + + #[test] + fn test_avro_3925_serialize_decimal_inner_invalid() -> TestResult { + let schema = Schema::Decimal(DecimalSchema { + precision: 36, + scale: 10, + inner: Box::new(Schema::String), + }); + + let serialized_json = serde_json::to_string_pretty(&schema); + + assert!(serialized_json.is_err()); + + Ok(()) + } } From 08a53e6f94391ccc96748a4fbbade9cf173a572a Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 4 Jan 2024 12:59:51 +0200 Subject: [PATCH 19/56] AVRO-3925: [Rust] Improve formatting Signed-off-by: Martin Tzvetanov Grigorov --- lang/rust/avro/src/schema.rs | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/lang/rust/avro/src/schema.rs b/lang/rust/avro/src/schema.rs index ef9aa33ee88..b26090cf2e1 100644 --- a/lang/rust/avro/src/schema.rs +++ b/lang/rust/avro/src/schema.rs @@ -48,8 +48,7 @@ fn schema_name_r() -> &'static Regex { SCHEMA_NAME_ONCE.get_or_init(|| { Regex::new( r"^((?P([A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*)?)\.)?(?P[A-Za-z_][A-Za-z0-9_]*)$", - ) - .unwrap() + ).unwrap() }) } @@ -6433,13 +6432,13 @@ mod tests { let serialized_json = serde_json::to_string_pretty(&schema)?; let expected_json = r#"{ - "type": "fixed", - "name": "decimal_36_10", - "size": 16, - "logicalType": "decimal", - "scale": 10, - "precision": 36 -}"#; + "type": "fixed", + "name": "decimal_36_10", + "size": 16, + "logicalType": "decimal", + "scale": 10, + "precision": 36 + }"#; assert_eq!(serialized_json, expected_json); Ok(()) @@ -6456,11 +6455,11 @@ mod tests { let serialized_json = serde_json::to_string_pretty(&schema)?; let expected_json = r#"{ - "type": "bytes", - "logicalType": "decimal", - "scale": 10, - "precision": 36 -}"#; + "type": "bytes", + "logicalType": "decimal", + "scale": 10, + "precision": 36 + }"#; assert_eq!(serialized_json, expected_json); Ok(()) From 4739bf20ed076dce371746ddee4af8e01e2bcab4 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 4 Jan 2024 13:17:21 +0200 Subject: [PATCH 20/56] a Signed-off-by: Martin Tzvetanov Grigorov --- lang/rust/avro/src/schema.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lang/rust/avro/src/schema.rs b/lang/rust/avro/src/schema.rs index b26090cf2e1..787e8596e82 100644 --- a/lang/rust/avro/src/schema.rs +++ b/lang/rust/avro/src/schema.rs @@ -6432,13 +6432,13 @@ mod tests { let serialized_json = serde_json::to_string_pretty(&schema)?; let expected_json = r#"{ - "type": "fixed", - "name": "decimal_36_10", - "size": 16, - "logicalType": "decimal", - "scale": 10, - "precision": 36 - }"#; + "type": "fixed", + "name": "decimal_36_10", + "size": 16, + "logicalType": "decimal", + "scale": 10, + "precision": 36 +}"#; assert_eq!(serialized_json, expected_json); Ok(()) @@ -6455,11 +6455,11 @@ mod tests { let serialized_json = serde_json::to_string_pretty(&schema)?; let expected_json = r#"{ - "type": "bytes", - "logicalType": "decimal", - "scale": 10, - "precision": 36 - }"#; + "type": "bytes", + "logicalType": "decimal", + "scale": 10, + "precision": 36 +}"#; assert_eq!(serialized_json, expected_json); Ok(()) From 5184f83cb7ca11469b45343e3bf9198eaf4de594 Mon Sep 17 00:00:00 2001 From: ZENOTME <43447882+ZENOTME@users.noreply.github.com> Date: Thu, 4 Jan 2024 20:08:20 +0800 Subject: [PATCH 21/56] AVRO-3920: Serialize custom attribute in RecordField (#2650) * AVRO-3920: [Rust] * serialize custom attr in record field * AVRO-3920: [Rust] Do not parse "logicalType" as a custom RecordField attribute Signed-off-by: Martin Tzvetanov Grigorov --- lang/rust/avro/src/schema.rs | 78 +++++++++++++++++++++++++++------ lang/rust/avro_derive/README.md | 2 +- 2 files changed, 65 insertions(+), 15 deletions(-) diff --git a/lang/rust/avro/src/schema.rs b/lang/rust/avro/src/schema.rs index 787e8596e82..f4c063df60d 100644 --- a/lang/rust/avro/src/schema.rs +++ b/lang/rust/avro/src/schema.rs @@ -709,10 +709,10 @@ impl RecordField { doc: field.doc(), default, aliases, - schema, order, position, - custom_attributes: RecordField::get_field_custom_attributes(field), + custom_attributes: RecordField::get_field_custom_attributes(field, &schema), + schema, }) } @@ -765,11 +765,17 @@ impl RecordField { Ok(()) } - fn get_field_custom_attributes(field: &Map) -> BTreeMap { + fn get_field_custom_attributes( + field: &Map, + schema: &Schema, + ) -> BTreeMap { let mut custom_attributes: BTreeMap = BTreeMap::new(); for (key, value) in field { match key.as_str() { - "type" | "name" | "doc" | "default" | "order" | "position" | "aliases" => continue, + "type" | "name" | "doc" | "default" | "order" | "position" | "aliases" + | "logicalType" => continue, + key if key == "symbols" && matches!(schema, Schema::Enum(_)) => continue, + key if key == "size" && matches!(schema, Schema::Fixed(_)) => continue, _ => custom_attributes.insert(key.clone(), value.clone()), }; } @@ -2043,6 +2049,10 @@ impl Serialize for RecordField { map.serialize_entry("aliases", aliases)?; } + for attr in &self.custom_attributes { + map.serialize_entry(attr.0, attr.1)?; + } + map.end() } } @@ -4541,26 +4551,26 @@ mod tests { assert_eq!( schema.custom_attributes(), - Some(&expected_custom_attibutes()) + Some(&expected_custom_attributes()) ); } Ok(()) } - fn expected_custom_attibutes() -> BTreeMap { - let mut expected_attibutes: BTreeMap = Default::default(); - expected_attibutes.insert("string_key".to_string(), Value::String("value".to_string())); - expected_attibutes.insert("number_key".to_string(), json!(1.23)); - expected_attibutes.insert("null_key".to_string(), Value::Null); - expected_attibutes.insert( + fn expected_custom_attributes() -> BTreeMap { + let mut expected_attributes: BTreeMap = Default::default(); + expected_attributes.insert("string_key".to_string(), Value::String("value".to_string())); + expected_attributes.insert("number_key".to_string(), json!(1.23)); + expected_attributes.insert("null_key".to_string(), Value::Null); + expected_attributes.insert( "array_key".to_string(), Value::Array(vec![json!(1), json!(2), json!(3)]), ); let mut object_value: HashMap = HashMap::new(); object_value.insert("key".to_string(), Value::String("value".to_string())); - expected_attibutes.insert("object_key".to_string(), json!(object_value)); - expected_attibutes + expected_attributes.insert("object_key".to_string(), json!(object_value)); + expected_attributes } #[test] @@ -4590,7 +4600,7 @@ mod tests { assert_eq!(fields.len(), 1); let field = &fields[0]; assert_eq!(&field.name, "field_one"); - assert_eq!(field.custom_attributes, expected_custom_attibutes()); + assert_eq!(field.custom_attributes, expected_custom_attributes()); } _ => panic!("Expected Schema::Record"), } @@ -6415,6 +6425,44 @@ mod tests { Ok(()) } + #[test] + fn avro_3920_serialize_record_with_custom_attributes() -> TestResult { + let expected = { + let mut lookup = BTreeMap::new(); + lookup.insert("value".to_owned(), 0); + Schema::Record(RecordSchema { + name: Name { + name: "LongList".to_owned(), + namespace: None, + }, + aliases: Some(vec![Alias::new("LinkedLongs").unwrap()]), + doc: None, + fields: vec![RecordField { + name: "value".to_string(), + doc: None, + default: None, + aliases: None, + schema: Schema::Long, + order: RecordFieldOrder::Ascending, + position: 0, + custom_attributes: BTreeMap::from([("field-id".to_string(), 1.into())]), + }], + lookup, + attributes: BTreeMap::from([("custom-attribute".to_string(), "value".into())]), + }) + }; + + let value = serde_json::to_value(&expected)?; + let serialized = serde_json::to_string(&value)?; + assert_eq!( + r#"{"aliases":["LinkedLongs"],"custom-attribute":"value","fields":[{"field-id":1,"name":"value","type":"long"}],"name":"LongList","type":"record"}"#, + &serialized + ); + assert_eq!(expected, Schema::parse_str(&serialized)?); + + Ok(()) + } + #[test] fn test_avro_3925_serialize_decimal_inner_fixed() -> TestResult { let schema = Schema::Decimal(DecimalSchema { @@ -6441,6 +6489,7 @@ mod tests { }"#; assert_eq!(serialized_json, expected_json); + Ok(()) } @@ -6462,6 +6511,7 @@ mod tests { }"#; assert_eq!(serialized_json, expected_json); + Ok(()) } diff --git a/lang/rust/avro_derive/README.md b/lang/rust/avro_derive/README.md index 6faa215f51d..0098d38970a 100644 --- a/lang/rust/avro_derive/README.md +++ b/lang/rust/avro_derive/README.md @@ -66,4 +66,4 @@ let encoded = writer.into_inner(); ``` ### Compatibility Notes -This module is designed to work in concert with the Serde implemenation. If your use case dictates needing to manually convert to a `Value` type in order to encode then the derived schema may not be correct. +This module is designed to work in concert with the Serde implementation. If your use case dictates needing to manually convert to a `Value` type in order to encode then the derived schema may not be correct. From bf68f5749775a169caa3aadef129eccfdfe42808 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Jan 2024 22:10:24 +0200 Subject: [PATCH 22/56] Bump serde_json from 1.0.110 to 1.0.111 in /lang/rust (#2675) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.110 to 1.0.111. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.110...v1.0.111) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 4 ++-- lang/rust/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index a2322f882c2..5a8aa459c7d 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -1120,9 +1120,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.110" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fbd975230bada99c8bb618e0c365c2eefa219158d5c6c29610fd09ff1833257" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", diff --git a/lang/rust/Cargo.toml b/lang/rust/Cargo.toml index 9e0a0ad873c..18d5f5db26e 100644 --- a/lang/rust/Cargo.toml +++ b/lang/rust/Cargo.toml @@ -43,7 +43,7 @@ documentation = "https://docs.rs/apache-avro" [workspace.dependencies] log = { default-features = false, version = "0.4.20" } serde = { default-features = false, version = "1.0.194", features = ["derive"] } -serde_json = { default-features = false, version = "1.0.110", features = ["std"] } +serde_json = { default-features = false, version = "1.0.111", features = ["std"] } [profile.release.package.hello-wasm] # Tell `rustc` to optimize for small code size. From 530fe071b0a278232267b4f9f6ac29b8134644b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Jan 2024 22:10:42 +0200 Subject: [PATCH 23/56] Bump proc-macro2 from 1.0.74 to 1.0.75 in /lang/rust (#2674) Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.74 to 1.0.75. - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.74...1.0.75) --- updated-dependencies: - dependency-name: proc-macro2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 4 ++-- lang/rust/avro_derive/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index 5a8aa459c7d..da034343d82 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -913,9 +913,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.74" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2de98502f212cfcea8d0bb305bd0f49d7ebdd75b64ba0a68f937d888f4e0d6db" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" dependencies = [ "unicode-ident", ] diff --git a/lang/rust/avro_derive/Cargo.toml b/lang/rust/avro_derive/Cargo.toml index 916b0cfcd08..54f6ed35165 100644 --- a/lang/rust/avro_derive/Cargo.toml +++ b/lang/rust/avro_derive/Cargo.toml @@ -34,7 +34,7 @@ proc-macro = true [dependencies] darling = { default-features = false, version = "0.20.3" } -proc-macro2 = { default-features = false, version = "1.0.71" } +proc-macro2 = { default-features = false, version = "1.0.75" } quote = { default-features = false, version = "1.0.35" } serde_json = { workspace = true } syn = { default-features = false, version = "2.0.42", features = ["full", "fold"] } From 03c3f64b41bc67329f969e154f68137861a88b84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 6 Jan 2024 11:10:08 +0200 Subject: [PATCH 24/56] Bump syn from 2.0.46 to 2.0.48 in /lang/rust (#2677) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.46 to 2.0.48. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.46...2.0.48) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 4 ++-- lang/rust/avro_derive/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index da034343d82..80db2e66883 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -1207,9 +1207,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.46" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89456b690ff72fddcecf231caedbe615c59480c93358a93dfae7fc29e3ebbf0e" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", diff --git a/lang/rust/avro_derive/Cargo.toml b/lang/rust/avro_derive/Cargo.toml index 54f6ed35165..bc9116ba983 100644 --- a/lang/rust/avro_derive/Cargo.toml +++ b/lang/rust/avro_derive/Cargo.toml @@ -37,7 +37,7 @@ darling = { default-features = false, version = "0.20.3" } proc-macro2 = { default-features = false, version = "1.0.75" } quote = { default-features = false, version = "1.0.35" } serde_json = { workspace = true } -syn = { default-features = false, version = "2.0.42", features = ["full", "fold"] } +syn = { default-features = false, version = "2.0.48", features = ["full", "fold"] } [dev-dependencies] apache-avro = { default-features = false, path = "../avro", features = ["derive"] } From f232410256645b05fcf761621e603db008e6e1b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 11:26:04 +0200 Subject: [PATCH 25/56] Bump serde from 1.0.194 to 1.0.195 in /lang/rust (#2680) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.194 to 1.0.195. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.194...v1.0.195) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 8 ++++---- lang/rust/Cargo.toml | 2 +- lang/rust/avro_derive/Cargo.toml | 2 +- lang/rust/wasm-demo/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index 80db2e66883..8de17f974f1 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -1100,18 +1100,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.194" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.194" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", diff --git a/lang/rust/Cargo.toml b/lang/rust/Cargo.toml index 18d5f5db26e..c97965c1e34 100644 --- a/lang/rust/Cargo.toml +++ b/lang/rust/Cargo.toml @@ -42,7 +42,7 @@ documentation = "https://docs.rs/apache-avro" # dependencies used by more than one members [workspace.dependencies] log = { default-features = false, version = "0.4.20" } -serde = { default-features = false, version = "1.0.194", features = ["derive"] } +serde = { default-features = false, version = "1.0.195", features = ["derive"] } serde_json = { default-features = false, version = "1.0.111", features = ["std"] } [profile.release.package.hello-wasm] diff --git a/lang/rust/avro_derive/Cargo.toml b/lang/rust/avro_derive/Cargo.toml index bc9116ba983..da8bd1edc3b 100644 --- a/lang/rust/avro_derive/Cargo.toml +++ b/lang/rust/avro_derive/Cargo.toml @@ -42,4 +42,4 @@ syn = { default-features = false, version = "2.0.48", features = ["full", "fold" [dev-dependencies] apache-avro = { default-features = false, path = "../avro", features = ["derive"] } proptest = { default-features = false, version = "1.4.0", features = ["std"] } -serde = { default-features = false, version = "1.0.194", features = ["derive"] } +serde = { default-features = false, version = "1.0.195", features = ["derive"] } diff --git a/lang/rust/wasm-demo/Cargo.toml b/lang/rust/wasm-demo/Cargo.toml index 32c202a7f24..44327051cac 100644 --- a/lang/rust/wasm-demo/Cargo.toml +++ b/lang/rust/wasm-demo/Cargo.toml @@ -36,7 +36,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] apache-avro = { path = "../avro" } -serde = { default-features = false, version = "1.0.194", features = ["derive"] } +serde = { default-features = false, version = "1.0.195", features = ["derive"] } wasm-bindgen = "0.2.88" [dev-dependencies] From ac0f469e63d192517dc13239fb03a93eb6d58b8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 11:26:32 +0200 Subject: [PATCH 26/56] Bump serial_test from 2.0.0 to 3.0.0 in /lang/rust (#2679) Bumps [serial_test](https://github.com/palfrey/serial_test) from 2.0.0 to 3.0.0. - [Release notes](https://github.com/palfrey/serial_test/releases) - [Commits](https://github.com/palfrey/serial_test/compare/v2.0.0...v3.0.0) --- updated-dependencies: - dependency-name: serial_test dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 8 ++++---- lang/rust/avro/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index 8de17f974f1..888fc8b6d88 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -1131,9 +1131,9 @@ dependencies = [ [[package]] name = "serial_test" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d" +checksum = "953ad9342b3aaca7cb43c45c097dd008d4907070394bd0751a0aa8817e5a018d" dependencies = [ "dashmap", "futures", @@ -1145,9 +1145,9 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" +checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212" dependencies = [ "proc-macro2", "quote", diff --git a/lang/rust/avro/Cargo.toml b/lang/rust/avro/Cargo.toml index 90b58331cb6..9c1dc4edc49 100644 --- a/lang/rust/avro/Cargo.toml +++ b/lang/rust/avro/Cargo.toml @@ -88,5 +88,5 @@ criterion = { default-features = false, version = "0.5.1" } hex-literal = { default-features = false, version = "0.4.1" } md-5 = { default-features = false, version = "0.10.6" } pretty_assertions = { default-features = false, version = "1.4.0", features = ["std"] } -serial_test = "2.0.0" +serial_test = "3.0.0" sha2 = { default-features = false, version = "0.10.8" } From c1930588799f07cc6632ccf49b4e70e44cc8d110 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 11:26:51 +0200 Subject: [PATCH 27/56] Bump proc-macro2 from 1.0.75 to 1.0.76 in /lang/rust (#2678) Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.75 to 1.0.76. - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.75...1.0.76) --- updated-dependencies: - dependency-name: proc-macro2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 4 ++-- lang/rust/avro_derive/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index 888fc8b6d88..a27fa29ad61 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -913,9 +913,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.75" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] diff --git a/lang/rust/avro_derive/Cargo.toml b/lang/rust/avro_derive/Cargo.toml index da8bd1edc3b..4631403ffe6 100644 --- a/lang/rust/avro_derive/Cargo.toml +++ b/lang/rust/avro_derive/Cargo.toml @@ -34,7 +34,7 @@ proc-macro = true [dependencies] darling = { default-features = false, version = "0.20.3" } -proc-macro2 = { default-features = false, version = "1.0.75" } +proc-macro2 = { default-features = false, version = "1.0.76" } quote = { default-features = false, version = "1.0.35" } serde_json = { workspace = true } syn = { default-features = false, version = "2.0.48", features = ["full", "fold"] } From c1d5b9725f738794d72f3d1635a0cd1524a4e7c4 Mon Sep 17 00:00:00 2001 From: ZENOTME <43447882+ZENOTME@users.noreply.github.com> Date: Thu, 11 Jan 2024 16:00:26 +0800 Subject: [PATCH 28/56] AVRO-3927: [Rust]support map and array schema (#2681) * support map and array schema * AVRO-3927: [Rust] Introduce factory methods for Map & Array schema The user facing API is shorter than using the From trait Signed-off-by: Martin Tzvetanov Grigorov --------- Signed-off-by: Martin Tzvetanov Grigorov Co-authored-by: ZENOTME Co-authored-by: Martin Tzvetanov Grigorov --- lang/rust/avro/src/decode.rs | 18 ++- lang/rust/avro/src/encode.rs | 18 +-- lang/rust/avro/src/reader.rs | 2 +- lang/rust/avro/src/schema.rs | 142 ++++++++++++++++----- lang/rust/avro/src/schema_compatibility.rs | 8 +- lang/rust/avro/src/types.rs | 16 ++- lang/rust/avro/src/writer.rs | 6 +- lang/rust/avro_derive/src/lib.rs | 2 +- 8 files changed, 146 insertions(+), 66 deletions(-) diff --git a/lang/rust/avro/src/decode.rs b/lang/rust/avro/src/decode.rs index bf8477fb70a..48a04f95a0b 100644 --- a/lang/rust/avro/src/decode.rs +++ b/lang/rust/avro/src/decode.rs @@ -196,7 +196,12 @@ pub(crate) fn decode_internal>( items.reserve(len); for _ in 0..len { - items.push(decode_internal(inner, names, enclosing_namespace, reader)?); + items.push(decode_internal( + &inner.items, + names, + enclosing_namespace, + reader, + )?); } } @@ -215,7 +220,8 @@ pub(crate) fn decode_internal>( for _ in 0..len { match decode_internal(&Schema::String, names, enclosing_namespace, reader)? { Value::String(key) => { - let value = decode_internal(inner, names, enclosing_namespace, reader)?; + let value = + decode_internal(&inner.types, names, enclosing_namespace, reader)?; items.insert(key, value); } value => return Err(Error::MapKeyType(value.into())), @@ -321,7 +327,7 @@ mod tests { #[test] fn test_decode_array_without_size() -> TestResult { let mut input: &[u8] = &[6, 2, 4, 6, 0]; - let result = decode(&Schema::Array(Box::new(Schema::Int)), &mut input); + let result = decode(&Schema::array(Schema::Int), &mut input); assert_eq!(Array(vec!(Int(1), Int(2), Int(3))), result?); Ok(()) @@ -330,7 +336,7 @@ mod tests { #[test] fn test_decode_array_with_size() -> TestResult { let mut input: &[u8] = &[5, 6, 2, 4, 6, 0]; - let result = decode(&Schema::Array(Box::new(Schema::Int)), &mut input); + let result = decode(&Schema::array(Schema::Int), &mut input); assert_eq!(Array(vec!(Int(1), Int(2), Int(3))), result?); Ok(()) @@ -339,7 +345,7 @@ mod tests { #[test] fn test_decode_map_without_size() -> TestResult { let mut input: &[u8] = &[0x02, 0x08, 0x74, 0x65, 0x73, 0x74, 0x02, 0x00]; - let result = decode(&Schema::Map(Box::new(Schema::Int)), &mut input); + let result = decode(&Schema::map(Schema::Int), &mut input); let mut expected = HashMap::new(); expected.insert(String::from("test"), Int(1)); assert_eq!(Map(expected), result?); @@ -350,7 +356,7 @@ mod tests { #[test] fn test_decode_map_with_size() -> TestResult { let mut input: &[u8] = &[0x01, 0x0C, 0x08, 0x74, 0x65, 0x73, 0x74, 0x02, 0x00]; - let result = decode(&Schema::Map(Box::new(Schema::Int)), &mut input); + let result = decode(&Schema::map(Schema::Int), &mut input); let mut expected = HashMap::new(); expected.insert(String::from("test"), Int(1)); assert_eq!(Map(expected), result?); diff --git a/lang/rust/avro/src/encode.rs b/lang/rust/avro/src/encode.rs index 23f94664c89..c99f80e27e3 100644 --- a/lang/rust/avro/src/encode.rs +++ b/lang/rust/avro/src/encode.rs @@ -187,7 +187,7 @@ pub(crate) fn encode_internal>( if !items.is_empty() { encode_long(items.len() as i64, buffer); for item in items.iter() { - encode_internal(item, inner, names, enclosing_namespace, buffer)?; + encode_internal(item, &inner.items, names, enclosing_namespace, buffer)?; } } buffer.push(0u8); @@ -205,7 +205,7 @@ pub(crate) fn encode_internal>( encode_long(items.len() as i64, buffer); for (key, value) in items { encode_bytes(key, buffer); - encode_internal(value, inner, names, enclosing_namespace, buffer)?; + encode_internal(value, &inner.types, names, enclosing_namespace, buffer)?; } } buffer.push(0u8); @@ -309,13 +309,10 @@ pub(crate) mod tests { let empty: Vec = Vec::new(); encode( &Value::Array(empty.clone()), - &Schema::Array(Box::new(Schema::Int)), + &Schema::array(Schema::Int), &mut buf, ) - .expect(&success( - &Value::Array(empty), - &Schema::Array(Box::new(Schema::Int)), - )); + .expect(&success(&Value::Array(empty), &Schema::array(Schema::Int))); assert_eq!(vec![0u8], buf); } @@ -325,13 +322,10 @@ pub(crate) mod tests { let empty: HashMap = HashMap::new(); encode( &Value::Map(empty.clone()), - &Schema::Map(Box::new(Schema::Int)), + &Schema::map(Schema::Int), &mut buf, ) - .expect(&success( - &Value::Map(empty), - &Schema::Map(Box::new(Schema::Int)), - )); + .expect(&success(&Value::Map(empty), &Schema::map(Schema::Int))); assert_eq!(vec![0u8], buf); } diff --git a/lang/rust/avro/src/reader.rs b/lang/rust/avro/src/reader.rs index 2ec0b84cb82..9b598315c8a 100644 --- a/lang/rust/avro/src/reader.rs +++ b/lang/rust/avro/src/reader.rs @@ -71,7 +71,7 @@ impl<'r, R: Read> Block<'r, R> { /// Try to read the header and to set the writer `Schema`, the `Codec` and the marker based on /// its content. fn read_header(&mut self) -> AvroResult<()> { - let meta_schema = Schema::Map(Box::new(Schema::Bytes)); + let meta_schema = Schema::map(Schema::Bytes); let mut buf = [0u8; 4]; self.reader diff --git a/lang/rust/avro/src/schema.rs b/lang/rust/avro/src/schema.rs index f4c063df60d..680a54a0208 100644 --- a/lang/rust/avro/src/schema.rs +++ b/lang/rust/avro/src/schema.rs @@ -111,11 +111,11 @@ pub enum Schema { String, /// A `array` Avro schema. Avro arrays are required to have the same type for each element. /// This variant holds the `Schema` for the array element type. - Array(Box), + Array(ArraySchema), /// A `map` Avro schema. /// `Map` holds a pointer to the `Schema` of its values, which must all be the same schema. /// `Map` keys are assumed to be `string`. - Map(Box), + Map(MapSchema), /// A `union` Avro schema. Union(UnionSchema), /// A `record` Avro schema. @@ -159,6 +159,18 @@ pub enum Schema { Ref { name: Name }, } +#[derive(Clone, Debug, PartialEq)] +pub struct MapSchema { + pub types: Box, + pub custom_attributes: BTreeMap, +} + +#[derive(Clone, Debug, PartialEq)] +pub struct ArraySchema { + pub items: Box, + pub custom_attributes: BTreeMap, +} + impl PartialEq for Schema { /// Assess equality of two `Schema` based on [Parsing Canonical Form]. /// @@ -495,8 +507,11 @@ impl<'s> ResolvedSchema<'s> { ) -> AvroResult<()> { for schema in schemata { match schema { - Schema::Array(schema) | Schema::Map(schema) => { - self.resolve(vec![schema], enclosing_namespace, known_schemata)? + Schema::Array(schema) => { + self.resolve(vec![&schema.items], enclosing_namespace, known_schemata)? + } + Schema::Map(schema) => { + self.resolve(vec![&schema.types], enclosing_namespace, known_schemata)? } Schema::Union(UnionSchema { schemas, .. }) => { for schema in schemas { @@ -581,9 +596,8 @@ impl ResolvedOwnedSchema { enclosing_namespace: &Namespace, ) -> AvroResult<()> { match schema { - Schema::Array(schema) | Schema::Map(schema) => { - Self::from_internal(schema, names, enclosing_namespace) - } + Schema::Array(schema) => Self::from_internal(&schema.items, names, enclosing_namespace), + Schema::Map(schema) => Self::from_internal(&schema.types, names, enclosing_namespace), Schema::Union(UnionSchema { schemas, .. }) => { for schema in schemas { Self::from_internal(schema, names, enclosing_namespace)? @@ -1160,6 +1174,41 @@ impl Schema { _ => None, } } + + /// Returns a Schema::Map with the given types. + pub fn map(types: Schema) -> Self { + Schema::Map(MapSchema { + types: Box::new(types), + custom_attributes: Default::default(), + }) + } + + /// Returns a Schema::Map with the given types and custom attributes. + pub fn map_with_attributes(types: Schema, custom_attributes: BTreeMap) -> Self { + Schema::Map(MapSchema { + types: Box::new(types), + custom_attributes, + }) + } + + /// Returns a Schema::Array with the given items. + pub fn array(items: Schema) -> Self { + Schema::Array(ArraySchema { + items: Box::new(items), + custom_attributes: Default::default(), + }) + } + + /// Returns a Schema::Array with the given items and custom attributes. + pub fn array_with_attributes( + items: Schema, + custom_attributes: BTreeMap, + ) -> Self { + Schema::Array(ArraySchema { + items: Box::new(items), + custom_attributes, + }) + } } impl Parser { @@ -1723,7 +1772,7 @@ impl Parser { .get("items") .ok_or(Error::GetArrayItemsField) .and_then(|items| self.parse(items, enclosing_namespace)) - .map(|schema| Schema::Array(Box::new(schema))) + .map(Schema::array) } /// Parse a `serde_json::Value` representing a Avro map type into a @@ -1737,7 +1786,7 @@ impl Parser { .get("values") .ok_or(Error::GetMapValuesField) .and_then(|items| self.parse(items, enclosing_namespace)) - .map(|schema| Schema::Map(Box::new(schema))) + .map(Schema::map) } /// Parse a `serde_json::Value` representing a Avro union type into a @@ -1847,15 +1896,21 @@ impl Serialize for Schema { Schema::Bytes => serializer.serialize_str("bytes"), Schema::String => serializer.serialize_str("string"), Schema::Array(ref inner) => { - let mut map = serializer.serialize_map(Some(2))?; + let mut map = serializer.serialize_map(Some(2 + inner.custom_attributes.len()))?; map.serialize_entry("type", "array")?; - map.serialize_entry("items", &*inner.clone())?; + map.serialize_entry("items", &*inner.items.clone())?; + for attr in &inner.custom_attributes { + map.serialize_entry(attr.0, attr.1)?; + } map.end() } Schema::Map(ref inner) => { - let mut map = serializer.serialize_map(Some(2))?; + let mut map = serializer.serialize_map(Some(2 + inner.custom_attributes.len()))?; map.serialize_entry("type", "map")?; - map.serialize_entry("values", &*inner.clone())?; + map.serialize_entry("values", &*inner.types.clone())?; + for attr in &inner.custom_attributes { + map.serialize_entry(attr.0, attr.1)?; + } map.end() } Schema::Union(ref inner) => { @@ -2270,10 +2325,7 @@ pub mod derive { named_schemas: &mut Names, enclosing_namespace: &Namespace, ) -> Schema { - Schema::Array(Box::new(T::get_schema_in_ctxt( - named_schemas, - enclosing_namespace, - ))) + Schema::array(T::get_schema_in_ctxt(named_schemas, enclosing_namespace)) } } @@ -2305,10 +2357,7 @@ pub mod derive { named_schemas: &mut Names, enclosing_namespace: &Namespace, ) -> Schema { - Schema::Map(Box::new(T::get_schema_in_ctxt( - named_schemas, - enclosing_namespace, - ))) + Schema::map(T::get_schema_in_ctxt(named_schemas, enclosing_namespace)) } } @@ -2320,10 +2369,7 @@ pub mod derive { named_schemas: &mut Names, enclosing_namespace: &Namespace, ) -> Schema { - Schema::Map(Box::new(T::get_schema_in_ctxt( - named_schemas, - enclosing_namespace, - ))) + Schema::map(T::get_schema_in_ctxt(named_schemas, enclosing_namespace)) } } @@ -2387,14 +2433,14 @@ mod tests { #[test] fn test_array_schema() -> TestResult { let schema = Schema::parse_str(r#"{"type": "array", "items": "string"}"#)?; - assert_eq!(Schema::Array(Box::new(Schema::String)), schema); + assert_eq!(Schema::array(Schema::String), schema); Ok(()) } #[test] fn test_map_schema() -> TestResult { let schema = Schema::parse_str(r#"{"type": "map", "values": "double"}"#)?; - assert_eq!(Schema::Map(Box::new(Schema::Double)), schema); + assert_eq!(Schema::map(Schema::Double), schema); Ok(()) } @@ -2748,9 +2794,9 @@ mod tests { doc: None, default: None, aliases: None, - schema: Schema::Array(Box::new(Schema::Ref { + schema: Schema::array(Schema::Ref { name: Name::new("Node")?, - })), + }), order: RecordFieldOrder::Ascending, position: 1, custom_attributes: Default::default(), @@ -4442,7 +4488,7 @@ mod tests { assert_eq!(union.schemas[0], Schema::Null); if let Schema::Array(ref array_schema) = union.schemas[1] { - if let Schema::Long = **array_schema { + if let Schema::Long = *array_schema.items { // OK } else { panic!("Expected a Schema::Array of type Long"); @@ -6529,4 +6575,40 @@ mod tests { Ok(()) } + + #[test] + fn test_avro_3927_serialize_array_with_custom_attributes() -> TestResult { + let expected = Schema::array_with_attributes( + Schema::Long, + BTreeMap::from([("field-id".to_string(), "1".into())]), + ); + + let value = serde_json::to_value(&expected)?; + let serialized = serde_json::to_string(&value)?; + assert_eq!( + r#"{"field-id":"1","items":"long","type":"array"}"#, + &serialized + ); + assert_eq!(expected, Schema::parse_str(&serialized)?); + + Ok(()) + } + + #[test] + fn test_avro_3927_serialize_map_with_custom_attributes() -> TestResult { + let expected = Schema::map_with_attributes( + Schema::Long, + BTreeMap::from([("field-id".to_string(), "1".into())]), + ); + + let value = serde_json::to_value(&expected)?; + let serialized = serde_json::to_string(&value)?; + assert_eq!( + r#"{"field-id":"1","type":"map","values":"long"}"#, + &serialized + ); + assert_eq!(expected, Schema::parse_str(&serialized)?); + + Ok(()) + } } diff --git a/lang/rust/avro/src/schema_compatibility.rs b/lang/rust/avro/src/schema_compatibility.rs index 107a30a3745..09c302036e2 100644 --- a/lang/rust/avro/src/schema_compatibility.rs +++ b/lang/rust/avro/src/schema_compatibility.rs @@ -71,7 +71,7 @@ impl Checker { SchemaKind::Map => { if let Schema::Map(w_m) = writers_schema { match readers_schema { - Schema::Map(r_m) => self.full_match_schemas(w_m, r_m), + Schema::Map(r_m) => self.full_match_schemas(&w_m.types, &r_m.types), _ => Err(CompatibilityError::WrongType { writer_schema_type: format!("{:#?}", writers_schema), reader_schema_type: format!("{:#?}", readers_schema), @@ -87,7 +87,7 @@ impl Checker { SchemaKind::Array => { if let Schema::Array(w_a) = writers_schema { match readers_schema { - Schema::Array(r_a) => self.full_match_schemas(w_a, r_a), + Schema::Array(r_a) => self.full_match_schemas(&w_a.items, &r_a.items), _ => Err(CompatibilityError::WrongType { writer_schema_type: format!("{:#?}", writers_schema), reader_schema_type: format!("{:#?}", readers_schema), @@ -370,7 +370,7 @@ impl SchemaCompatibility { SchemaKind::Map => { if let Schema::Map(w_m) = writers_schema { if let Schema::Map(r_m) = readers_schema { - return SchemaCompatibility::match_schemas(w_m, r_m); + return SchemaCompatibility::match_schemas(&w_m.types, &r_m.types); } else { return Err(CompatibilityError::TypeExpected { schema_type: String::from("readers_schema"), @@ -387,7 +387,7 @@ impl SchemaCompatibility { SchemaKind::Array => { if let Schema::Array(w_a) = writers_schema { if let Schema::Array(r_a) = readers_schema { - return SchemaCompatibility::match_schemas(w_a, r_a); + return SchemaCompatibility::match_schemas(&w_a.items, &r_a.items); } else { return Err(CompatibilityError::TypeExpected { schema_type: String::from("readers_schema"), diff --git a/lang/rust/avro/src/types.rs b/lang/rust/avro/src/types.rs index 97d6b7174f7..62752bbbacf 100644 --- a/lang/rust/avro/src/types.rs +++ b/lang/rust/avro/src/types.rs @@ -523,14 +523,14 @@ impl Value { (Value::Array(items), Schema::Array(inner)) => items.iter().fold(None, |acc, item| { Value::accumulate( acc, - item.validate_internal(inner, names, enclosing_namespace), + item.validate_internal(&inner.items, names, enclosing_namespace), ) }), (Value::Map(items), Schema::Map(inner)) => { items.iter().fold(None, |acc, (_, value)| { Value::accumulate( acc, - value.validate_internal(inner, names, enclosing_namespace), + value.validate_internal(&inner.types, names, enclosing_namespace), ) }) } @@ -681,8 +681,10 @@ impl Value { ref default, .. }) => self.resolve_enum(symbols, default, field_default), - Schema::Array(ref inner) => self.resolve_array(inner, names, enclosing_namespace), - Schema::Map(ref inner) => self.resolve_map(inner, names, enclosing_namespace), + Schema::Array(ref inner) => { + self.resolve_array(&inner.items, names, enclosing_namespace) + } + Schema::Map(ref inner) => self.resolve_map(&inner.types, names, enclosing_namespace), Schema::Record(RecordSchema { ref fields, .. }) => { self.resolve_record(fields, names, enclosing_namespace) } @@ -1265,15 +1267,15 @@ mod tests { ), ( Value::Array(vec![Value::Long(42i64)]), - Schema::Array(Box::new(Schema::Long)), + Schema::array(Schema::Long), true, "", ), ( Value::Array(vec![Value::Boolean(true)]), - Schema::Array(Box::new(Schema::Long)), + Schema::array(Schema::Long), false, - "Invalid value: Array([Boolean(true)]) for schema: Array(Long). Reason: Unsupported value-schema combination", + "Invalid value: Array([Boolean(true)]) for schema: Array(ArraySchema { items: Long, custom_attributes: {} }). Reason: Unsupported value-schema combination", ), (Value::Record(vec![]), Schema::Null, false, "Invalid value: Record([]) for schema: Null. Reason: Unsupported value-schema combination"), ( diff --git a/lang/rust/avro/src/writer.rs b/lang/rust/avro/src/writer.rs index b820885c6e3..446a4c0ef39 100644 --- a/lang/rust/avro/src/writer.rs +++ b/lang/rust/avro/src/writer.rs @@ -376,11 +376,7 @@ impl<'a, W: Write> Writer<'a, W> { let mut header = Vec::new(); header.extend_from_slice(AVRO_OBJECT_HEADER); - encode( - &metadata.into(), - &Schema::Map(Box::new(Schema::Bytes)), - &mut header, - )?; + encode(&metadata.into(), &Schema::map(Schema::Bytes), &mut header)?; header.extend_from_slice(&self.marker); Ok(header) diff --git a/lang/rust/avro_derive/src/lib.rs b/lang/rust/avro_derive/src/lib.rs index 5b36839be4e..bee080ace3f 100644 --- a/lang/rust/avro_derive/src/lib.rs +++ b/lang/rust/avro_derive/src/lib.rs @@ -267,7 +267,7 @@ fn type_to_schema_expr(ty: &Type) -> Result> { Ok(schema) } else if let Type::Array(ta) = ty { let inner_schema_expr = type_to_schema_expr(&ta.elem)?; - Ok(quote! {apache_avro::schema::Schema::Array(Box::new(#inner_schema_expr))}) + Ok(quote! {apache_avro::schema::Schema::array(#inner_schema_expr)}) } else if let Type::Reference(tr) = ty { type_to_schema_expr(&tr.elem) } else { From b9d8a6ba7b3a1e4c1a9d4fa0ce0cc10fcfe4a9b8 Mon Sep 17 00:00:00 2001 From: Martin Grigorov Date: Thu, 11 Jan 2024 14:49:30 +0200 Subject: [PATCH 29/56] AVRO-3928: [Rust] Convert serde_json::Value::Number to apache_avro::types::Value::Int when possible (#2682) * AVRO-3928: [Rust] Convert serde_json::Value::Number to apache_avro::types::Value::Int when possible If the number is bigger than i32::MIN and smaller than i32::MAX then convert to types::Value::Int, otherwise to types::Value::Long Signed-off-by: Martin Tzvetanov Grigorov * AVRO-3928: [Rust] Add more unit tests for types::Value::from(serde_json::Value) Signed-off-by: Martin Tzvetanov Grigorov --------- Signed-off-by: Martin Tzvetanov Grigorov --- lang/rust/avro/src/schema.rs | 30 ++++++++++++++++++++ lang/rust/avro/src/types.rs | 55 +++++++++++++++++++++++++++++++++++- 2 files changed, 84 insertions(+), 1 deletion(-) diff --git a/lang/rust/avro/src/schema.rs b/lang/rust/avro/src/schema.rs index 680a54a0208..a7c6223354c 100644 --- a/lang/rust/avro/src/schema.rs +++ b/lang/rust/avro/src/schema.rs @@ -6611,4 +6611,34 @@ mod tests { Ok(()) } + + #[test] + fn avro_3928_parse_int_based_schema_with_default() -> TestResult { + let schema = r#" + { + "type": "record", + "name": "DateLogicalType", + "fields": [ { + "name": "birthday", + "type": {"type": "int", "logicalType": "date"}, + "default": 1681601653 + } ] + }"#; + + match Schema::parse_str(schema)? { + Schema::Record(record_schema) => { + assert_eq!(record_schema.fields.len(), 1); + let field = record_schema.fields.first().unwrap(); + assert_eq!(field.name, "birthday"); + assert_eq!(field.schema, Schema::Date); + assert_eq!( + types::Value::from(field.default.clone().unwrap()), + types::Value::Int(1681601653) + ); + } + _ => unreachable!("Expected Schema::Record"), + } + + Ok(()) + } } diff --git a/lang/rust/avro/src/types.rs b/lang/rust/avro/src/types.rs index 62752bbbacf..97b99a81aca 100644 --- a/lang/rust/avro/src/types.rs +++ b/lang/rust/avro/src/types.rs @@ -281,7 +281,14 @@ impl From for Value { match value { JsonValue::Null => Self::Null, JsonValue::Bool(b) => b.into(), - JsonValue::Number(ref n) if n.is_i64() => Value::Long(n.as_i64().unwrap()), + JsonValue::Number(ref n) if n.is_i64() => { + let n = n.as_i64().unwrap(); + if n >= i32::MIN as i64 && n <= i32::MAX as i64 { + Value::Int(n as i32) + } else { + Value::Long(n) + } + } JsonValue::Number(ref n) if n.is_f64() => Value::Double(n.as_f64().unwrap()), JsonValue::Number(n) => Value::Long(n.as_u64().unwrap() as i64), // TODO: Not so great JsonValue::String(s) => s.into(), @@ -1154,6 +1161,7 @@ mod tests { }; use num_bigint::BigInt; use pretty_assertions::assert_eq; + use serde_json::json; use uuid::Uuid; #[test] @@ -3061,4 +3069,49 @@ Field with name '"b"' is not a member of the map items"#, Ok(()) } + + #[test] + fn avro_3928_from_serde_value_to_types_value() { + assert_eq!(Value::from(serde_json::Value::Null), Value::Null); + assert_eq!(Value::from(json!(true)), Value::Boolean(true)); + assert_eq!(Value::from(json!(false)), Value::Boolean(false)); + assert_eq!(Value::from(json!(0)), Value::Int(0)); + assert_eq!(Value::from(json!(i32::MIN)), Value::Int(i32::MIN)); + assert_eq!(Value::from(json!(i32::MAX)), Value::Int(i32::MAX)); + assert_eq!( + Value::from(json!(i32::MIN as i64 - 1)), + Value::Long(i32::MIN as i64 - 1) + ); + assert_eq!( + Value::from(json!(i32::MAX as i64 + 1)), + Value::Long(i32::MAX as i64 + 1) + ); + assert_eq!(Value::from(json!(1.23)), Value::Double(1.23)); + assert_eq!(Value::from(json!(-1.23)), Value::Double(-1.23)); + assert_eq!(Value::from(json!(u64::MIN)), Value::Int(u64::MIN as i32)); + assert_eq!(Value::from(json!(u64::MAX)), Value::Long(u64::MAX as i64)); + assert_eq!( + Value::from(json!("some text")), + Value::String("some text".into()) + ); + assert_eq!( + Value::from(json!(["text1", "text2", "text3"])), + Value::Array(vec![ + Value::String("text1".into()), + Value::String("text2".into()), + Value::String("text3".into()) + ]) + ); + assert_eq!( + Value::from(json!({"key1": "value1", "key2": "value2"})), + Value::Map( + vec![ + ("key1".into(), Value::String("value1".into())), + ("key2".into(), Value::String("value2".into())) + ] + .into_iter() + .collect() + ) + ); + } } From a9b06c161bd601f9e777925a2decf33f96dd4c5f Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 11 Jan 2024 15:44:29 +0200 Subject: [PATCH 30/56] NO-JIRA: [Rust] Add some badges to README.md Signed-off-by: Martin Tzvetanov Grigorov --- lang/rust/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lang/rust/README.md b/lang/rust/README.md index af3c70fa934..58d9afcba8f 100644 --- a/lang/rust/README.md +++ b/lang/rust/README.md @@ -21,6 +21,12 @@ Apache Avro Rust SDK +[![Current Crates.io Version](https://img.shields.io/crates/v/apache_avro.svg)](https://crates.io/crates/apache-avro) +[![Documentation](https://img.shields.io/badge/docs-latest-blue)](https://docs.rs/apache-avro/latest/apache_avro/) +[![CI](https://github.com/apache/avro/actions/workflows/test-lang-rust-ci.yml/badge.svg)](https://github.com/apache/avro/actions/workflows/test-lang-rust-ci.yml) +![Rust Version](https://img.shields.io/crates/msrv/apache_avro.svg?label=MSRV&color=red) +![license](https://shields.io/badge/license-Apache--2.0-blue) + # Subprojects ## Avro From 4a42c96000a1db2b0cea554d5616e435b9f37298 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jan 2024 22:20:02 +0200 Subject: [PATCH 31/56] Bump wasm-bindgen from 0.2.89 to 0.2.90 in /lang/rust (#2684) Bumps [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen) from 0.2.89 to 0.2.90. - [Release notes](https://github.com/rustwasm/wasm-bindgen/releases) - [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.89...0.2.90) --- updated-dependencies: - dependency-name: wasm-bindgen dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 20 ++++++++++---------- lang/rust/wasm-demo/Cargo.toml | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index a27fa29ad61..fe4197dc4a9 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -1317,9 +1317,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1327,9 +1327,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -1354,9 +1354,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1364,9 +1364,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -1377,9 +1377,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-bindgen-test" diff --git a/lang/rust/wasm-demo/Cargo.toml b/lang/rust/wasm-demo/Cargo.toml index 44327051cac..72199e6c617 100644 --- a/lang/rust/wasm-demo/Cargo.toml +++ b/lang/rust/wasm-demo/Cargo.toml @@ -37,7 +37,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] apache-avro = { path = "../avro" } serde = { default-features = false, version = "1.0.195", features = ["derive"] } -wasm-bindgen = "0.2.88" +wasm-bindgen = "0.2.90" [dev-dependencies] console_error_panic_hook = { version = "0.1.7" } From 7d93adc46005d8e85d37307d16de86bdc42c8624 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:30:08 +0200 Subject: [PATCH 32/56] Bump wasm-bindgen-test from 0.3.39 to 0.3.40 in /lang/rust (#2692) Bumps [wasm-bindgen-test](https://github.com/rustwasm/wasm-bindgen) from 0.3.39 to 0.3.40. - [Release notes](https://github.com/rustwasm/wasm-bindgen/releases) - [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustwasm/wasm-bindgen/commits) --- updated-dependencies: - dependency-name: wasm-bindgen-test dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 16 ++++++++-------- lang/rust/wasm-demo/Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index fe4197dc4a9..538e48f35f4 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -695,9 +695,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -1342,9 +1342,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -1383,9 +1383,9 @@ checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-bindgen-test" -version = "0.3.39" +version = "0.3.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf9242c0d27999b831eae4767b2a146feb0b27d332d553e605864acd2afd403" +checksum = "139bd73305d50e1c1c4333210c0db43d989395b64a237bd35c10ef3832a7f70c" dependencies = [ "console_error_panic_hook", "js-sys", @@ -1397,9 +1397,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.39" +version = "0.3.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794645f5408c9a039fd09f4d113cdfb2e7eba5ff1956b07bcf701cf4b394fe89" +checksum = "70072aebfe5da66d2716002c729a14e4aec4da0e23cc2ea66323dac541c93928" dependencies = [ "proc-macro2", "quote", diff --git a/lang/rust/wasm-demo/Cargo.toml b/lang/rust/wasm-demo/Cargo.toml index 72199e6c617..898df6c2b10 100644 --- a/lang/rust/wasm-demo/Cargo.toml +++ b/lang/rust/wasm-demo/Cargo.toml @@ -41,4 +41,4 @@ wasm-bindgen = "0.2.90" [dev-dependencies] console_error_panic_hook = { version = "0.1.7" } -wasm-bindgen-test = "0.3.38" +wasm-bindgen-test = "0.3.40" From c7c9e6c6c2ac10915d3b59934e3ba467a36e6d85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 11:03:07 +0200 Subject: [PATCH 33/56] Bump typed-builder from 0.18.0 to 0.18.1 in /lang/rust (#2693) Bumps [typed-builder](https://github.com/idanarye/rust-typed-builder) from 0.18.0 to 0.18.1. - [Changelog](https://github.com/idanarye/rust-typed-builder/blob/master/CHANGELOG.md) - [Commits](https://github.com/idanarye/rust-typed-builder/commits) --- updated-dependencies: - dependency-name: typed-builder dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 8 ++++---- lang/rust/avro/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index 538e48f35f4..e5b5ae23fc6 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -1248,18 +1248,18 @@ dependencies = [ [[package]] name = "typed-builder" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47c0496149861b7c95198088cbf36645016b1a0734cf350c50e2a38e070f38a" +checksum = "444d8748011b93cb168770e8092458cb0f8854f931ff82fdf6ddfbd72a9c933e" dependencies = [ "typed-builder-macro", ] [[package]] name = "typed-builder-macro" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982ee4197351b5c9782847ef5ec1fdcaf50503fb19d68f9771adae314e72b492" +checksum = "563b3b88238ec95680aef36bdece66896eaa7ce3c0f1b4f39d38fb2435261352" dependencies = [ "proc-macro2", "quote", diff --git a/lang/rust/avro/Cargo.toml b/lang/rust/avro/Cargo.toml index 9c1dc4edc49..20c078cd491 100644 --- a/lang/rust/avro/Cargo.toml +++ b/lang/rust/avro/Cargo.toml @@ -69,7 +69,7 @@ snap = { default-features = false, version = "1.1.0", optional = true } strum = { default-features = false, version = "0.25.0" } strum_macros = { default-features = false, version = "0.25.3" } thiserror = { default-features = false, version = "1.0.56" } -typed-builder = { default-features = false, version = "0.18.0" } +typed-builder = { default-features = false, version = "0.18.1" } uuid = { default-features = false, version = "1.6.1", features = ["serde", "std"] } xz2 = { default-features = false, version = "0.1.7", optional = true } zstd = { default-features = false, version = "0.13.0", optional = true } From dcd49e83770a94fb3df67101b3a0c76a52ca0e38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 11:03:54 +0200 Subject: [PATCH 34/56] Bump org.apache.rat:apache-rat-plugin from 0.15 to 0.16 in /lang/java (#2689) Bumps org.apache.rat:apache-rat-plugin from 0.15 to 0.16. --- updated-dependencies: - dependency-name: org.apache.rat:apache-rat-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f7a191b99b5..c8210ced697 100644 --- a/pom.xml +++ b/pom.xml @@ -47,7 +47,7 @@ build/avro-doc-${project.version}/api - 0.15 + 0.16 3.3.1 9.3 3.4.1 From 23c5d46d637b5510bc3d40e550f76ba97b892235 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 11:04:25 +0200 Subject: [PATCH 35/56] Bump org.apache.maven.plugins:maven-surefire-plugin in /lang/java (#2690) Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.3 to 3.2.5. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.3...surefire-3.2.5) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c8210ced697..765f187315d 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 3.3.0 3.5.2 2.27.2 - 3.2.3 + 3.2.5 10 From 57021e97f924bd473c20e9da8a06f953a6ac03f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 11:06:08 +0200 Subject: [PATCH 36/56] Bump com.google.protobuf:protobuf-java in /lang/java (#2687) Bumps [com.google.protobuf:protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.25.1 to 3.25.2. - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl) - [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.25.1...v3.25.2) --- updated-dependencies: - dependency-name: com.google.protobuf:protobuf-java dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/java/pom.xml b/lang/java/pom.xml index 7c89e542c71..62dac3b5c9d 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -51,7 +51,7 @@ 3.3.9 4.11.0 4.1.104.Final - 3.25.1 + 3.25.2 1.2.25 4.0.1 1.7.36 From 161a99d01370c05fd8dfc3a77dd350f5438dc83c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 11:08:54 +0200 Subject: [PATCH 37/56] Bump org.apache.commons:commons-compress in /lang/java (#2629) Bumps org.apache.commons:commons-compress from 1.24.0 to 1.25.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-compress dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/java/pom.xml b/lang/java/pom.xml index 62dac3b5c9d..29622f7a5e3 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -39,7 +39,7 @@ 1.10.14 1.5.0 - 1.24.0 + 1.25.0 1.10.0 1.59.0 3.3.5 From 6aef2bb407ec8373b3adc7a63405f4f52740bb16 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 11:09:49 +0200 Subject: [PATCH 38/56] Bump org.apache.hadoop:hadoop-client from 3.3.5 to 3.3.6 in /lang/java (#2616) Bumps org.apache.hadoop:hadoop-client from 3.3.5 to 3.3.6. --- updated-dependencies: - dependency-name: org.apache.hadoop:hadoop-client dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/java/pom.xml b/lang/java/pom.xml index 29622f7a5e3..e1aabc5e6da 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -42,7 +42,7 @@ 1.25.0 1.10.0 1.59.0 - 3.3.5 + 3.3.6 2.2 2.16.1 9.4.52.v20230823 From a713f4d8499cf2e93a4678a9ea8cc5088f4cba83 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 11:10:58 +0200 Subject: [PATCH 39/56] Bump org.codehaus.mojo:exec-maven-plugin in /lang/java (#2590) Bumps [org.codehaus.mojo:exec-maven-plugin](https://github.com/mojohaus/exec-maven-plugin) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/mojohaus/exec-maven-plugin/releases) - [Commits](https://github.com/mojohaus/exec-maven-plugin/compare/exec-maven-plugin-3.1.0...3.1.1) --- updated-dependencies: - dependency-name: org.codehaus.mojo:exec-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/java/pom.xml b/lang/java/pom.xml index e1aabc5e6da..5843fe67985 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -64,7 +64,7 @@ 3.2.1 5.1.9 2.7.9 - 3.1.0 + 3.1.1 3.1.0 3.0.3 7.0.13 From f64f4e714db6c3d7b54bf164e70eecafc0f5cde8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 12:08:27 +0200 Subject: [PATCH 40/56] Bump commons-cli:commons-cli from 1.5.0 to 1.6.0 in /lang/java (#2617) Bumps commons-cli:commons-cli from 1.5.0 to 1.6.0. --- updated-dependencies: - dependency-name: commons-cli:commons-cli dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/java/pom.xml b/lang/java/pom.xml index 5843fe67985..4c414805fb1 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -38,7 +38,7 @@ 1.10.14 - 1.5.0 + 1.6.0 1.25.0 1.10.0 1.59.0 From a0be40e12a222793426fa6d4270f39ea53ff5f81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 12:08:56 +0200 Subject: [PATCH 41/56] Bump org.cyclonedx:cyclonedx-maven-plugin in /lang/java (#2695) Bumps [org.cyclonedx:cyclonedx-maven-plugin](https://github.com/CycloneDX/cyclonedx-maven-plugin) from 2.7.9 to 2.7.11. - [Release notes](https://github.com/CycloneDX/cyclonedx-maven-plugin/releases) - [Commits](https://github.com/CycloneDX/cyclonedx-maven-plugin/compare/cyclonedx-maven-plugin-2.7.9...cyclonedx-maven-plugin-2.7.11) --- updated-dependencies: - dependency-name: org.cyclonedx:cyclonedx-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/java/pom.xml b/lang/java/pom.xml index 4c414805fb1..8e9bb9b6d67 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -63,7 +63,7 @@ 3.2.1 5.1.9 - 2.7.9 + 2.7.11 3.1.1 3.1.0 3.0.3 From 24052db090e73121ce08a54e0bc0eb72a8dc8af6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:30:11 +0200 Subject: [PATCH 42/56] Bump postcss-cli from 10.1.0 to 11.0.0 in /doc (#2612) Bumps [postcss-cli](https://github.com/postcss/postcss-cli) from 10.1.0 to 11.0.0. - [Release notes](https://github.com/postcss/postcss-cli/releases) - [Changelog](https://github.com/postcss/postcss-cli/blob/master/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss-cli/compare/10.1.0...11.0.0) --- updated-dependencies: - dependency-name: postcss-cli dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- doc/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/package.json b/doc/package.json index 421ff7971b5..02c3dc72247 100644 --- a/doc/package.json +++ b/doc/package.json @@ -2,6 +2,6 @@ "devDependencies": { "autoprefixer": "^10.4.0", "postcss": "^8.3.7", - "postcss-cli": "^10.0.0" + "postcss-cli": "^11.0.0" } } From be0d579a8eaba8498621c54e0288a924b51ab83e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:03:51 +0200 Subject: [PATCH 43/56] Bump jetty.version in /lang/java (#2552) Bumps `jetty.version` from 9.4.52.v20230823 to 9.4.53.v20231009. Updates `org.eclipse.jetty:jetty-server` from 9.4.52.v20230823 to 9.4.53.v20231009 - [Release notes](https://github.com/eclipse/jetty.project/releases) - [Commits](https://github.com/eclipse/jetty.project/compare/jetty-9.4.52.v20230823...jetty-9.4.53.v20231009) Updates `org.eclipse.jetty:jetty-servlet` from 9.4.52.v20230823 to 9.4.53.v20231009 - [Release notes](https://github.com/eclipse/jetty.project/releases) - [Commits](https://github.com/eclipse/jetty.project/compare/jetty-9.4.52.v20230823...jetty-9.4.53.v20231009) Updates `org.eclipse.jetty:jetty-util` from 9.4.52.v20230823 to 9.4.53.v20231009 - [Release notes](https://github.com/eclipse/jetty.project/releases) - [Commits](https://github.com/eclipse/jetty.project/compare/jetty-9.4.52.v20230823...jetty-9.4.53.v20231009) --- updated-dependencies: - dependency-name: org.eclipse.jetty:jetty-server dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.eclipse.jetty:jetty-servlet dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.eclipse.jetty:jetty-util dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/java/pom.xml b/lang/java/pom.xml index 8e9bb9b6d67..69a0153e9f1 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -45,7 +45,7 @@ 3.3.6 2.2 2.16.1 - 9.4.52.v20230823 + 9.4.53.v20231009 5.0.4 5.10.0 3.3.9 From ca8d9c2bb5b6ce46d11bd014056260bc7364a247 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:35:24 +0200 Subject: [PATCH 44/56] Bump junit5.version from 5.10.0 to 5.10.1 in /lang/java (#2576) Bumps `junit5.version` from 5.10.0 to 5.10.1. Updates `org.junit.vintage:junit-vintage-engine` from 5.10.0 to 5.10.1 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.0...r5.10.1) Updates `org.junit.jupiter:junit-jupiter` from 5.10.0 to 5.10.1 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.0...r5.10.1) --- updated-dependencies: - dependency-name: org.junit.vintage:junit-vintage-engine dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: org.junit.jupiter:junit-jupiter dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/java/pom.xml b/lang/java/pom.xml index 69a0153e9f1..cf5a41c7984 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -47,7 +47,7 @@ 2.16.1 9.4.53.v20231009 5.0.4 - 5.10.0 + 5.10.1 3.3.9 4.11.0 4.1.104.Final From db9667d9e1c76b52a79565f60c408b608e00c6b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:37:03 +0200 Subject: [PATCH 45/56] Bump org.apache.maven.plugins:maven-plugin-plugin in /lang/java (#2691) Bumps [org.apache.maven.plugins:maven-plugin-plugin](https://github.com/apache/maven-plugin-tools) from 3.10.2 to 3.11.0. - [Release notes](https://github.com/apache/maven-plugin-tools/releases) - [Commits](https://github.com/apache/maven-plugin-tools/compare/maven-plugin-tools-3.10.2...maven-plugin-tools-3.11.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-plugin-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 765f187315d..4b6f47f570f 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ 3.1.0 3.1.0 3.5.0 - 3.10.2 + 3.11.0 3.1.0 3.5.1 3.3.0 From 16c60f6a5b81de30c70a086ecb6af4a1e019d0de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:38:19 +0200 Subject: [PATCH 46/56] Bump grpc.version from 1.59.0 to 1.61.0 in /lang/java (#2686) Bumps `grpc.version` from 1.59.0 to 1.61.0. Updates `io.grpc:grpc-core` from 1.59.0 to 1.61.0 - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.59.0...v1.61.0) Updates `io.grpc:grpc-stub` from 1.59.0 to 1.61.0 - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.59.0...v1.61.0) Updates `io.grpc:grpc-netty` from 1.59.0 to 1.61.0 - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.59.0...v1.61.0) --- updated-dependencies: - dependency-name: io.grpc:grpc-core dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.grpc:grpc-stub dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.grpc:grpc-netty dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/java/pom.xml b/lang/java/pom.xml index cf5a41c7984..38a3f23558b 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -41,7 +41,7 @@ 1.6.0 1.25.0 1.10.0 - 1.59.0 + 1.61.0 3.3.6 2.2 2.16.1 From 2d108188353490ad79e6153080bf7f1f442420af Mon Sep 17 00:00:00 2001 From: Kousuke Saruta Date: Fri, 19 Jan 2024 16:21:31 +0900 Subject: [PATCH 47/56] AVRO-3880: [Java][Build] Upgrade maven-antrun-plugin to 3.1.0 (#2542) * AVRO-3880: [Java][Build] Upgrade maven-antrun-plugin to 3.1.0 * Apply spotless --------- Co-authored-by: Martin Grigorov --- lang/java/pom.xml | 6 ++ lang/java/protobuf/pom.xml | 4 +- .../avro/protobuf/multiplefiles/Foo.java | 43 ++++++++++-- .../apache/avro/protobuf/multiplefiles/M.java | 25 +++++++ .../org/apache/avro/protobuf/noopt/Test.java | 68 +++++++++++++++++-- 5 files changed, 132 insertions(+), 14 deletions(-) diff --git a/lang/java/pom.xml b/lang/java/pom.xml index 38a3f23558b..dc4c8546838 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -68,6 +68,7 @@ 3.1.0 3.0.3 7.0.13 + 3.1.0 @@ -435,6 +436,11 @@ + + org.apache.maven.plugins + maven-antrun-plugin + ${maven-antrun-plugin.version} + diff --git a/lang/java/protobuf/pom.xml b/lang/java/protobuf/pom.xml index 0a04f8f96c6..aa657b7a0ee 100644 --- a/lang/java/protobuf/pom.xml +++ b/lang/java/protobuf/pom.xml @@ -55,7 +55,7 @@ generate-test-sources - + @@ -65,7 +65,7 @@ - + run diff --git a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/Foo.java b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/Foo.java index 58401507178..b7289422987 100644 --- a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/Foo.java +++ b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/Foo.java @@ -59,12 +59,6 @@ private Foo(com.google.protobuf.CodedInputStream input, com.google.protobuf.Exte case 0: done = true; break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } case 8: { bitField0_ |= 0x00000001; int32_ = input.readInt32(); @@ -143,6 +137,7 @@ private Foo(com.google.protobuf.CodedInputStream input, com.google.protobuf.Exte } case 128: { int rawValue = input.readEnum(); + @SuppressWarnings("deprecation") org.apache.avro.protobuf.multiplefiles.A value = org.apache.avro.protobuf.multiplefiles.A.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(16, rawValue); @@ -188,6 +183,7 @@ private Foo(com.google.protobuf.CodedInputStream input, com.google.protobuf.Exte } case 152: { int rawValue = input.readEnum(); + @SuppressWarnings("deprecation") org.apache.avro.protobuf.multiplefiles.A value = org.apache.avro.protobuf.multiplefiles.A.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(19, rawValue); @@ -205,6 +201,7 @@ private Foo(com.google.protobuf.CodedInputStream input, com.google.protobuf.Exte int oldLimit = input.pushLimit(length); while (input.getBytesUntilLimit() > 0) { int rawValue = input.readEnum(); + @SuppressWarnings("deprecation") org.apache.avro.protobuf.multiplefiles.A value = org.apache.avro.protobuf.multiplefiles.A.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(19, rawValue); @@ -240,6 +237,12 @@ private Foo(com.google.protobuf.CodedInputStream input, com.google.protobuf.Exte bitField0_ |= 0x00020000; break; } + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -265,6 +268,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_Foo_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_Foo_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.multiplefiles.Foo.class, @@ -573,6 +577,7 @@ public boolean hasEnum() { * optional .org.apache.avro.protobuf.multiplefiles.A enum = 16 [default = Z]; */ public org.apache.avro.protobuf.multiplefiles.A getEnum() { + @SuppressWarnings("deprecation") org.apache.avro.protobuf.multiplefiles.A result = org.apache.avro.protobuf.multiplefiles.A.valueOf(enum_); return result == null ? org.apache.avro.protobuf.multiplefiles.A.Z : result; } @@ -655,6 +660,7 @@ public org.apache.avro.protobuf.multiplefiles.FooOrBuilder getFooArrayOrBuilder( private java.util.List syms_; private static final com.google.protobuf.Internal.ListAdapter.Converter syms_converter_ = new com.google.protobuf.Internal.ListAdapter.Converter() { public org.apache.avro.protobuf.multiplefiles.A convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") org.apache.avro.protobuf.multiplefiles.A result = org.apache.avro.protobuf.multiplefiles.A.valueOf(from); return result == null ? org.apache.avro.protobuf.multiplefiles.A.X : result; } @@ -756,6 +762,7 @@ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) @@ -783,6 +790,7 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, int32_); @@ -850,6 +858,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io unknownFields.writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) @@ -1185,6 +1194,7 @@ public static org.apache.avro.protobuf.multiplefiles.Foo parseFrom(com.google.pr return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } @@ -1197,6 +1207,7 @@ public static Builder newBuilder(org.apache.avro.protobuf.multiplefiles.Foo prot return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @@ -1217,6 +1228,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_Foo_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_Foo_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.multiplefiles.Foo.class, @@ -1241,6 +1253,7 @@ private void maybeForceBuilderInitialization() { } } + @java.lang.Override public Builder clear() { super.clear(); int32_ = 0; @@ -1300,14 +1313,17 @@ public Builder clear() { return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_Foo_descriptor; } + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.Foo getDefaultInstanceForType() { return org.apache.avro.protobuf.multiplefiles.Foo.getDefaultInstance(); } + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.Foo build() { org.apache.avro.protobuf.multiplefiles.Foo result = buildPartial(); if (!result.isInitialized()) { @@ -1316,6 +1332,7 @@ public org.apache.avro.protobuf.multiplefiles.Foo build() { return result; } + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.Foo buildPartial() { org.apache.avro.protobuf.multiplefiles.Foo result = new org.apache.avro.protobuf.multiplefiles.Foo(this); int from_bitField0_ = bitField0_; @@ -1424,31 +1441,38 @@ public org.apache.avro.protobuf.multiplefiles.Foo buildPartial() { return result; } + @java.lang.Override public Builder clone() { return (Builder) super.clone(); } + @java.lang.Override public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } + @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } + @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } + @java.lang.Override public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } + @java.lang.Override public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.apache.avro.protobuf.multiplefiles.Foo) { return mergeFrom((org.apache.avro.protobuf.multiplefiles.Foo) other); @@ -1567,6 +1591,7 @@ public Builder mergeFrom(org.apache.avro.protobuf.multiplefiles.Foo other) { return this; } + @java.lang.Override public final boolean isInitialized() { if (!hasInt32()) { return false; @@ -1584,6 +1609,7 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.avro.protobuf.multiplefiles.Foo parsedMessage = null; @@ -2214,6 +2240,7 @@ public boolean hasEnum() { * optional .org.apache.avro.protobuf.multiplefiles.A enum = 16 [default = Z]; */ public org.apache.avro.protobuf.multiplefiles.A getEnum() { + @SuppressWarnings("deprecation") org.apache.avro.protobuf.multiplefiles.A result = org.apache.avro.protobuf.multiplefiles.A.valueOf(enum_); return result == null ? org.apache.avro.protobuf.multiplefiles.A.Z : result; } @@ -2963,10 +2990,12 @@ private com.google.protobuf.SingleFieldBuilderV3 PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override public Foo parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -3002,6 +3032,7 @@ public com.google.protobuf.Parser getParserForType() { return PARSER; } + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.Foo getDefaultInstanceForType() { return DEFAULT_INSTANCE; } diff --git a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/M.java b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/M.java index 4f2ae42f053..13e41158039 100644 --- a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/M.java +++ b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/M.java @@ -65,6 +65,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_M_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_M_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.multiplefiles.M.class, @@ -148,6 +149,7 @@ private N(int value) { private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) @@ -159,10 +161,12 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { unknownFields.writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) @@ -264,6 +268,7 @@ public static org.apache.avro.protobuf.multiplefiles.M parseFrom(com.google.prot return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } @@ -276,6 +281,7 @@ public static Builder newBuilder(org.apache.avro.protobuf.multiplefiles.M protot return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @@ -300,6 +306,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_M_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_M_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.multiplefiles.M.class, @@ -321,19 +328,23 @@ private void maybeForceBuilderInitialization() { } } + @java.lang.Override public Builder clear() { super.clear(); return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_M_descriptor; } + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.M getDefaultInstanceForType() { return org.apache.avro.protobuf.multiplefiles.M.getDefaultInstance(); } + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.M build() { org.apache.avro.protobuf.multiplefiles.M result = buildPartial(); if (!result.isInitialized()) { @@ -342,37 +353,45 @@ public org.apache.avro.protobuf.multiplefiles.M build() { return result; } + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.M buildPartial() { org.apache.avro.protobuf.multiplefiles.M result = new org.apache.avro.protobuf.multiplefiles.M(this); onBuilt(); return result; } + @java.lang.Override public Builder clone() { return (Builder) super.clone(); } + @java.lang.Override public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } + @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } + @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } + @java.lang.Override public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } + @java.lang.Override public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.apache.avro.protobuf.multiplefiles.M) { return mergeFrom((org.apache.avro.protobuf.multiplefiles.M) other); @@ -390,10 +409,12 @@ public Builder mergeFrom(org.apache.avro.protobuf.multiplefiles.M other) { return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.avro.protobuf.multiplefiles.M parsedMessage = null; @@ -410,10 +431,12 @@ public Builder mergeFrom(com.google.protobuf.CodedInputStream input, return this; } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } + @java.lang.Override public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } @@ -433,6 +456,7 @@ public static org.apache.avro.protobuf.multiplefiles.M getDefaultInstance() { @java.lang.Deprecated public static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override public M parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -449,6 +473,7 @@ public com.google.protobuf.Parser getParserForType() { return PARSER; } + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.M getDefaultInstanceForType() { return DEFAULT_INSTANCE; } diff --git a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/Test.java b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/Test.java index 8255719d88e..3483a453ccd 100644 --- a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/Test.java +++ b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/Test.java @@ -468,12 +468,6 @@ private Foo(com.google.protobuf.CodedInputStream input, com.google.protobuf.Exte case 0: done = true; break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } case 8: { bitField0_ |= 0x00000001; int32_ = input.readInt32(); @@ -552,6 +546,7 @@ private Foo(com.google.protobuf.CodedInputStream input, com.google.protobuf.Exte } case 128: { int rawValue = input.readEnum(); + @SuppressWarnings("deprecation") org.apache.avro.protobuf.noopt.Test.A value = org.apache.avro.protobuf.noopt.Test.A.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(16, rawValue); @@ -597,6 +592,7 @@ private Foo(com.google.protobuf.CodedInputStream input, com.google.protobuf.Exte } case 152: { int rawValue = input.readEnum(); + @SuppressWarnings("deprecation") org.apache.avro.protobuf.noopt.Test.A value = org.apache.avro.protobuf.noopt.Test.A.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(19, rawValue); @@ -614,6 +610,7 @@ private Foo(com.google.protobuf.CodedInputStream input, com.google.protobuf.Exte int oldLimit = input.pushLimit(length); while (input.getBytesUntilLimit() > 0) { int rawValue = input.readEnum(); + @SuppressWarnings("deprecation") org.apache.avro.protobuf.noopt.Test.A value = org.apache.avro.protobuf.noopt.Test.A.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(19, rawValue); @@ -649,6 +646,12 @@ private Foo(com.google.protobuf.CodedInputStream input, com.google.protobuf.Exte bitField0_ |= 0x00020000; break; } + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -674,6 +677,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_Foo_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_Foo_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.Test.Foo.class, @@ -982,6 +986,7 @@ public boolean hasEnum() { * optional .org.apache.avro.protobuf.noopt.A enum = 16 [default = Z]; */ public org.apache.avro.protobuf.noopt.Test.A getEnum() { + @SuppressWarnings("deprecation") org.apache.avro.protobuf.noopt.Test.A result = org.apache.avro.protobuf.noopt.Test.A.valueOf(enum_); return result == null ? org.apache.avro.protobuf.noopt.Test.A.Z : result; } @@ -1064,6 +1069,7 @@ public org.apache.avro.protobuf.noopt.Test.FooOrBuilder getFooArrayOrBuilder(int private java.util.List syms_; private static final com.google.protobuf.Internal.ListAdapter.Converter syms_converter_ = new com.google.protobuf.Internal.ListAdapter.Converter() { public org.apache.avro.protobuf.noopt.Test.A convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") org.apache.avro.protobuf.noopt.Test.A result = org.apache.avro.protobuf.noopt.Test.A.valueOf(from); return result == null ? org.apache.avro.protobuf.noopt.Test.A.X : result; } @@ -1165,6 +1171,7 @@ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) @@ -1192,6 +1199,7 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, int32_); @@ -1259,6 +1267,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io unknownFields.writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) @@ -1594,6 +1603,7 @@ public static org.apache.avro.protobuf.noopt.Test.Foo parseFrom(com.google.proto return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } @@ -1606,6 +1616,7 @@ public static Builder newBuilder(org.apache.avro.protobuf.noopt.Test.Foo prototy return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @@ -1626,6 +1637,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_Foo_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_Foo_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.Test.Foo.class, @@ -1650,6 +1662,7 @@ private void maybeForceBuilderInitialization() { } } + @java.lang.Override public Builder clear() { super.clear(); int32_ = 0; @@ -1709,14 +1722,17 @@ public Builder clear() { return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_Foo_descriptor; } + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.Foo getDefaultInstanceForType() { return org.apache.avro.protobuf.noopt.Test.Foo.getDefaultInstance(); } + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.Foo build() { org.apache.avro.protobuf.noopt.Test.Foo result = buildPartial(); if (!result.isInitialized()) { @@ -1725,6 +1741,7 @@ public org.apache.avro.protobuf.noopt.Test.Foo build() { return result; } + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.Foo buildPartial() { org.apache.avro.protobuf.noopt.Test.Foo result = new org.apache.avro.protobuf.noopt.Test.Foo(this); int from_bitField0_ = bitField0_; @@ -1833,31 +1850,38 @@ public org.apache.avro.protobuf.noopt.Test.Foo buildPartial() { return result; } + @java.lang.Override public Builder clone() { return (Builder) super.clone(); } + @java.lang.Override public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } + @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } + @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } + @java.lang.Override public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } + @java.lang.Override public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.apache.avro.protobuf.noopt.Test.Foo) { return mergeFrom((org.apache.avro.protobuf.noopt.Test.Foo) other); @@ -1977,6 +2001,7 @@ public Builder mergeFrom(org.apache.avro.protobuf.noopt.Test.Foo other) { return this; } + @java.lang.Override public final boolean isInitialized() { if (!hasInt32()) { return false; @@ -1994,6 +2019,7 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.avro.protobuf.noopt.Test.Foo parsedMessage = null; @@ -2624,6 +2650,7 @@ public boolean hasEnum() { * optional .org.apache.avro.protobuf.noopt.A enum = 16 [default = Z]; */ public org.apache.avro.protobuf.noopt.Test.A getEnum() { + @SuppressWarnings("deprecation") org.apache.avro.protobuf.noopt.Test.A result = org.apache.avro.protobuf.noopt.Test.A.valueOf(enum_); return result == null ? org.apache.avro.protobuf.noopt.Test.A.Z : result; } @@ -3373,10 +3400,12 @@ private com.google.protobuf.SingleFieldBuilderV3 PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override public Foo parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -3412,6 +3442,7 @@ public com.google.protobuf.Parser getParserForType() { return PARSER; } + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.Foo getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -3485,6 +3516,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_M_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_M_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.Test.M.class, @@ -3568,6 +3600,7 @@ private N(int value) { private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) @@ -3579,10 +3612,12 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { unknownFields.writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) @@ -3684,6 +3719,7 @@ public static org.apache.avro.protobuf.noopt.Test.M parseFrom(com.google.protobu return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } @@ -3696,6 +3732,7 @@ public static Builder newBuilder(org.apache.avro.protobuf.noopt.Test.M prototype return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @@ -3720,6 +3757,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_M_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_M_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.Test.M.class, @@ -3741,19 +3779,23 @@ private void maybeForceBuilderInitialization() { } } + @java.lang.Override public Builder clear() { super.clear(); return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_M_descriptor; } + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.M getDefaultInstanceForType() { return org.apache.avro.protobuf.noopt.Test.M.getDefaultInstance(); } + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.M build() { org.apache.avro.protobuf.noopt.Test.M result = buildPartial(); if (!result.isInitialized()) { @@ -3762,37 +3804,45 @@ public org.apache.avro.protobuf.noopt.Test.M build() { return result; } + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.M buildPartial() { org.apache.avro.protobuf.noopt.Test.M result = new org.apache.avro.protobuf.noopt.Test.M(this); onBuilt(); return result; } + @java.lang.Override public Builder clone() { return (Builder) super.clone(); } + @java.lang.Override public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } + @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } + @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } + @java.lang.Override public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } + @java.lang.Override public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.apache.avro.protobuf.noopt.Test.M) { return mergeFrom((org.apache.avro.protobuf.noopt.Test.M) other); @@ -3810,10 +3860,12 @@ public Builder mergeFrom(org.apache.avro.protobuf.noopt.Test.M other) { return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.avro.protobuf.noopt.Test.M parsedMessage = null; @@ -3830,10 +3882,12 @@ public Builder mergeFrom(com.google.protobuf.CodedInputStream input, return this; } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } + @java.lang.Override public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } @@ -3853,6 +3907,7 @@ public static org.apache.avro.protobuf.noopt.Test.M getDefaultInstance() { @java.lang.Deprecated public static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override public M parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -3869,6 +3924,7 @@ public com.google.protobuf.Parser getParserForType() { return PARSER; } + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.M getDefaultInstanceForType() { return DEFAULT_INSTANCE; } From b7ea8c756d04710cd1cf92da9576673625888391 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jan 2024 09:24:10 +0200 Subject: [PATCH 48/56] Bump org.apache.maven.plugins:maven-javadoc-plugin in /lang/java (#2622) Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.5.0 to 3.6.3. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.5.0...maven-javadoc-plugin-3.6.3) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4b6f47f570f..5aa83620f88 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ 1.7.0 3.1.0 3.1.0 - 3.5.0 + 3.6.3 3.11.0 3.1.0 3.5.1 From 7a1ca0b8ada1f053f14837034a54f704035593bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jan 2024 09:24:37 +0200 Subject: [PATCH 49/56] Bump env_logger from 0.10.1 to 0.10.2 in /lang/rust (#2697) Bumps [env_logger](https://github.com/rust-cli/env_logger) from 0.10.1 to 0.10.2. - [Release notes](https://github.com/rust-cli/env_logger/releases) - [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-cli/env_logger/compare/v0.10.1...v0.10.2) --- updated-dependencies: - dependency-name: env_logger dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 4 ++-- lang/rust/avro_test_helper/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index e5b5ae23fc6..5cf893c69f8 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -475,9 +475,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "log", ] diff --git a/lang/rust/avro_test_helper/Cargo.toml b/lang/rust/avro_test_helper/Cargo.toml index a8159d17064..376dce33bc9 100644 --- a/lang/rust/avro_test_helper/Cargo.toml +++ b/lang/rust/avro_test_helper/Cargo.toml @@ -34,6 +34,6 @@ readme = "README.md" anyhow = { default-features = false, version = "1.0.79", features = ["std"] } better-panic = { default-features = false, version = "0.3.0" } ctor = { default-features = false, version = "0.2.6" } -env_logger = { default-features = false, version = "0.10.1" } +env_logger = { default-features = false, version = "0.10.2" } log = { workspace = true } ref_thread_local = { default-features = false, version = "0.1.1" } From 8d610fb5c7d3958256801848dbd80d6f9d3c556b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jan 2024 11:00:30 +0200 Subject: [PATCH 50/56] Bump org.apache.commons:commons-text from 1.10.0 to 1.11.0 in /lang/java (#2623) * Bump org.apache.commons:commons-text from 1.10.0 to 1.11.0 in /lang/java Bumps org.apache.commons:commons-text from 1.10.0 to 1.11.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-text dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Add dependency management for commons-lang3 commons-text:1.11.0 depends on new APIs introduced in commons-lang3:3.14.0 Signed-off-by: Martin Tzvetanov Grigorov --------- Signed-off-by: dependabot[bot] Signed-off-by: Martin Tzvetanov Grigorov Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Martin Tzvetanov Grigorov --- lang/java/idl/pom.xml | 5 +++++ lang/java/pom.xml | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lang/java/idl/pom.xml b/lang/java/idl/pom.xml index 7826cf42b89..38da8765126 100644 --- a/lang/java/idl/pom.xml +++ b/lang/java/idl/pom.xml @@ -126,6 +126,11 @@ commons-text ${commons-text.version} + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + com.fasterxml.jackson.core jackson-databind diff --git a/lang/java/pom.xml b/lang/java/pom.xml index dc4c8546838..b20e83fdf48 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -40,7 +40,8 @@ 1.10.14 1.6.0 1.25.0 - 1.10.0 + 1.11.0 + 3.14.0 1.61.0 3.3.6 2.2 @@ -614,6 +615,11 @@ zstd-jni ${zstd-jni.version} + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + From d36c4c4d67e6d8eaf535dc2c0d4edce567028ab1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:47:14 +0200 Subject: [PATCH 51/56] Bump uuid from 1.6.1 to 1.7.0 in /lang/rust (#2698) Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.6.1 to 1.7.0. - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](https://github.com/uuid-rs/uuid/compare/1.6.1...1.7.0) --- updated-dependencies: - dependency-name: uuid dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 4 ++-- lang/rust/avro/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index 5cf893c69f8..1e7e15f1661 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -1286,9 +1286,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "uuid" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ "serde", ] diff --git a/lang/rust/avro/Cargo.toml b/lang/rust/avro/Cargo.toml index 20c078cd491..c5e735ccdf8 100644 --- a/lang/rust/avro/Cargo.toml +++ b/lang/rust/avro/Cargo.toml @@ -70,7 +70,7 @@ strum = { default-features = false, version = "0.25.0" } strum_macros = { default-features = false, version = "0.25.3" } thiserror = { default-features = false, version = "1.0.56" } typed-builder = { default-features = false, version = "0.18.1" } -uuid = { default-features = false, version = "1.6.1", features = ["serde", "std"] } +uuid = { default-features = false, version = "1.7.0", features = ["serde", "std"] } xz2 = { default-features = false, version = "0.1.7", optional = true } zstd = { default-features = false, version = "0.13.0", optional = true } From 1112dcccb7a7538ef3990f535db8c07ac08174eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:47:48 +0200 Subject: [PATCH 52/56] Bump actions/dependency-review-action from 3 to 4 (#2701) Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 3 to 4. - [Release notes](https://github.com/actions/dependency-review-action/releases) - [Commits](https://github.com/actions/dependency-review-action/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/dependency-review-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test-lang-rust-audit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lang-rust-audit.yml b/.github/workflows/test-lang-rust-audit.yml index d530f8ce6ff..ca94041ad8b 100644 --- a/.github/workflows/test-lang-rust-audit.yml +++ b/.github/workflows/test-lang-rust-audit.yml @@ -49,7 +49,7 @@ jobs: uses: actions/checkout@v4 - name: Dependency Review if: github.event_name == 'pull_request' - uses: actions/dependency-review-action@v3 + uses: actions/dependency-review-action@v4 - name: Install Cargo Audit run: cargo install cargo-audit - name: Audit From caed6e088714efbb8d820c491882e60fe31f2fdf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:48:25 +0200 Subject: [PATCH 53/56] Bump actions/cache from 3 to 4 (#2700) Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/java-publish-snapshot.yml | 2 +- .github/workflows/maven4.yml | 4 ++-- .github/workflows/rat.yml | 2 +- .github/workflows/spotless.yml | 2 +- .github/workflows/test-lang-c.yml | 4 ++-- .github/workflows/test-lang-csharp.yml | 6 +++--- .github/workflows/test-lang-java.yml | 6 +++--- .github/workflows/test-lang-js.yml | 6 +++--- .github/workflows/test-lang-perl.yml | 2 +- .github/workflows/test-lang-php.yml | 4 ++-- .github/workflows/test-lang-py.yml | 2 +- .github/workflows/test-lang-ruby.yml | 8 ++++---- .github/workflows/test-lang-rust-ci.yml | 20 ++++++++++---------- 13 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/java-publish-snapshot.yml b/.github/workflows/java-publish-snapshot.yml index 58f4c30e54a..2e13aae3844 100644 --- a/.github/workflows/java-publish-snapshot.yml +++ b/.github/workflows/java-publish-snapshot.yml @@ -40,7 +40,7 @@ jobs: - uses: actions/checkout@v4 - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/maven4.yml b/.github/workflows/maven4.yml index 24440b0712b..8ebd7e93ae9 100644 --- a/.github/workflows/maven4.yml +++ b/.github/workflows/maven4.yml @@ -35,7 +35,7 @@ jobs: - uses: actions/checkout@v4 - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -43,7 +43,7 @@ jobs: ${{ runner.os }}-maven- - name: Cache Maven 4 Build Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/build-cache key: ${{ runner.os }}-maven-build-cache-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/rat.yml b/.github/workflows/rat.yml index dd0266f2c3c..fc061678dea 100644 --- a/.github/workflows/rat.yml +++ b/.github/workflows/rat.yml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v4 - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/spotless.yml b/.github/workflows/spotless.yml index 73bfa4dc201..5e8515cf5f9 100644 --- a/.github/workflows/spotless.yml +++ b/.github/workflows/spotless.yml @@ -35,7 +35,7 @@ jobs: - uses: actions/checkout@v4 - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/test-lang-c.yml b/.github/workflows/test-lang-c.yml index e130f663b0c..e236778b37c 100644 --- a/.github/workflows/test-lang-c.yml +++ b/.github/workflows/test-lang-c.yml @@ -48,7 +48,7 @@ jobs: run: ./build.sh test - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -87,7 +87,7 @@ jobs: libzstd-dev - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/test-lang-csharp.yml b/.github/workflows/test-lang-csharp.yml index 91ece116865..50f397beeb7 100644 --- a/.github/workflows/test-lang-csharp.yml +++ b/.github/workflows/test-lang-csharp.yml @@ -52,7 +52,7 @@ jobs: 7.0.x 8.0.x - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} @@ -85,7 +85,7 @@ jobs: 8.0.x - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -119,7 +119,7 @@ jobs: uses: actions/checkout@v4 - name: Cache Nuget - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} diff --git a/.github/workflows/test-lang-java.yml b/.github/workflows/test-lang-java.yml index 988aec57e3e..8393d439b37 100644 --- a/.github/workflows/test-lang-java.yml +++ b/.github/workflows/test-lang-java.yml @@ -49,7 +49,7 @@ jobs: - uses: actions/checkout@v4 - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -83,7 +83,7 @@ jobs: - uses: actions/checkout@v4 - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -164,7 +164,7 @@ jobs: java-version: 11 - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/test-lang-js.yml b/.github/workflows/test-lang-js.yml index 32b3a45ce21..acb96369a86 100644 --- a/.github/workflows/test-lang-js.yml +++ b/.github/workflows/test-lang-js.yml @@ -49,7 +49,7 @@ jobs: with: node-version: ${{ matrix.node }} - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} @@ -78,7 +78,7 @@ jobs: with: node-version: ${{ matrix.node }} - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} @@ -122,7 +122,7 @@ jobs: uses: actions/checkout@v4 - name: Cache Npm - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} diff --git a/.github/workflows/test-lang-perl.yml b/.github/workflows/test-lang-perl.yml index a4e3c59aa99..b746495117c 100644 --- a/.github/workflows/test-lang-perl.yml +++ b/.github/workflows/test-lang-perl.yml @@ -116,7 +116,7 @@ jobs: inc::Module::Install - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/test-lang-php.yml b/.github/workflows/test-lang-php.yml index ac207ef8711..2f62048614a 100644 --- a/.github/workflows/test-lang-php.yml +++ b/.github/workflows/test-lang-php.yml @@ -56,7 +56,7 @@ jobs: id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -89,7 +89,7 @@ jobs: tools: composer:2.2.5 - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/test-lang-py.yml b/.github/workflows/test-lang-py.yml index 9e26fa3e53b..f5f7ec4c422 100644 --- a/.github/workflows/test-lang-py.yml +++ b/.github/workflows/test-lang-py.yml @@ -120,7 +120,7 @@ jobs: python3 -m pip install python-snappy zstandard - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/test-lang-ruby.yml b/.github/workflows/test-lang-ruby.yml index 4c8f963dd45..216e2176846 100644 --- a/.github/workflows/test-lang-ruby.yml +++ b/.github/workflows/test-lang-ruby.yml @@ -54,7 +54,7 @@ jobs: - name: Install Dependencies run: sudo apt-get install -qqy libsnappy-dev - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: .gem key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} @@ -95,7 +95,7 @@ jobs: - name: Install Dependencies run: sudo apt-get install -qqy libsnappy-dev - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: .gem key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} @@ -106,7 +106,7 @@ jobs: run: bundle config path .gem - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -152,7 +152,7 @@ jobs: uses: actions/checkout@v4 - name: Cache gems - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: .gem key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} diff --git a/.github/workflows/test-lang-rust-ci.yml b/.github/workflows/test-lang-rust-ci.yml index d41c52308ab..52aa799cbb6 100644 --- a/.github/workflows/test-lang-rust-ci.yml +++ b/.github/workflows/test-lang-rust-ci.yml @@ -60,14 +60,14 @@ jobs: uses: actions/checkout@v4 - name: Cache Cargo - uses: actions/cache@v3 + uses: actions/cache@v4 with: # these represent dependencies downloaded by cargo # and thus do not depend on the OS, arch nor rust version. path: ~/.cargo key: ${{ runner.os }}-target-cache1-${{ hashFiles('**/Cargo.lock') }} - name: Cache Rust dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: # these represent compiled steps of both dependencies and avro # and thus are specific for a particular OS, arch and rust version. @@ -83,7 +83,7 @@ jobs: - name: Cache cargo-rdme if: matrix.rust == 'stable' && matrix.target == 'x86_64-unknown-linux-gnu' - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cargo-${{ matrix.rust }}/cargo-rdme key: cargo-rdme- @@ -130,14 +130,14 @@ jobs: toolchain: stable - name: Cache Cargo - uses: actions/cache@v3 + uses: actions/cache@v4 with: # these represent dependencies downloaded by cargo # and thus do not depend on the OS, arch nor rust version. path: ~/.cargo key: ${{ runner.os }}-target-cache1-${{ hashFiles('**/Cargo.lock') }} - name: Cache Rust dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: # these represent compiled steps of both dependencies and avro # and thus are specific for a particular OS, arch and rust version. @@ -145,7 +145,7 @@ jobs: key: ${{ runner.os }}-target-cache1-stable-${{ hashFiles('**/Cargo.lock') }} - name: Cache Local Maven Repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -215,7 +215,7 @@ jobs: targets: wasm32-unknown-unknown - name: Cache Cargo - uses: actions/cache@v3 + uses: actions/cache@v4 with: # these represent dependencies downloaded by cargo # and thus do not depend on the OS, arch nor rust version. @@ -223,7 +223,7 @@ jobs: key: ${{ runner.os }}-target-cache1-${{ hashFiles('**/Cargo.lock') }} - name: Cache Rust dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: # these represent compiled steps of both dependencies and avro # and thus are specific for a particular OS, arch and rust version. @@ -248,7 +248,7 @@ jobs: uses: actions/checkout@v4 - name: Cache Cargo - uses: actions/cache@v3 + uses: actions/cache@v4 with: # these represent dependencies downloaded by cargo # and thus do not depend on the OS, arch nor rust version. @@ -256,7 +256,7 @@ jobs: key: ${{ runner.os }}-target-arm64-${{ hashFiles('**/Cargo.lock') }} - name: Cache Rust dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: # these represent compiled steps of both dependencies and avro # and thus are specific for a particular OS, arch and rust version. From 664c4255dcb169c4d6cce9de927bbcf34417e50b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:54:03 +0200 Subject: [PATCH 54/56] Bump io.netty:netty-bom in /lang/java (#2702) Bumps [io.netty:netty-bom](https://github.com/netty/netty) from 4.1.104.Final to 4.1.106.Final. - [Commits](https://github.com/netty/netty/compare/netty-4.1.104.Final...netty-4.1.106.Final) --- updated-dependencies: - dependency-name: io.netty:netty-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/java/pom.xml b/lang/java/pom.xml index b20e83fdf48..ea052cb21ca 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -51,7 +51,7 @@ 5.10.1 3.3.9 4.11.0 - 4.1.104.Final + 4.1.106.Final 3.25.2 1.2.25 4.0.1 From 328136af454501f6cdb8f4b638edd084f295f9fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 20:14:43 +0200 Subject: [PATCH 55/56] Bump proc-macro2 from 1.0.76 to 1.0.78 in /lang/rust (#2704) Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.76 to 1.0.78. - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.76...1.0.78) --- updated-dependencies: - dependency-name: proc-macro2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lang/rust/Cargo.lock | 4 ++-- lang/rust/avro_derive/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index 1e7e15f1661..b2d6ab81213 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -913,9 +913,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] diff --git a/lang/rust/avro_derive/Cargo.toml b/lang/rust/avro_derive/Cargo.toml index 4631403ffe6..37bbbf8ff17 100644 --- a/lang/rust/avro_derive/Cargo.toml +++ b/lang/rust/avro_derive/Cargo.toml @@ -34,7 +34,7 @@ proc-macro = true [dependencies] darling = { default-features = false, version = "0.20.3" } -proc-macro2 = { default-features = false, version = "1.0.76" } +proc-macro2 = { default-features = false, version = "1.0.78" } quote = { default-features = false, version = "1.0.35" } serde_json = { workspace = true } syn = { default-features = false, version = "2.0.48", features = ["full", "fold"] } From 1a39f06f890eea6095f39cdeb7f81de4cd7929b4 Mon Sep 17 00:00:00 2001 From: Kent Yao Date: Wed, 24 Jan 2024 15:12:33 +0800 Subject: [PATCH 56/56] Fix Java doc typo in HadoopCodecFactory.java (#2705) NO-JIRA: Fix typo in HadoopCodecFactory's javadoc --- .../java/org/apache/avro/hadoop/file/HadoopCodecFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/HadoopCodecFactory.java b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/HadoopCodecFactory.java index 1cba5ad818b..1843a2e5c59 100644 --- a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/HadoopCodecFactory.java +++ b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/HadoopCodecFactory.java @@ -35,7 +35,7 @@ *
  • {@code org.apache.hadoop.io.compress.SnappyCodec} will map to * {@code snappy}
  • *
  • {@code org.apache.hadoop.io.compress.BZip2Codec} will map to - * {@code zbip2}
  • + * {@code bzip2} *
  • {@code org.apache.hadoop.io.compress.GZipCodec} will map to * {@code deflate}
  • * @@ -61,7 +61,7 @@ public class HadoopCodecFactory { *
  • {@code org.apache.hadoop.io.compress.SnappyCodec} will map to * {@code snappy}
  • *
  • {@code org.apache.hadoop.io.compress.BZip2Codec} will map to - * {@code zbip2}
  • + * {@code bzip2} *
  • {@code org.apache.hadoop.io.compress.GZipCodec} will map to * {@code deflate}
  • *