libenchao commented on code in PR #14376: URL: https://github.com/apache/flink/pull/14376#discussion_r922765580
########## flink-formats/flink-sql-protobuf/src/main/resources/META-INF/NOTICE: ########## @@ -0,0 +1,9 @@ +flink-sql-parquet Review Comment: flink-sql-protobuf ########## flink-formats/flink-protobuf/src/main/java/com/google/protobuf/ProtobufInternalUtils.java: ########## @@ -0,0 +1,14 @@ +package com.google.protobuf; Review Comment: add license ########## flink-formats/flink-protobuf/pom.xml: ########## @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +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 + + http://www.apache.org/licenses/LICENSE-2.0 + +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. +--> +<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> + + <parent> + <groupId>org.apache.flink</groupId> + <artifactId>flink-formats</artifactId> + <version>1.16-SNAPSHOT</version> + </parent> + + <artifactId>flink-protobuf</artifactId> + <name>Flink : Formats : Protobuf</name> + + <packaging>jar</packaging> + + <properties> + <!-- the same with flink-table/pom.xml --> + <janino.version>3.0.11</janino.version> + </properties> + + <dependencies> + <!-- core dependencies --> + + <dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-core</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-table-common</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>com.google.protobuf</groupId> + <artifactId>protobuf-java</artifactId> + <version>${protoc.version}</version> + </dependency> + + <dependency> + <groupId>org.codehaus.janino</groupId> + <artifactId>janino</artifactId> + <!-- this should be the same version of flink-table module --> + <version>${janino.version}</version> + <scope>provided</scope> + </dependency> + + <!-- test dependencies --> + <dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-table-planner_${scala.binary.version}</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-table-planner_${scala.binary.version}</artifactId> + <version>${project.version}</version> + <scope>test</scope> + <type>test-jar</type> + </dependency> + + <!-- test utils dependency --> + <dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-test-utils</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>com.github.os72</groupId> + <artifactId>protoc-jar-maven-plugin</artifactId> + <version>3.11.4</version> + <executions> + <execution> + <phase>generate-sources</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <protocVersion>${protoc.version}</protocVersion> + <inputDirectories> + <include>src/test/proto</include> + </inputDirectories> + <outputTargets> + <outputTarget> + <type>java</type> + <addSources>none</addSources> + <outputDirectory>target/test-proto-sources</outputDirectory> + </outputTarget> + </outputTargets> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>3.0.0</version> + <executions> + <execution> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>target/test-proto-sources</source> Review Comment: generated test classes still exist in the packaged jar. ########## flink-formats/flink-protobuf/src/main/java/com/google/protobuf/ProtobufInternalUtils.java: ########## @@ -0,0 +1,14 @@ +package com.google.protobuf; + +public class ProtobufInternalUtils { + /** + * convert under score name to camel name Review Comment: ```suggestion * convert underscore name to camel name ``` ########## flink-formats/flink-protobuf/src/main/java/com/google/protobuf/ProtobufInternalUtils.java: ########## @@ -0,0 +1,14 @@ +package com.google.protobuf; + +public class ProtobufInternalUtils { + /** + * convert under score name to camel name + * + * @param name + * @param capNext + * @return Review Comment: provide a description for each param, or remove them. ########## flink-formats/flink-protobuf/src/main/java/org/apache/flink/formats/protobuf/PbFormatOptions.java: ########## @@ -0,0 +1,55 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +package org.apache.flink.formats.protobuf; + +import org.apache.flink.configuration.ConfigOption; +import org.apache.flink.configuration.ConfigOptions; + +/** This class holds configuration constants used by protobuf format. */ +public class PbFormatOptions { + public static final ConfigOption<String> MESSAGE_CLASS_NAME = + ConfigOptions.key("message-class-name") + .stringType() + .noDefaultValue() + .withDescription( + "Required option to specify the full name of protobuf message class. The protobuf class " + + "must be located in the classpath both in client and task side"); + + public static final ConfigOption<Boolean> IGNORE_PARSE_ERRORS = + ConfigOptions.key("read-ignore-parse-errors") Review Comment: I would suggest to keep it as 'ignore-parse-errors', which is the same as 'flink-json' and 'flink-csv' -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
