crescendo-medix opened a new issue, #528:
URL: https://github.com/apache/arrow-datafusion-python/issues/528

   **Describe the bug**
   The following SQL will result in a parser error.  
   SELECT MODE() WITHIN GROUP (ORDER BY median_house_value) FROM 
california_table. 
     
   WITHIN GROUP not supported ?
   
   **To Reproduce**
   ```py
   import datafusion
   ctx = datafusion.SessionContext()
   datafusion.__version__
   ```
   *32.0.0*
   
   ```py
   ctx.register_csv('california_table', 'california_housing_train.csv')
   ctx.table('california_table').schema()
   ```
   *longitude: double*
   *latitude: double*
   *housing_median_age: double*
   *total_rooms: double*
   *total_bedrooms: double*
   *population: double*
   *households: double*
   *median_income: double*
   *median_house_value: double*
   
   ```py
   sql = 'SELECT MODE() WITHIN GROUP (ORDER BY median_house_value) FROM 
california_table'
   ctx.sql(sql)
   ```
   
   >Exception 
          Traceback (most 
recent call last)  
   Input In [3], in <module>  
   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1 sql = 'SELECT 
MODE() WITHIN GROUP (ORDER BY median_house_value) FROM california_table'
   ----> 2 ctx.sql(sql)
   >
   >Exception: DataFusion error: SQL(ParserError("Expected end of statement, 
found: GROUP"))  
   
   


-- 
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]

Reply via email to