Commit Graph

7043 Commits (main)

Author SHA1 Message Date
Önder Kalacı 8232813066 Merge pull request #427 from citusdata/feature/dynamic_executor
Add router planner and dynamic executor selection
2016-04-21 15:33:34 +03:00
Murat Tuncer a88d3ecd4e Add dynamic executor selection
- non-router plannable queries can be executed
  by router executor if they satisfy the criteria
- router executor is removed from configuration,
  now task executor can not be set to router
- removed some tests that error out for router executor
2016-04-21 09:15:33 +03:00
Murat Tuncer 938546b938 Add router plannable check and router planning logic
for single shard select queries
2016-04-21 09:15:33 +03:00
Brian Cloutier 73bc20688c Merge pull request #399 from citusdata/count_distinct_pushdown
Add support for count(distinct) on hash partitioned tables
2016-04-20 05:13:48 -07:00
Brian Cloutier 7b1dc0d511 Support count(distinct) on hash partitioned tables
Also add test to ensure we get the same results when running
count(distinct) on range and hash partitioned tables.
2016-04-20 04:54:07 -07:00
Önder Kalacı 49b0c61f8d Merge pull request #459 from citusdata/fix_warning_in_logical_optimizer
FIX Complie Time Warning in multi_logical_optimizer.c
2016-04-20 12:59:34 +03:00
eren 53186b4e67 FIX Warning Message in multi_logical_optimizer.c
With #426, some new warning messages started to arise, because of
cross assignment of Node and Expr pointers. This change fixes the
warnings with type casts.
2016-04-20 11:33:29 +03:00
Jason Petersen 0ac9bf2bcb Merge pull request #426 from citusdata/bugfix/#375-prune-with-subquery-pushdown-varchar
Fix Shard Pruning Problem With Subqueries on VARCHAR Partition Columns

cr: @jasonmp85
2016-04-19 22:06:30 -06:00
eren 448527c3af
Fix JOINs on varchar columns with subquery pushdown
Fixes #379

Varchar VAR struct is wrapped in RELABELTYPE struct inside PostgreSQL code and
IsPartitionColumnRecursive function considers only VAR types so returning false
for varchar.

This change adds strip_implicit_coercions() call to the columnExpression in
IsPartitionColumnRecursive function so that we get rid of implicit coercions like
RELABELTYPE are stripped to VAR.
2016-04-19 21:55:50 -06:00
eren 399b5738b0
Fix Join Problem With VARCHAR Partition Columns
This change fixes the problem with joins with VARCHAR columns. Prior to
this change, when we tried to do large table joins on varchar columns, we got
an error of the form:
ERROR: cannot perform local joins that involve expressions
DETAIL: local joins can be performed between columns only.

This is because we have a check in CheckJoinBetweenColumns() which requires the
join clause to have only 'Var' nodes (i.e. columns). Postgres adds a relabel t
ype cast to cast the varchar to text; hence the type of the node is not T_Var
and the join fails.

The fix involves calling strip_implicit_coercions() to the left and right
arguments so that RELABELTYPE is stripped to VAR.

Fixes #76.
2016-04-19 21:55:50 -06:00
eren 1ffc30d7f5
Fix Shard Pruning Problem With Subqueries on VARCHAR Partition Columns
Fixes #375

Prior to this change, shard pruning couldn't be done if:
- Table is hash-distributed
- Partition column of is VARCHAR
- Query to be pruned is a subquery

There were two problems:
- A bug in left-side/right-side checks for the partition column
- We were not considering relabeled types (VARCHAR was relabeled as TEXT)
2016-04-19 21:55:50 -06:00
Metin Döşlü 339e1364d5 Merge pull request #445 from citusdata/feature/master-copy-for-append-partitioning
Add COPY support on master node for append partitioned relations

CR: @marcocitus
2016-04-19 22:08:02 +03:00
Metin Doslu 132a77f992 Add COPY support on master node for append partitioned relations 2016-04-19 21:57:59 +03:00
Jason Petersen 991f73c4f4 Merge pull request #450 from citusdata/unused-variables
Fix various unused variable warnings

