Skip to content

Commit

Permalink
RELEASE v1.1.0 (#31)
Browse files Browse the repository at this point in the history
- Support bulk insert for PostgreSQL 14
- Support GROUP By times(), fill() feature of InfluxDB
- Fix memory leaking

Co-authored-by: Nguyen Thi Van Anh <aanh>
  • Loading branch information
aanhh authored Nov 10, 2021
1 parent 440ceb0 commit 72e9943
Show file tree
Hide file tree
Showing 167 changed files with 76,300 additions and 73,906 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*.o
*.so
*.BAK
*.a
_cgo_*
_obj*
query.h
190 changes: 0 additions & 190 deletions Jenkinsfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
InfluxDB Foreign Data Wrapper for PostgreSQL

Copyright (c) 2018 - 2020, TOSHIBA Corporation
Copyright (c) 2018 - 2021, TOSHIBA Corporation
Copyright (c) 2011 - 2016, EnterpriseDB Corporation

Permission to use, copy, modify, and distribute this software and its
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# InfluxDB Foreign Data Wrapper for PostgreSQL
#
# Portions Copyright (c) 2020, TOSHIBA CORPORATION
# Portions Copyright (c) 2021, TOSHIBA CORPORATION
#
# IDENTIFICATION
# Makefile
Expand All @@ -13,15 +13,14 @@ 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 influxdb_fdw--1.2.sql
DATA = influxdb_fdw--1.0.sql influxdb_fdw--1.1.sql influxdb_fdw--1.1--1.2.sql influxdb_fdw--1.2.sql influxdb_fdw--1.3.sql

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))
ifeq ($(OS), Darwin)
DLSUFFIX = .dylib
PG_LDFLAGS = -framework CoreFoundation -framework Security
else
DLSUFFIX = .so
endif
Expand All @@ -44,8 +43,8 @@ MAJORVERSION := $(basename $(VERSION))
endif
endif

ifeq (,$(findstring $(MAJORVERSION), 9.6 10 11 12 13))
$(error PostgreSQL 9.6, 10, 11, 12 or 13 is required to compile this extension)
ifeq (,$(findstring $(MAJORVERSION), 10 11 12 13 14))
$(error PostgreSQL 10, 11, 12, 13 or 14 is required to compile this extension)
endif

ifdef REGRESS_PREFIX
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# InfluxDB Foreign Data Wrapper for PostgreSQL
This PostgreSQL extension is a Foreign Data Wrapper (FDW) for InfluxDB.

The current version can work with PostgreSQL 9.6, 10, 11, 12 and 13.
Currently this FDW supports InfluxDB 1.x series only.
The current version can work with PostgreSQL 10, 11, 12, 13 and 14.

Go version should be 1.10.4 or later.
## Installation
Expand Down Expand Up @@ -62,12 +61,31 @@ SELECT * FROM t1;
</pre>

## Features
### GROUP BY time intervals and fill()

Support GROUP BY times() fill() syntax for influxdb.
The fill() is supported by two stub function:
- influx_fill_numeric(): use with numeric parameter for example: 100, 100.1111
- influx_fill_option(): use with specified option such as: none, null, linear, previous.

The influx_fill_numeric() and influx_fill_option() is embeded as last parameter of time() function. The table below illustrates the usage:

| PostgreSQL syntax | Influxdb Syntax |
|-------------------|-----------------|
|influx_time(time, interval '2h')|time(2h)|
|influx_time(time, interval '2h', interval '1h')|time(2h, 1h)|
|influx_time(time, interval '2h', influx_fill_numeric(100))|time(2h) fill(100)|
|influx_time(time, interval '2h', influx_fill_option('linear'))|time(2h) fill(linear)|
|influx_time(time, interval '2h', interval '1h', influx_fill_numeric(100))|time(2h, 1h) fill(100)|
|influx_time(time, interval '2h', interval '1h', influx_fill_option('linear'))|time(2h,1h) fill(linear)|

### Others
- 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.
- InfluxDB FDW supports bulk INSERT by using batch_size option from PostgreSQL version 14 or later.
- 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>

Expand Down
Loading

0 comments on commit 72e9943

Please sign in to comment.