Sailesh Mukil has submitted this change and it was merged. 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 Reviewed-on: http://gerrit.cloudera.org:8080/5034 Reviewed-by: Michael Brown <mi...@cloudera.com> Reviewed-by: Tim Armstrong <tarmstr...@cloudera.com> Reviewed-by: Taras Bobrovytsky <tbobrovyt...@cloudera.com> Tested-by: Sailesh Mukil <sail...@cloudera.com> --- M tests/comparison/model_translator.py 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Michael Brown: Looks good to me, but someone else must approve Taras Bobrovytsky: Looks good to me, approved Sailesh Mukil: Verified Tim Armstrong: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/5034 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: I149b695889addfd7df4ca5f40dc991456da51687 Gerrit-PatchSet: 5 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Michael Brown <mi...@cloudera.com> Gerrit-Reviewer: David Knupp <dkn...@cloudera.com> Gerrit-Reviewer: Michael Brown <mi...@cloudera.com> Gerrit-Reviewer: Sailesh Mukil <sail...@cloudera.com> Gerrit-Reviewer: Taras Bobrovytsky <tbobrovyt...@cloudera.com> Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>