cr: @jasonmp85
2016-04-19 12:44:38 -06:00
Andres Freund 39233c54ac
Remove wholly unused variable.
This avoids a -Wunused warning.
2016-04-19 12:31:13 -06:00
Andres Freund 29b8576a33
Annotate variables only used for asserts with PG_USED_FOR_ASSERTS_ONLY.
This avoids '-Wunused-but-set-variable' type warnings when compiling
without assertions, e.g. against a system postgres.
2016-04-19 12:31:12 -06:00
Jason Petersen cb7a397b0c Merge pull request #441 from citusdata/add_hash_op_comment
Add clarifying comment in HashableClauseMutator

cr: @marcocitus
2016-04-19 12:29:45 -06:00
Jason Petersen 30fdb59a80
Add clarifying comment in HashableClauseMutator
While reading this code last week, it appeared as though there was no
place we ensured that the partition clause actually used equality ops.
As such, I was worried that we might transform a clause such as id < 5
into a constraint like hash(id) = hash(5) when doing shard pruning. The
relevant code seemed to just ensure:

  1. The node is an OpExpr
  2. With a related hash function
  3. It compares the partition column
  4. Against a constant

A superficial reading implied we didn't actually make sure the original
op was equality-related, but it turns out the hash lookup function DOES
ensure that for us. So I added a comment.
2016-04-19 12:21:11 -06:00
Murat Tuncer 0b35c47932 Merge pull request #410 from citusdata/350-error-during-duplicate-index-creation
Error out earlier when creating an index with a name collision.
2016-04-19 07:26:31 +03:00
Brian Cloutier 1df4b8ba32 Better error on "CREATE INDEX already_exists ..."
Previously (if you're creating the index with the same name on different
tables) we successfully ran the command on the workers before failing it
on the master and leaving no record of the index.

Now we check whether the index exists on the master before sending
commands to the workers.

--

Also make the error better when user attampts to create an index without
a name. Previously those statements returned:

brian=# create index on c (b);
WARNING:  could not receive query results from localhost:9700
DETAIL:  Client error: cannot extend name for null index name
ERROR:  could not execute DDL command on worker node shards

They now return

brian=# create index on c (b);
ERROR:  creating index without a name on a distributed table is
currently unsupported
2016-04-18 13:33:53 -07:00
Jason Petersen 86bc73ef8a Merge pull request #423 from citusdata/422-incorrect-node-port-type
Treat nodePort as the 64bit integer it is.

cr: @anarazel
2016-04-15 12:42:11 -06:00
Jason Petersen c0b6505720 Merge branch 'master' into 422-incorrect-node-port-type 2016-04-15 12:30:50 -06:00
Jason Petersen 1a370cd1ba Merge pull request #451 from citusdata/fix_int64const_use
Fix use of INT64CONST macro

cr: @anarazel
2016-04-15 12:30:24 -06:00
Brian Cloutier 35bbc1dbfd Treat nodePort as the 64bit integer it is 2016-04-15 11:29:36 -07:00
Jason Petersen fb4f84207c
Fix use of INT64CONST macro
This macro is intended to receive a bare integer literal (no suffix).
It adds a suffix as necessary, depending upon available features. On
e.g. 32-bit platforms, the existing code failed to compile because a
suffix was added to the existing suffix. This fixes that problem.
2016-04-15 12:13:56 -06:00
Andres Freund 6860327cf9 Merge pull request #449 from citusdata/freebsd-fixes
Freebsd fixes #2 

Fixes #407 #411
2016-04-15 09:56:11 -07:00
Matthew Seaman b1a3801e58 Regularize include paths for some postgresql headers.
Addresses #411
2016-04-15 09:37:22 -07:00
Matthew Seaman 897a1126e7 Include appropriate headers for htons() and htonl(). 2016-04-15 09:37:08 -07:00
Matthew Seaman 55e81ce23d Add sys/stat.h include to files using S_IRUSR and S_IWUSR macros. 2016-04-15 09:34:22 -07:00
Ahmet Eren Basak 1f445e1e0b Merge pull request #436 from citusdata/clarify_shared_preload_libraries_message
Clarify Error Message Related to shared_preload_libraries
2016-04-13 14:14:53 +03:00
eren 3c8f275aa9 Clarify Error Message Related to shared_preload_libraries
Fixes #363

