-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Allow access to Postgres partitioned tables #10403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ public class TestingPostgreSqlServer | |
| private static final String PASSWORD = "test"; | ||
| private static final String DATABASE = "tpch"; | ||
|
|
||
| private static final String LOG_PREFIX_REGEXP = "^([-:0-9. ]+UTC \\[[0-9]+\\] )"; | ||
| private static final String LOG_RUNNING_STATEMENT_PREFIX = "LOG: execute <unnamed>: "; | ||
| private static final String LOG_CANCELLATION_EVENT = "ERROR: canceling statement due to user request"; | ||
| private static final String LOG_CANCELLED_STATEMENT_PREFIX = "STATEMENT: "; | ||
|
|
@@ -50,7 +51,7 @@ public class TestingPostgreSqlServer | |
| public TestingPostgreSqlServer() | ||
| { | ||
| // Use the oldest supported PostgreSQL version | ||
| dockerContainer = new PostgreSQLContainer<>("postgres:9.6") | ||
| dockerContainer = new PostgreSQLContainer<>("postgres:10") | ||
| .withDatabaseName(DATABASE) | ||
| .withUsername(USER) | ||
| .withPassword(PASSWORD) | ||
|
|
@@ -82,13 +83,13 @@ protected List<RemoteDatabaseEvent> getRemoteDatabaseEvents() | |
| Iterator<String> logsIterator = logs.iterator(); | ||
| ImmutableList.Builder<RemoteDatabaseEvent> events = ImmutableList.builder(); | ||
| while (logsIterator.hasNext()) { | ||
| String logLine = logsIterator.next(); | ||
| String logLine = logsIterator.next().replaceAll(LOG_PREFIX_REGEXP, ""); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think timestamps are useful sometimes on CI - for example when a certain test appears slow or stuck.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree, and that's why they added to the log in Postgres 10+ |
||
| if (logLine.startsWith(LOG_RUNNING_STATEMENT_PREFIX)) { | ||
| events.add(new RemoteDatabaseEvent(logLine.substring(LOG_RUNNING_STATEMENT_PREFIX.length()), RUNNING)); | ||
| } | ||
| if (logLine.equals(LOG_CANCELLATION_EVENT)) { | ||
| // next line must be present | ||
| String cancelledStatementLogLine = logsIterator.next(); | ||
| String cancelledStatementLogLine = logsIterator.next().replaceAll(LOG_PREFIX_REGEXP, ""); | ||
| if (cancelledStatementLogLine.startsWith(LOG_CANCELLED_STATEMENT_PREFIX)) { | ||
| events.add(new RemoteDatabaseEvent(cancelledStatementLogLine.substring(LOG_CANCELLED_STATEMENT_PREFIX.length()), CANCELLED)); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #10400 (comment)