Skip to content
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

Polling - org.postgresql.util.PSQLException: ERROR: operator does not exist #71

Open
maron546 opened this issue Jan 15, 2021 · 0 comments

Comments

@maron546
Copy link

Description:
The polling mode fails with the following exception when using PostgreSQL database:

ERROR {io.siddhi.extension.io.cdc.source.polling.strategies.DefaultPollingStrategy} - Error occurred while processing records in table AM_APPLICATION. {mode=polling, app=xxx, stream=Applications} org.postgresql.util.PSQLException: ERROR: operator does not exist: timestamp without time zone > character varying
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 49
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2533)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2268)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:313)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:448)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:369)
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:159)
	at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:109)
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
	at io.siddhi.extension.io.cdc.source.polling.strategies.DefaultPollingStrategy.poll(DefaultPollingStrategy.java:98)
	at io.siddhi.extension.io.cdc.source.polling.CDCPoller.run(CDCPoller.java:187)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

The Siddhi application:

@source(type = 'cdc', mode = 'polling', url = 'jdbc:postgresql://xxx/xxx', jdbc.driver.name = 'org.postgresql.Driver', username = 'xxx', password = 'xxx', table.name = 'AM_APPLICATION', polling.column = 'UPDATED_TIME', polling.interval = '600', @map(type = 'keyvalue', fail.on.missing.attribute = 'false'))
define stream Applications(
  application_id int,
  name string,
  subscriber_id int,
  application_tier string,
  callback_url string,
  description string,
  application_status string,
  group_id string,
  created_by string,
  created_time string,
  updated_by string,
  updated_time string,
  uuid string,
  token_type string
);

It works fine with MySQL.

AM_APPLICATION DDL:

CREATE TABLE IF NOT EXISTS AM_APPLICATION (
    APPLICATION_ID INTEGER DEFAULT nextval('am_application_sequence'),
    NAME VARCHAR(100),
    SUBSCRIBER_ID INTEGER,
    APPLICATION_TIER VARCHAR(50) DEFAULT 'Unlimited',
    CALLBACK_URL VARCHAR(512),
    DESCRIPTION VARCHAR(512),
    APPLICATION_STATUS VARCHAR(50) DEFAULT 'APPROVED',
    GROUP_ID VARCHAR(100),
    CREATED_BY VARCHAR(100),
    CREATED_TIME TIMESTAMP,
    UPDATED_BY VARCHAR(100),
    UPDATED_TIME TIMESTAMP,
    UUID VARCHAR(256),
    TOKEN_TYPE VARCHAR(10),
    FOREIGN KEY(SUBSCRIBER_ID) REFERENCES AM_SUBSCRIBER(SUBSCRIBER_ID) ON UPDATE CASCADE ON DELETE RESTRICT,
    PRIMARY KEY(APPLICATION_ID),
    UNIQUE (NAME,SUBSCRIBER_ID),
    UNIQUE (UUID)
);

As a workaround, we tried to use the primary key APPLICATION_ID for the polling.column, but a similar exception on integer operator occurred.

Affected Product Version:
siddhi-io-cdc 2.0.5

OS, DB, other environment details and versions:
WSO2 API-M Analytics 3.1.0
PostgreSQL 9.5.16
postgresql-42.2.12.jar (JDBC library)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant