Skip to content

Commit

Permalink
InfluxDB FDW v1.0.0
Browse files Browse the repository at this point in the history
Support INSERT/DELETE features
Support add more functions to pushdown
Support LIMIT OFFSET clause pushdown
Support pushdown scalar operator ANY/ALL (ARRAY)
Refactored tests
  • Loading branch information
hrkuma committed May 26, 2021
1 parent a09d144 commit 444d86c
Show file tree
Hide file tree
Showing 139 changed files with 210,627 additions and 13,398 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.so
*.BAK
_cgo_*
_obj*
201 changes: 71 additions & 130 deletions Jenkinsfile

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ MODULE_big = influxdb_fdw
OBJS = option.o deparse.o influxdb_query.o influxdb_fdw.o query.a

EXTENSION = influxdb_fdw
DATA = influxdb_fdw--1.0.sql influxdb_fdw--1.1.sql
DATA = influxdb_fdw--1.0.sql influxdb_fdw--1.1.sql influxdb_fdw--1.2.sql

REGRESS = aggregate influxdb_fdw selectfunc extra/join extra/limit extra/aggregates extra/prepare extra/select_having extra/select extra/influxdb_fdw_post
REGRESS = aggregate influxdb_fdw selectfunc extra/join extra/limit extra/aggregates extra/insert extra/prepare extra/select_having extra/select extra/influxdb_fdw_post

UNAME = uname
OS := $(shell $(UNAME))
Expand Down Expand Up @@ -48,6 +48,15 @@ ifeq (,$(findstring $(MAJORVERSION), 9.6 10 11 12 13))
$(error PostgreSQL 9.6, 10, 11, 12 or 13 is required to compile this extension)
endif

ifdef REGRESS_PREFIX
REGRESS_PREFIX_SUB = $(REGRESS_PREFIX)
else
REGRESS_PREFIX_SUB = $(VERSION)
endif

REGRESS := $(addprefix $(REGRESS_PREFIX_SUB)/,$(REGRESS))
$(shell mkdir -p results/$(REGRESS_PREFIX_SUB)/extra)

query.a: query.go
go build -buildmode=c-archive query.go
$(OBJS): _obj/_cgo_export.h
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,31 @@ SELECT * FROM t1;

## Features

InfluxDB FDW supports pushed-down functions
- WHERE clauses including timestamp, interval and `now()` functions are pushed down
- Some of aggregation are pushed down such as `influx_time` and `last` functions. These functions does not work on PostgreSQL 9.
- InfluxDB FDW supports pushed down some aggregate functions: count, stddev, sum, max, min.
- InfluxDB FDW supports INSERT, DELETE statements.
- `time` and `time_text` column can used for INSERT, DELETE statements.
- `time` column can express timestamp with precision down to microseconds.
- `time_text` column can express timestamp with precision down to nanoseconds.
- WHERE clauses including timestamp, interval and `now()` functions are pushed down.
- LIMIT...OFFSET clauses are pushed down when there is LIMIT clause only or both LIMIT and OFFSET.<br>

## Limitations
- INSERT, UPDATE and DELETE are not supported.

- UPDATE is not supported.
- WITH CHECK OPTION constraints is not supported.
Following limitations originate from data model and query language of InfluxDB.
- Result sets have different number of rows depending on specified target list.
For example, `SELECT field1 FROM t1` and `SELECT field2 FROM t1` returns different number of rows if
the number of points with field1 and field2 are different in InfluxDB database.
- Timestamp precision may be lost because timestamp resolution of PostgreSQL is microseconds while that of InfluxDB is nanoseconds.
- Conditions like `WHERE time + interval '1 day' < now()` do not work. Please use `WHERE time < now() - interval '1 day'`.

When a query to foreign tables fails, you can find why it fails by seeing a query executed in InfluxDB with `EXPLAIN (VERBOSE)`.
When a query to foreign tables fails, you can find why it fails by seeing a query executed in InfluxDB with `EXPLAIN VERBOSE`.

## Contributing
Opening issues and pull requests on GitHub are welcome.

## License
Copyright (c) 2018 - 2020, TOSHIBA Corporation
Copyright (c) 2018 - 2021, TOSHIBA Corporation

Copyright (c) 2011 - 2016, EnterpriseDB Corporation

Expand Down
Loading

0 comments on commit 444d86c

Please sign in to comment.