oscarostlundgs opened a new issue #17143:
URL: https://github.com/apache/superset/issues/17143


   Presto engine spec seems broken in 1.3.1 as DATE presto types are mapped to 
DATETIME sqlalchemy types which are not supported by the Presto engine spec. 
   
   #### How to reproduce the bug
   
   1. Install 1.3.1
   2. Sync column tables in Superset for a table that has a DATE column
   3. Check the Superset type of the column, should be DATETIME
   
   ### Expected results
   
   Querying a Presto table with a time range should work. 
   
   ### Actual results
   
   This will prevent Superset from query the table with time constraints. The 
query will return `Cannot apply operator: date >= varchar(26)` error. When 
looking at the generated query, temporal predicates do not get included in date 
conversion function, i.e.: 
   ```
   WHERE "eventdate" >= '2021-09-18 00:00:00.000000'
     AND "eventdate" < '2021-10-18 12:35:33.000000'
   ```
   While it should be - and in prior versions was - : 
   ```
   WHERE "eventdate" >= from_iso8601_date('2021-09-18 00:00:00.000000')
     AND "eventdate" < from_iso8601_date('2021-10-18 12:35:33.000000')
   ```
   
   ### Environment
   
   - superset version: 1.3.1
   - Presto version: 343
   - pyhive version: 0.6.4
   - python version: 3.7
   
   
   ### Additional context
   
   It seems like the issue comes from the Presto engine spec mapping Dates to 
Datetime in sqlalchemy ([see this 
line](https://github.com/apache/superset/blob/master/superset/db_engine_specs/presto.py#L511))
 while the `convert_dttm` does not support DATETIME ([see 
here](https://github.com/apache/superset/blob/master/superset/db_engine_specs/presto.py#L746)).
 
   
   Note that with past versions, DATE presto columns mapped to DATE Sqlalchmy 
columns. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to