dpcollins-google commented on a change in pull request #13773: URL: https://github.com/apache/beam/pull/13773#discussion_r560557647
########## File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubDlqProvider.java ########## @@ -0,0 +1,69 @@ +/* + * 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.beam.sdk.io.gcp.pubsub; + +import static java.nio.charset.StandardCharsets.UTF_8; + +import com.google.auto.service.AutoService; +import org.apache.beam.sdk.annotations.Internal; +import org.apache.beam.sdk.schemas.io.Failure; +import org.apache.beam.sdk.schemas.io.GenericDlqProvider; +import org.apache.beam.sdk.transforms.MapElements; +import org.apache.beam.sdk.transforms.PTransform; +import org.apache.beam.sdk.values.PCollection; +import org.apache.beam.sdk.values.PDone; +import org.apache.beam.sdk.values.TypeDescriptor; +import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap; + +@Internal +@AutoService(GenericDlqProvider.class) +public class PubsubDlqProvider implements GenericDlqProvider { + @Override + public String identifier() { + return "pubsub"; Review comment: This was intentional: If you imagine how this will appear to users in SQL below, I think "pubsub" is better than "pubsub_dlq". Thoughts? ``` CREATE EXTERNAL TABLE [ IF NOT EXISTS ] tableName( event_timestamp TIMESTAMP, attributes MAP<VARCHAR, VARCHAR>, payload ROW<tableElement [, tableElement ]*> ) TYPE pubsublite LOCATION 'projects/[PROJECT]/location/[ZONE]/topics/[TOPIC]' TBLPROPERTIES '{ // pubsub dlq "deadLetterQueue": "pubsub:projects/[PROJECT]/topics/[DLQ_TOPIC]", // pubsublite dlq "deadLetterQueue": "pubsublite:projects/[PROJECT]/locations/[ZONE]/topics/[DLQ_TOPIC]", // bigquery dlq "deadLetterQueue": "bigquery:[PROJECT]:[DATASET].[TABLE]", "format": "[FORMAT]" }' ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
