* Add KeyValue model for storing id-value pairs
use it for storing shared queries
* Change string to text and added test
* Put getQueryLink in one place
* Changed migration down version
* Changes based on comments
* Update bcf3126872fc_add_keyvalue.py
In Vertica, inner queries require different aliases than the main query.
This is an example of query generated before this patch:
SELECT chain AS chain,
weekstartday AS __timestamp,
SUM(inventory) AS "Inventory"
FROM mytable
JOIN
(SELECT chain AS chain__,
SUM(inventory) AS "Inventory"
FROM mytable
WHERE weekstartday >= '2016-01-24 00:00:00'
AND weekstartday <= '2017-01-17 00:00:00'
GROUP BY chain
ORDER BY "Inventory" DESC LIMIT 50) AS anon_1 ON chain = chain__
WHERE weekstartday >= '2016-01-24 00:00:00'
AND weekstartday <= '2017-01-17 00:00:00'
GROUP BY chain,
weekstartday
ORDER BY "Inventory" DESC LIMIT 50000
Which in Vertica produces the error:
Error: ('42702', '[42702] ERROR 2671: Column reference "inventory" is ambiguous\n (2671) (SQLExecDirectW)')
And this is the same example after the patch:
SELECT chain AS chain,
weekstartday AS __timestamp,
SUM(inventory) AS "Inventory"
FROM mytable
JOIN
(SELECT chain AS chain__,
SUM(inventory) AS mme_inner__
FROM mytable
WHERE weekstartday >= '2016-01-24 00:00:00'
AND weekstartday <= '2017-01-17 00:00:00'
GROUP BY chain
ORDER BY mme_inner__ DESC LIMIT 50) AS anon_1 ON chain = chain__
WHERE weekstartday >= '2016-01-24 00:00:00'
AND weekstartday <= '2017-01-17 00:00:00'
GROUP BY chain,
weekstartday
ORDER BY "Inventory" DESC LIMIT 50000
Related PR:
19f5371787
* Cleanup fulfilled requests after approve
* Modified tests
* Moved to separate test, add user to access functions
* Moved to separate test and added test cases
* Fixed issue with dryrun
* More changes based on comments
I had issues compiling the src, I think it's because the syntax is different than the one used here?
With the dist it works fine.
I also saw there were other related issues in the past, so I'm suggesting to switch to the dist file.
* [explorev2] using label in 'Visualization Type' Select
* moved url related logic upstream in the caller
* moved option creation logic from render method to the constructor as
it only needs to be executed once
* Refactoring out getOptions