-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Source Postgres : Emit estimate trace messages for non-CDC mode (#20783)
* Emit estimate trace messages * Update PostgresQueryUtils.java * Remaining merge conflicts * Code cleanip * Address comments * Formatting * Cleanup * Addressing comments * Bump version + documentation * Update strict-encrypt Dockerfile * Unpublish * Merge conflicts * Update Dockerfile * auto-bump connector version Co-authored-by: Octavia Squidington III <[email protected]>
- Loading branch information
1 parent
5f29824
commit 63e4482
Showing
12 changed files
with
288 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...ce-postgres/src/main/java/io/airbyte/integrations/source/postgres/PostgresQueryUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.integrations.source.postgres; | ||
|
||
/** | ||
* Utility class to define constants related to querying postgres | ||
*/ | ||
public class PostgresQueryUtils { | ||
|
||
public static final String NULL_CURSOR_VALUE_WITH_SCHEMA_QUERY = | ||
""" | ||
SELECT | ||
(EXISTS (SELECT FROM information_schema.columns WHERE table_schema = '%s' AND table_name = '%s' AND is_nullable = 'YES' AND column_name = '%s')) | ||
AND | ||
(EXISTS (SELECT from \"%s\".\"%s\" where \"%s\" IS NULL LIMIT 1)) AS %s | ||
"""; | ||
public static final String NULL_CURSOR_VALUE_NO_SCHEMA_QUERY = | ||
""" | ||
SELECT | ||
(EXISTS (SELECT FROM information_schema.columns WHERE table_name = '%s' AND is_nullable = 'YES' AND column_name = '%s')) | ||
AND | ||
(EXISTS (SELECT from \"%s\" where \"%s\" IS NULL LIMIT 1)) AS %s | ||
"""; | ||
|
||
public static final String TABLE_ESTIMATE_QUERY = | ||
""" | ||
SELECT (SELECT COUNT(*) FROM %s) AS %s, | ||
pg_relation_size('%s') AS %s; | ||
"""; | ||
|
||
public static final String ROW_COUNT_RESULT_COL = "rowcount"; | ||
|
||
public static final String TOTAL_BYTES_RESULT_COL = "totalbytes"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.