<p dir="auto">I'm working on a simple line chart which has 1 time-based column and 1 fact/metric. I've attached a screen capture of the chart dialog screen. I have 1 time column (meal_date), 1 metric sum(calories), 1 group by expression (meal_date), and 1 sort by expression (1) defined on the data tab.</p>
<p dir="auto">This should yield a sql query like this:</p>
<p dir="auto">select meal_date AS meal_date,<br>
sum(calories) AS "Calories"<br>
from public.factfood<br>
group by meal_date<br>
order by 1;</p>
<p dir="auto">Very simple, very straightforward. Even the line chart itself looks ok. However there's no data displayed on the line chart. Additionally, there is an extra column called _timestamp and the result set is not sorted at all. Upon viewing the sql created, there's a lot of extra code that I would not expect to be there. Here is the sql query code created for this line chart:</p>
<p dir="auto">SELECT meal_date AS <strong>timestamp,  &lt;-- Extra/Duplicate Column, not referenced in the dialog screen<br>
meal_date AS meal_date,<br>
sum(calories) AS "Calories"<br>
FROM public.factfood<br>
JOIN                                                      &lt;-- Completely unneccessary, this is a 1 table only query, so no joins needed<br>
(SELECT meal_date AS meal_date</strong>,<br>
sum(calories) AS mme_inner__<br>
FROM public.factfood<br>
GROUP BY meal_date<br>
ORDER BY 1 DESC                             **&lt;-- Order by in the wrong place, it needs to be below the last group by **<br>
LIMIT 100) AS anon_1 ON meal_date = meal_date__<br>
GROUP BY meal_date,<br>
meal_date<br>
LIMIT 10000;</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/88514509/128579092-de4c0fa3-c4fb-40e5-ad45-b400f2e1a171.png"><img src="https://user-images.githubusercontent.com/88514509/128579092-de4c0fa3-c4fb-40e5-ad45-b400f2e1a171.png" alt="line-chart-sample" style="max-width: 100%;"></a></p>
<h3 dir="auto">Environment</h3>
<p dir="auto">Centos 8 o/s<br>
Postgres 13 DB</p>
<ul dir="auto">
<li>superset version: <code class="notranslate">1.2</code></li>
<li>python version: <code class="notranslate">3.8</code></li>
<li>node.js version: none</li>
</ul>
<p dir="auto">How do I fix these 3 errors?</p>
<p dir="auto">I need to not have the _timestamp column but I don't see where it comes from.  There's no option to not have a Time column.<br>
I need to have the order by clause utilized by the correct select stmt. Getting rid of the unnecessary join/select stmts would help.<br>
I need to see the datapoints on the chart. This is probably because of that extra _timetamp column, not sure.</p>
<p dir="auto">Make sure these boxes are checked before submitting your issue - thank you!</p>
<ul class="contains-task-list">
<li>[x ] I have checked the superset logs for python stacktraces and included it here as text if there are any.</li>
<li>[x ] I have reproduced the issue with at least the latest released version of superset.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the issue tracker for the same issue and I haven't found one similar.</li>
</ul>
<h3 dir="auto">Superset version</h3>
<p dir="auto">latest git</p>
<h3 dir="auto">Expected results</h3>
<p dir="auto">superset starts up without error</p>
<h3 dir="auto">Actual results</h3>
<p dir="auto">superset_1  | npm ERR! path /home/superset/superset/assets/node_modules<br>
superset_1  | npm ERR! code EACCES<br>
superset_1  | npm ERR! errno -13<br>
superset_1  | npm ERR! syscall mkdir<br>
superset_1  | npm ERR! Error: EACCES: permission denied, mkdir '/home/superset/superset/assets/node_modules'<br>
superset_1  | npm ERR!  { [Error: EACCES: permission denied, mkdir '/home/superset/superset/assets/node_modules']<br>
superset_1  | npm ERR!   cause:<br>
superset_1  | npm ERR!    { Error: EACCES: permission denied, mkdir '/home/superset/superset/assets/node_modules'<br>
superset_1  | npm ERR!      type: 'OperationalError',<br>
superset_1  | npm ERR!      '$error': '$error',<br>
superset_1  | npm ERR!      cause:<br>
superset_1  | npm ERR!       { errno: -13,<br>
superset_1  | npm ERR!         code: 'EACCES',<br>
superset_1  | npm ERR!         syscall: 'mkdir',<br>
superset_1  | npm ERR!         path: '/home/superset/superset/assets/node_modules' },<br>
superset_1  | npm ERR!      isOperational: true,<br>
superset_1  | npm ERR!      errno: -13,<br>
superset_1  | npm ERR!      code: 'EACCES',<br>
superset_1  | npm ERR!      syscall: 'mkdir',<br>
superset_1  | npm ERR!      path: '/home/superset/superset/assets/node_modules' },<br>
superset_1  | npm ERR!   isOperational: true,<br>
superset_1  | npm ERR!   stack:<br>
superset_1  | npm ERR!    'Error: EACCES: permission denied, mkdir '/home/superset/superset/assets/node_modules'',<br>
superset_1  | npm ERR!   type: 'OperationalError',<br>
superset_1  | npm ERR!   '$error': '$error',<br>
superset_1  | npm ERR!   errno: -13,<br>
superset_1  | npm ERR!   code: 'EACCES',<br>
superset_1  | npm ERR!   syscall: 'mkdir',<br>
superset_1  | npm ERR!   path: '/home/superset/superset/assets/node_modules' }<br>
superset_1  | npm ERR!<br>
superset_1  | npm ERR! The operation was rejected by your operating system.<br>
superset_1  | npm ERR! It is likely you do not have the permissions to access this file as the current user<br>
superset_1  | npm ERR!<br>
superset_1  | npm ERR! If you believe this might be a permissions issue, please double-check the<br>
superset_1  | npm ERR! permissions of the file and its containing directories, or try running<br>
superset_1  | npm ERR! the command again as root/Administrator (though this is not recommended).<br>
superset_1  |<br>
superset_1  | npm ERR! A complete log of this run can be found in:<br>
superset_1  | npm ERR!     /home/superset/.npm/_logs/2019-02-15T09_24_16_955Z-debug.log<br>
superset_superset_1 exited with code 243</p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">git clone <a href="https://github.com/apache/incubator-superset/">https://github.com/apache/incubator-superset/</a><br>
cd incubator-superset/contrib/docker</p>
<h1 dir="auto">prefix with SUPERSET_LOAD_EXAMPLES=yes to load examples:</h1>
<p dir="auto">docker-compose run --rm superset ./docker-init.sh</p>
<h1 dir="auto">you can run this command everytime you need to start superset now:</h1>
<p dir="auto">docker-compose up</p>
<p dir="auto">EDIT:<br>
additional infos:<br>
CentOS Linux release 7.6.1810 (Core)<br>
docker version:<br>
Docker version 18.09.2, build <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/apache/superset/commit/62479621cc5b41e2d1bd704022f7ded184b7214d/hovercard" href="https://github.com/apache/superset/commit/62479621cc5b41e2d1bd704022f7ded184b7214d"><tt>6247962</tt></a></p>