File tree Expand file tree Collapse file tree 5 files changed +45
-3
lines changed
cloudsql-postgresql-plugin/src
main/java/io/cdap/plugin/cloudsql/postgres
postgresql-plugin/src/e2e-test/resources Expand file tree Collapse file tree 5 files changed +45
-3
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,9 @@ Feature: CloudSQL-PostGreSQL Source - Run Time scenarios
147147 And Save and Deploy Pipeline
148148 And Run the Pipeline in Runtime
149149 And Wait till pipeline is in running state
150+ And Open and capture logs
150151 And Verify the pipeline status is "Failed"
152+ And Close the pipeline logs
151153 Then Open Pipeline logs and verify Log entries having below listed Level and Message:
152154 | Level | Message |
153155 | ERROR | errorLogsMessageInvalidBoundingQuery |
@@ -189,6 +191,7 @@ Feature: CloudSQL-PostGreSQL Source - Run Time scenarios
189191 Then Save the pipeline
190192 Then Preview and run the pipeline
191193 Then Wait till pipeline preview is in running state
194+ Then Open and capture pipeline preview logs
192195 Then Verify the preview run status of pipeline in the logs is "failed"
193196
194197 @CLOUDSQLPOSTGRESQL_SOURCE_TEST @CLOUDSQLPOSTGRESQL_TARGET_TEST
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright © 2024 Cask Data, Inc.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+ * use this file except in compliance with the License. You may obtain a copy of
6+ * the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+ * License for the specific language governing permissions and limitations under
14+ * the License.
15+ */
16+
17+ package io .cdap .plugin .cloudsql .postgres ;
18+
19+ import io .cdap .plugin .db .DBErrorDetailsProvider ;
20+
21+ /**
22+ * A custom ErrorDetailsProvider for CloudSQL PostgreSQL plugin.
23+ */
24+ public class CloudSQLPostgreSQLErrorDetailsProvider extends DBErrorDetailsProvider {
25+ @ Override
26+ protected String getExternalDocumentationLink () {
27+ return "https://www.postgresql.org/docs/current/errcodes-appendix.html" ;
28+ }
29+ }
Original file line number Diff line number Diff line change @@ -147,6 +147,11 @@ protected LineageRecorder getLineageRecorder(BatchSinkContext context) {
147147 return new LineageRecorder (context , assetBuilder .build ());
148148 }
149149
150+ @ Override
151+ protected String getErrorDetailsProviderClassName () {
152+ return CloudSQLPostgreSQLErrorDetailsProvider .class .getName ();
153+ }
154+
150155 /** CloudSQL PostgreSQL sink config. */
151156 public static class CloudSQLPostgreSQLSinkConfig extends AbstractDBSpecificSinkConfig {
152157
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ public CloudSQLPostgreSQLSource(CloudSQLPostgreSQLSourceConfig cloudsqlPostgresq
6060 super (cloudsqlPostgresqlSourceConfig );
6161 this .cloudsqlPostgresqlSourceConfig = cloudsqlPostgresqlSourceConfig ;
6262 }
63-
63+
6464 @ Override
6565 public void configurePipeline (PipelineConfigurer pipelineConfigurer ) {
6666 FailureCollector failureCollector = pipelineConfigurer .getStageConfigurer ().getFailureCollector ();
@@ -86,6 +86,11 @@ protected Class<? extends DBWritable> getDBRecordType() {
8686 return PostgresDBRecord .class ;
8787 }
8888
89+ @ Override
90+ protected String getErrorDetailsProviderClassName () {
91+ return CloudSQLPostgreSQLErrorDetailsProvider .class .getName ();
92+ }
93+
8994 @ Override
9095 protected String createConnectionString () {
9196 if (CloudSQLUtil .PRIVATE_INSTANCE .equalsIgnoreCase (
Original file line number Diff line number Diff line change @@ -8,12 +8,12 @@ errorMessageInvalidNumberOfSplits=Invalid value for Number of Splits '0'. Must b
88errorMessageNumberOfSplitNotNumber =Unable to create config for batchsource Postgres ' numSplits' is invalid: Value of \
99 field class io.cdap.plugin.db.config.AbstractDBSpecificSourceConfig.numSplits is expected to be a number.
1010errorMessageInvalidFetchSize =Invalid fetch size. Fetch size must be a positive integer.
11- errorMessageInvalidSourceDatabase =SQL error while getting query schema: FATAL: database " invalidDatabase" does not exist
11+ errorMessageInvalidSourceDatabase =SQL error while getting query schema: Error: FATAL: database " invalidDatabase" does not exist
1212errorMessageInvalidImportQuery =Import Query select must contain the string ' $CONDITIONS' . if Number of Splits is not set\
1313 \ to 1. Include ' $CONDITIONS' in the Import Query
1414errorMessageBlankUsername =Username is required when password is given.
1515errorMessageBlankPassword =SQL error while getting query schema: The server requested SCRAM-based authentication, but no password was provided.
16- errorMessageInvalidPassword =SQL error while getting query schema: FATAL: password authentication failed for user
16+ errorMessageInvalidPassword =SQL error while getting query schema: Error: FATAL: password authentication failed for user
1717errorMessageInvalidSourceHost =SQL error while getting query schema: The connection attempt failed.
1818errorMessageInvalidTableName =Table ' table' does not exist. Ensure table ' "table"' is set correctly and that the
1919errorMessageInvalidSinkDatabase =Exception while trying to validate schema of database table ' "targettable_
You can’t perform that action at this time.
0 commit comments