Michael Brown has uploaded a new patch set (#3).

Change subject: IMPALA-4450: qgen: use string concatenation operator for 
postgres queries
......................................................................

IMPALA-4450: qgen: use string concatenation operator for postgres queries

The random query generator writes a logical query Python object into
Impala or PostgreSQL dialects. When the CONCAT() function is chosen,
Impala's and PostgreSQL's CONCAT() implementations behave differently.
However, PostgreSQL has a || operator that functions like Impala's
CONCAT().

The method added here overrides the default behavior for the
PostgresqlSqlWriter. It prevents CONCAT(arg1, arg2, ..., argN) from
being written and instead causes the SQL to be written as
'arg1 || arg2 || ... || argN'.

Testing:

I made sure that we generate syntactically valid queries still on the
PostgreSQL side. This includes queries that made use of string
concatenation. I also re-ran some failed queries that previously
produced different results. They now produce the same results. This is a
very straightforward change, so unit or functional tests for this seem
overkill.

The full effects of using || instead of CONCAT() are hard to test. It's
not clear if in my manual testing of || vs. CONCAT() that I missed some
edge behavior, especially in some complicated query, nested expressions,
GROUPing BY, and so on.

Change-Id: I149b695889addfd7df4ca5f40dc991456da51687
---
M tests/comparison/model_translator.py
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/34/5034/3
-- 
To view, visit http://gerrit.cloudera.org:8080/5034
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I149b695889addfd7df4ca5f40dc991456da51687
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Michael Brown <mi...@cloudera.com>
Gerrit-Reviewer: David Knupp <dkn...@cloudera.com>

Reply via email to