Skip to content

Commit

Permalink
RELEASE v1.1.1 (#32)
Browse files Browse the repository at this point in the history
- Support PostgreSQL 14.0
  • Loading branch information
khieuvm authored Dec 21, 2021
1 parent 72e9943 commit 99dfcaf
Show file tree
Hide file tree
Showing 132 changed files with 407 additions and 140 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
InfluxDB Foreign Data Wrapper for PostgreSQL

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

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without a written agreement is
Expand Down
2 changes: 1 addition & 1 deletion 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) 2021, TOSHIBA CORPORATION
# Portions Copyright (c) 2018-2021, TOSHIBA CORPORATION
#
# IDENTIFICATION
# Makefile
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# InfluxDB Foreign Data Wrapper for PostgreSQL
This PostgreSQL extension is a Foreign Data Wrapper (FDW) for InfluxDB.
This PostgreSQL extension is a Foreign Data Wrapper (FDW) for InfluxDB (version 1.x series).

The current version can work with PostgreSQL 10, 11, 12, 13 and 14.

Expand Down Expand Up @@ -105,9 +105,8 @@ When a query to foreign tables fails, you can find why it fails by seeing a quer
Opening issues and pull requests on GitHub are welcome.

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

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

Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.

Expand Down
12 changes: 3 additions & 9 deletions deparse.c
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) 2021, TOSHIBA CORPORATION
* Portions Copyright (c) 2018-2021, TOSHIBA CORPORATION
*
* IDENTIFICATION
* deparse.c
Expand Down Expand Up @@ -645,13 +645,6 @@ influxdb_foreign_expr_walker(Node *node,
if (!(is_star_func || can_pushdown_func || is_cast_func))
return false;

#if PG_VERSION_NUM < 100000
if (strcmp(opername, "influx_time") == 0)
{
return false;
}
#endif

/* fill() must be inside influx_time() */
if (strcmp(opername, "influx_fill_numeric") == 0 ||
strcmp(opername, "influx_fill_option") == 0)
Expand Down Expand Up @@ -2556,14 +2549,15 @@ influxdb_deparse_func_expr(FuncExpr *node, deparse_expr_cxt *context)
return;
}

/*
/* -----
* Convert time() function for influx
* "influx_time(time, interval '2h')" => "time(2h)"
* "influx_time(time, interval '2h', interval '1h')" => to "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)"
* ------
*/
if (strcmp(proname, "influx_time") == 0)
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1128,14 +1128,14 @@ SELECT * FROM t5;
SELECT * FROM public.influxdb_fdw_version();
influxdb_fdw_version
----------------------
10100
10101
(1 row)

--Testcase 146:
SELECT influxdb_fdw_version();
influxdb_fdw_version
----------------------
10100
10101
(1 row)

--Test pushdown LIMIT...OFFSET
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1128,14 +1128,14 @@ SELECT * FROM t5;
SELECT * FROM public.influxdb_fdw_version();
influxdb_fdw_version
----------------------
10100
10101
(1 row)

--Testcase 146:
SELECT influxdb_fdw_version();
influxdb_fdw_version
----------------------
10100
10101
(1 row)

--Test pushdown LIMIT...OFFSET
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1128,14 +1128,14 @@ SELECT * FROM t5;
SELECT * FROM public.influxdb_fdw_version();
influxdb_fdw_version
----------------------
10100
10101
(1 row)

--Testcase 146:
SELECT influxdb_fdw_version();
influxdb_fdw_version
----------------------
10100
10101
(1 row)

--Test pushdown LIMIT...OFFSET
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1128,14 +1128,14 @@ SELECT * FROM t5;
SELECT * FROM public.influxdb_fdw_version();
influxdb_fdw_version
----------------------
10100
10101
(1 row)

--Testcase 146:
SELECT influxdb_fdw_version();
influxdb_fdw_version
----------------------
10100
10101
(1 row)

--Test pushdown LIMIT...OFFSET
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2193,6 +2193,42 @@ select aggfns(distinct a,b,c order by a,c using ~<~,b) filter (where a > 1)
(1 row)

rollback;
-- check handling of bare boolean Var in FILTER
--Testcase 454:
select max(0) filter (where b1) from bool_test;
max
-----
0
(1 row)

--Testcase 455:
select (select max(0) filter (where b1)) from bool_test;
max
-----
0
(1 row)

-- check for correct detection of nested-aggregate errors in FILTER
--Testcase 456:
select max(unique1) filter (where sum(ten) > 0) from tenk1;
ERROR: aggregate functions are not allowed in FILTER
LINE 1: select max(unique1) filter (where sum(ten) > 0) from tenk1;
^
--Testcase 457:
select (select max(unique1) filter (where sum(ten) > 0) from int8_tbl) from tenk1;
ERROR: aggregate function calls cannot be nested
LINE 1: select (select max(unique1) filter (where sum(ten) > 0) from...
^
--Testcase 458:
select max(unique1) filter (where bool_or(ten > 0)) from tenk1;
ERROR: aggregate functions are not allowed in FILTER
LINE 1: select max(unique1) filter (where bool_or(ten > 0)) from ten...
^
--Testcase 459:
select (select max(unique1) filter (where bool_or(ten > 0)) from int8_tbl) from tenk1;
ERROR: aggregate function calls cannot be nested
LINE 1: select (select max(unique1) filter (where bool_or(ten > 0)) ...
^
-- ordered-set aggregates
begin;
--Testcase 295:
Expand Down Expand Up @@ -3066,7 +3102,7 @@ select v||'a', case when v||'a' = 'aa' then 1 else 0 end, count(*)
-- does not lead to array overflow due to unexpected duplicate hash keys
-- see CAFeeJoKKu0u+A_A9R9316djW-YW3-+Gtgvy3ju655qRHR3jtdA@mail.gmail.com
--Testcase 399:
set enable_resultcache to off;
set enable_memoize to off;
--Testcase 400:
explain (costs off)
select 1 from tenk1
Expand All @@ -3083,7 +3119,7 @@ explain (costs off)
(7 rows)

--Testcase 401:
reset enable_resultcache;
reset enable_memoize;
--
-- Hash Aggregation Spill tests
--
Expand Down
Loading

0 comments on commit 99dfcaf

Please sign in to comment.