Skip to main content

PostgreSQL Lookup

1、Introduce

PostgreSQL lookup,support all and lru cache
all cache:All data would be loaded into memory since the program start ,which is not recommended to use in scenarios with large amount of data .
lru cache:Query data asynchronously and add data to lru cache,which is recommended to use in scenarios with large amount of data.

2、Version Support

PostgreSql 9.4 and above

3、Connector name

SQLpostgresql-x

4、Parameter description

  • connector

    • Description:postgresql-x
    • Required:optional
    • Type:String
    • Default:none
  • url

    • Description:jdbc:postgresql://localhost:5432/test
    • Required:required
    • Type:String
    • Default:none
  • schema

    • Description:Database schema
    • Required:optional
    • Type:string
    • Default:none
  • table-name

    • Description:table name
    • Required:required
    • Type:String
    • Default:none
  • username

    • Description:username
    • Required:required
    • Type:String
    • Default:none
  • password

    • Description:password
    • Required:required
    • Type:String
    • Default:none
  • lookup.cache-type

    • Description:lookup table type (NONE、LRU、ALL),default value is LRU
    • Required:optional
    • Type:String
    • Default:LRU
  • lookup.cache-period

    • Description:Interval for loading data when the cache type is all,default value is 3600000ms
    • Required:optional
    • Type:string
    • Default:3600000
  • lookup.cache.max-rows

    • Description:the cache rows of lru lookup table ,default value is 10000
    • Required:optional
    • Type:string
    • Default:10000
  • lookup.cache.ttl

    • Description:Interval for loading data when the cache type is lru,default value is 60000ms
    • Required:optional
    • Type:string
    • Default:60000
  • lookup.fetch-size

    • Description:The number of records that ALL Lookup table loads from the database each time, the default is 1000
    • Required:optional
    • Type:string
    • Default:1000
  • lookup.parallelism

    • Description:the parallelism of the lookup table
    • Required:optional
    • Type:string
    • DEfault:none

5、Supported data type

Whether to supportData Type
SupportedSMALLINT、SMALLSERIAL、INT2、INT、INTEGER、SERIAL、INT4、BIGINT、BIGSERIAL、OID、INT8、REAL、FLOAT4、FLOAT、DOUBLE PRECISION、FLOAT8、DECIMAL、NUMERIC、 CHARACTER VARYING、VARCHAR、CHARACTER、CHAR、TEXT、NAME、BPCHAR、BYTEA、TIMESTAMP、TIMESTAMPTZ、DATE、TIME、TIMETZ、 BOOLEAN、BOOL
UnsupportedARRAY etc.

6. Example

The details are in flinkx-examples dir.