This change modifies the error message given when Citus is attempted
to be loaded other than shared_preload_libraries. Explanations have been
extended with that shared_preload_parameters parameter is in
postgresql.conf and citus should be at the beginning.
2016-04-13 12:12:21 +03:00
Ahmet Eren Basak a3b1b8944d Merge pull request #432 from citusdata/bugfix/#374-select-without-target-crash
Fix SELECT problem with no target list
2016-04-13 11:43:20 +03:00
eren 64aefed46f Fix SELECT problem with no target list
Prior to this change, performing a SELECT query without a target
list caused backend to crash.

Sample Query: SELECT FROM github_events; (without any * before FROM)

PostgreSQL:
```
--
(39599 rows)
```
Citus:
```
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!>
```

The problem was an unnecessary Assert on column list in
SetRangeTblExtraData(citus_nodefuncs.c)
2016-04-13 11:08:14 +03:00
Marco Slot 174aa64f14 Merge pull request #416 from citusdata/feature/copy-for-hash-partitioning
Add COPY support for hash- and range-partitioned tables
2016-04-12 20:44:06 +02:00
Metin Doslu 1150ce6414 Send COPY rows in binary format 2016-04-12 20:22:31 +02:00
Marco Slot d25ee8fbd8 Support for COPY FROM, based on pg_shard PR by Postres Pro 2016-04-12 20:22:31 +02:00
Joe Nelson 59216d32d4 Merge pull request #433 from citusdata/readable-contact
List contact options more clearly
2016-04-07 15:32:00 -07:00
Joe Nelson 951cedcd04 Adjusted badges 2016-04-07 14:04:19 -07:00
Joe Nelson e1e819e71c Add another link to the mailing list earlier in the page 2016-04-06 15:32:07 -07:00
Joe Nelson 9d245c3ad8 List contact options more clearly 2016-04-05 12:01:58 -07:00
Joe Nelson 73c41210c5 Merge pull request #421 from citusdata/ocd-identation
Proper indentation for code blocks in lists
2016-03-30 15:52:34 -07:00
Joe Nelson cd60c89421 Proper indentation for code blocks in lists 2016-03-30 15:40:53 -07:00
Joe Nelson f4316263a9 Merge pull request #420 from citusdata/readme-mailinglist
Add link to our mailing list
2016-03-30 14:20:21 -07:00
Joe Nelson 02b675b93c Add link to our mailing list 2016-03-30 14:13:59 -07:00
Joe Nelson 82ef6266dd Merge pull request #404 from citusdata/linux-build-howto
Linux build howto
2016-03-30 13:41:34 -07:00
Joe Nelson 80178b42bd Linux build instructions 2016-03-30 13:10:41 -07:00
Önder Kalacı 52eacd29bb Merge pull request #388 from citusdata/bugfix/unsupport_clause
Allow all types of nodes in the WHERE clauses
2016-03-30 16:48:01 +03:00
Onder Kalaci d917d9a615 Allow all types of nodes in the WHERE clauses
This change removes the whitelisting check on the WHERE clauses. Note that, before
this change, citus was already allowing all types of nodes with the following
format (i.e., wrap with a boolean test):

  * SELECT col FROM table WHERE (ANY EXPRESSION) is TRUE;

Thus, this change is mostly useful for allowing the expressions in the WHERE clause
directly and avoiding "unsupport clause type" errors.
2016-03-30 16:39:58 +03:00
Murat Tuncer 14c835b37d Merge pull request #402 from citusdata/bugfix/#313-UDF-on-repartitioned-subqueries
Make UDFs Work with Repartitioned Subqueries
2016-03-30 15:45:20 +03:00
eren 8a284aab92 Fixes issue #313
Prior to this change, it was not possible to use UDFs in repartitioned
subqueries. The reason is that we were setting the search path explicitly
and omiting public schema from that path.

This change adds the public schema to the explicitly set search path.
2016-03-30 15:39:12 +03:00