This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new f00a7a8e7b5 CAMEL-13573 : create parquet-avro dataformat f00a7a8e7b5 is described below commit f00a7a8e7b534e3b0f67091bb46e7604a642e825 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Wed May 31 14:48:48 2023 +0200 CAMEL-13573 : create parquet-avro dataformat --- .../apache/camel/catalog/dataformats.properties | 1 + .../camel/catalog/dataformats}/parquetAvro.json | 16 ++- .../apache/camel/catalog/models/parquetAvro.json | 1 + components/camel-parquet-avro/pom.xml | 156 +++++++++++---------- .../avro/ParquetAvroDataFormatConfigurer.java | 28 ++++ .../apache/camel/configurer/parquetAvro-dataformat | 2 + .../org/apache/camel/dataformat.properties | 4 +- .../dataformat/parquet/avro}/parquetAvro.json | 16 ++- .../parquet/avro/ParquetAvroDataFormat.java | 5 +- .../apache/camel/model/dataformat/parquetAvro.json | 1 + .../model/dataformat/ParquetAvroDataFormat.java | 3 + .../org/apache/camel/main/dataformats.properties | 1 + parent/pom.xml | 10 +- 13 files changed, 151 insertions(+), 93 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties index fe2d0ef4d53..9d7b2dc0cdc 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties @@ -25,6 +25,7 @@ jsonApi jsonb lzf mimeMultipart +parquetAvro pgp protobuf protobufJackson diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/parquetAvro.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/parquetAvro.json similarity index 60% copy from core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/parquetAvro.json copy to catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/parquetAvro.json index 9ddbb89eeae..31f864c81aa 100644 --- a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/parquetAvro.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/parquetAvro.json @@ -1,15 +1,19 @@ { - "model": { - "kind": "model", + "dataformat": { + "kind": "dataformat", "name": "parquetAvro", "title": "Parquet File", + "description": "Parquet Avro serialization and de-serialization.", "deprecated": false, "firstVersion": "4.0.0", "label": "dataformat,transformation,file", - "javaType": "org.apache.camel.model.dataformat.ParquetAvroDataFormat", - "abstract": false, - "input": false, - "output": false + "javaType": "org.apache.camel.dataformat.parquet.avro.ParquetAvroDataFormat", + "supportLevel": "Preview", + "groupId": "org.apache.camel", + "artifactId": "camel-parquet-avro", + "version": "4.0.0-SNAPSHOT", + "modelName": "parquetAvro", + "modelJavaType": "org.apache.camel.model.dataformat.ParquetAvroDataFormat" }, "properties": { "unmarshalType": { "index": 0, "kind": "attribute", "displayName": "Unmarshal Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class to use when unmarshalling." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/parquetAvro.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/parquetAvro.json index 9ddbb89eeae..b61d7563ce3 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/parquetAvro.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/parquetAvro.json @@ -3,6 +3,7 @@ "kind": "model", "name": "parquetAvro", "title": "Parquet File", + "description": "Parquet Avro serialization and de-serialization.", "deprecated": false, "firstVersion": "4.0.0", "label": "dataformat,transformation,file", diff --git a/components/camel-parquet-avro/pom.xml b/components/camel-parquet-avro/pom.xml index 1e0bb0e595c..3dffc2bb319 100644 --- a/components/camel-parquet-avro/pom.xml +++ b/components/camel-parquet-avro/pom.xml @@ -1,89 +1,99 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<!-- - <modelVersion>4.0.0</modelVersion> + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at - <parent> - <artifactId>components</artifactId> - <groupId>org.apache.camel</groupId> - <version>4.0.0-SNAPSHOT</version> - </parent> + http://www.apache.org/licenses/LICENSE-2.0 - <groupId>org.apache.camel.dataformat.parquet.avro</groupId> - <artifactId>camel-parquet-avro</artifactId> - <packaging>jar</packaging> - <version>4.0.0-SNAPSHOT</version> + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. - <name>Camel :: ParquetAvro</name> - <description>Camel ParquetAvro DataFormat</description> +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - </properties> + <parent> + <groupId>org.apache.camel</groupId> + <artifactId>components</artifactId> + <version>4.0.0-SNAPSHOT</version> + </parent> - <dependencies> + <artifactId>camel-parquet-avro</artifactId> + <packaging>jar</packaging> + <name>Camel :: Parquet Avro</name> + <description>Camel ParquetAvro DataFormat</description> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-support</artifactId> - </dependency> + <dependencies> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>${commons-io-version}</version> - </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-support</artifactId> + </dependency> - <dependency> - <groupId>org.apache.parquet</groupId> - <artifactId>parquet-common</artifactId> - <version>${parquet-common-version}</version> - </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>${commons-io-version}</version> + </dependency> - <dependency> - <groupId>org.apache.hadoop</groupId> - <artifactId>hadoop-client</artifactId> - <version>${hadoop3-version}</version> - <scope>provided</scope> - </dependency> + <dependency> + <groupId>org.apache.parquet</groupId> + <artifactId>parquet-common</artifactId> + <version>${parquet-common-version}</version> + </dependency> - <dependency> - <groupId>org.apache.parquet</groupId> - <artifactId>parquet-avro</artifactId> - <version>${parquet-avro-version}</version> - </dependency> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-client</artifactId> + <version>${hadoop3-version}</version> + <scope>provided</scope> + </dependency> - <!-- logging --> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-slf4j-impl</artifactId> - <version>${log4j2-version}</version> - <scope>test</scope> - </dependency> + <dependency> + <groupId>org.apache.parquet</groupId> + <artifactId>parquet-avro</artifactId> + <version>${parquet-avro-version}</version> + </dependency> - <!-- testing --> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-test-junit5</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-spring-xml</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-test-spring-junit5</artifactId> - <scope>test</scope> - </dependency> + <!-- logging --> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-slf4j-impl</artifactId> + <version>${log4j2-version}</version> + <scope>test</scope> + </dependency> - <dependency> - <groupId>jakarta.xml.bind</groupId> - <artifactId>jakarta.xml.bind-api</artifactId> - <version>${jakarta-xml-bind-api-version}</version> - <optional>true</optional> - </dependency> - </dependencies> + <!-- testing --> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-test-junit5</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-test-spring-junit5</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>jakarta.xml.bind</groupId> + <artifactId>jakarta.xml.bind-api</artifactId> + <version>${jakarta-xml-bind-api-version}</version> + <optional>true</optional> + </dependency> + </dependencies> </project> diff --git a/components/camel-parquet-avro/src/generated/java/org/apache/camel/dataformat/parquet/avro/ParquetAvroDataFormatConfigurer.java b/components/camel-parquet-avro/src/generated/java/org/apache/camel/dataformat/parquet/avro/ParquetAvroDataFormatConfigurer.java new file mode 100644 index 00000000000..fef4c7f83f3 --- /dev/null +++ b/components/camel-parquet-avro/src/generated/java/org/apache/camel/dataformat/parquet/avro/ParquetAvroDataFormatConfigurer.java @@ -0,0 +1,28 @@ +/* Generated by camel build tools - do NOT edit this file! */ +package org.apache.camel.dataformat.parquet.avro; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.camel.CamelContext; +import org.apache.camel.spi.GeneratedPropertyConfigurer; +import org.apache.camel.support.component.PropertyConfigurerSupport; + +/** + * Generated by camel build tools - do NOT edit this file! + */ +@SuppressWarnings("unchecked") +public class ParquetAvroDataFormatConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer { + + @Override + public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) { + ParquetAvroDataFormat dataformat = (ParquetAvroDataFormat) target; + switch (ignoreCase ? name.toLowerCase() : name) { + case "unmarshaltype": + case "unmarshalType": dataformat.setUnmarshalType(property(camelContext, java.lang.Class.class, value)); return true; + default: return false; + } + } + +} + diff --git a/components/camel-parquet-avro/src/generated/resources/META-INF/services/org/apache/camel/configurer/parquetAvro-dataformat b/components/camel-parquet-avro/src/generated/resources/META-INF/services/org/apache/camel/configurer/parquetAvro-dataformat new file mode 100644 index 00000000000..ffc8d3a1305 --- /dev/null +++ b/components/camel-parquet-avro/src/generated/resources/META-INF/services/org/apache/camel/configurer/parquetAvro-dataformat @@ -0,0 +1,2 @@ +# Generated by camel build tools - do NOT edit this file! +class=org.apache.camel.dataformat.parquet.avro.ParquetAvroDataFormatConfigurer diff --git a/components/camel-parquet-avro/src/generated/resources/META-INF/services/org/apache/camel/dataformat.properties b/components/camel-parquet-avro/src/generated/resources/META-INF/services/org/apache/camel/dataformat.properties index b7957ac1a85..f6f509e5b14 100644 --- a/components/camel-parquet-avro/src/generated/resources/META-INF/services/org/apache/camel/dataformat.properties +++ b/components/camel-parquet-avro/src/generated/resources/META-INF/services/org/apache/camel/dataformat.properties @@ -1,7 +1,7 @@ # Generated by camel build tools - do NOT edit this file! dataFormats=parquetAvro -groupId=org.apache.camel.dataformat.parquet.avro +groupId=org.apache.camel artifactId=camel-parquet-avro version=4.0.0-SNAPSHOT -projectName=Camel :: ParquetAvro +projectName=Camel :: Parquet Avro projectDescription=Camel ParquetAvro DataFormat diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/parquetAvro.json b/components/camel-parquet-avro/src/generated/resources/org/apache/camel/dataformat/parquet/avro/parquetAvro.json similarity index 60% copy from core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/parquetAvro.json copy to components/camel-parquet-avro/src/generated/resources/org/apache/camel/dataformat/parquet/avro/parquetAvro.json index 9ddbb89eeae..31f864c81aa 100644 --- a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/parquetAvro.json +++ b/components/camel-parquet-avro/src/generated/resources/org/apache/camel/dataformat/parquet/avro/parquetAvro.json @@ -1,15 +1,19 @@ { - "model": { - "kind": "model", + "dataformat": { + "kind": "dataformat", "name": "parquetAvro", "title": "Parquet File", + "description": "Parquet Avro serialization and de-serialization.", "deprecated": false, "firstVersion": "4.0.0", "label": "dataformat,transformation,file", - "javaType": "org.apache.camel.model.dataformat.ParquetAvroDataFormat", - "abstract": false, - "input": false, - "output": false + "javaType": "org.apache.camel.dataformat.parquet.avro.ParquetAvroDataFormat", + "supportLevel": "Preview", + "groupId": "org.apache.camel", + "artifactId": "camel-parquet-avro", + "version": "4.0.0-SNAPSHOT", + "modelName": "parquetAvro", + "modelJavaType": "org.apache.camel.model.dataformat.ParquetAvroDataFormat" }, "properties": { "unmarshalType": { "index": 0, "kind": "attribute", "displayName": "Unmarshal Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Class to use when unmarshalling." }, diff --git a/components/camel-parquet-avro/src/main/java/org/apache/camel/dataformat/parquet/avro/ParquetAvroDataFormat.java b/components/camel-parquet-avro/src/main/java/org/apache/camel/dataformat/parquet/avro/ParquetAvroDataFormat.java index ec5496bb62b..16792228dd6 100644 --- a/components/camel-parquet-avro/src/main/java/org/apache/camel/dataformat/parquet/avro/ParquetAvroDataFormat.java +++ b/components/camel-parquet-avro/src/main/java/org/apache/camel/dataformat/parquet/avro/ParquetAvroDataFormat.java @@ -47,7 +47,7 @@ public class ParquetAvroDataFormat extends ServiceSupport implements DataFormat, private Class<?> unmarshalType; public String getDataFormatName() { - return "parquet-avro"; + return "parquetAvro"; } public void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception { @@ -118,6 +118,9 @@ public class ParquetAvroDataFormat extends ServiceSupport implements DataFormat, return unmarshalType; } + /** + * Class to use when unmarshalling. + */ public void setUnmarshalType(Class<?> unmarshalType) { this.unmarshalType = unmarshalType; } diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/parquetAvro.json b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/parquetAvro.json index 9ddbb89eeae..b61d7563ce3 100644 --- a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/parquetAvro.json +++ b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/parquetAvro.json @@ -3,6 +3,7 @@ "kind": "model", "name": "parquetAvro", "title": "Parquet File", + "description": "Parquet Avro serialization and de-serialization.", "deprecated": false, "firstVersion": "4.0.0", "label": "dataformat,transformation,file", diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/ParquetAvroDataFormat.java b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/ParquetAvroDataFormat.java index ab784706d03..231def0d63c 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/ParquetAvroDataFormat.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/ParquetAvroDataFormat.java @@ -26,6 +26,9 @@ import org.apache.camel.builder.DataFormatBuilder; import org.apache.camel.model.DataFormatDefinition; import org.apache.camel.spi.Metadata; +/** + * Parquet Avro serialization and de-serialization. + */ @Metadata(firstVersion = "4.0.0", label = "dataformat,transformation,file", title = "Parquet File") @XmlRootElement(name = "parquetAvro") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties b/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties index fe2d0ef4d53..9d7b2dc0cdc 100644 --- a/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties +++ b/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties @@ -25,6 +25,7 @@ jsonApi jsonb lzf mimeMultipart +parquetAvro pgp protobuf protobufJackson diff --git a/parent/pom.xml b/parent/pom.xml index 8369be92079..93a88df3229 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -1902,6 +1902,11 @@ <artifactId>camel-paho-mqtt5</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-parquet-avro</artifactId> + <version>${project.version}</version> + </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-pdf</artifactId> @@ -2457,11 +2462,6 @@ <artifactId>dummy-component</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>org.apache.camel.dataformat.parquet.avro</groupId> - <artifactId>camel-parquet-avro</artifactId> - <version>${project.version}</version> - </dependency> <dependency> <groupId>org.apache.camel.maven</groupId> <artifactId>camel-debezium-maven-plugin</artifactId>