Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: org.postgresql.util.psqlexception error subquery in from must have an alias

  1. #1
    Join Date
    Dec 2010
    Posts
    193

    Angry org.postgresql.util.psqlexception error subquery in from must have an alias

    While running a report in with view on that column efined in Mondrian cube , we are getting this error ???
    How to resolve this , It's wierd as it needs an alias for main sub query . how to do that ?????
    Sathish
    Back to Pentaho


    'Be the best Pearl in the ocean of wisdom'

  2. #2
    Join Date
    Apr 2009
    Posts
    337

    Default

    Please attach your cube. Postgres always needs the subqueries to have an alias name. Maybe you can tweak your cube so that you provide an alias explicitly.


    Regards,
    Madhu

  3. #3
    Join Date
    Dec 2010
    Posts
    193

    Default

    WFD_cube.xml Hi,

    I have attached the cube. in vertical name alone we have used query . But this http://forums.pentaho.com/showthread...e9288forreview post says it is fixed. Also, in Pentaho 4.1 it works beautifully, but 4.8 ........
    Sathish
    Back to Pentaho


    'Be the best Pearl in the ocean of wisdom'

  4. #4
    Join Date
    Jun 2009
    Posts
    22

    Default

    I ran into the same problem today creating an analysis against Greenplum with Pentaho 4.8. I created the data source using a SQL query. Error is
    Caused by: java.lang.RuntimeException: org.postgresql.util.PSQLException: ERROR: subquery in FROM must have an alias
    Hint: For example, FROM (SELECT ...) [AS] foo.
    Position: 22 at com.pentaho.analyzer.service.impl.AnalysisAreaManager.executeQuery(SourceFile:299) at com.pentaho.analyzer.report.ReportManagerImpl.parseAndExecuteMDX(SourceFile:298) at com.pentaho.analyzer.report.ReportManagerImpl.getCVResultSet(SourceFile:358) at com.pentaho.analyzer.report.ReportManagerImpl.runReport(SourceFile:122) at com.pentaho.analyzer.report.ReportManagerImpl.runReport(SourceFile:93) at com.pentaho.analyzer.report.ReportRequestService$c.bq(SourceFile:268) at com.pentaho.analyzer.report.ReportRequestService$c.call(SourceFile:258) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) ... 1 more

  5. #5
    Join Date
    Jun 2009
    Posts
    22

    Default Work Around

    I found that if I create a table on the database that matches the query I used and then create the data source directly from the database table (not SQL) then I no longer get the error.

  6. #6
    Join Date
    Dec 2010
    Posts
    193

    Default

    But how far we are going to create tables , say if there are n number of tables ?? It affects the performance and database data will become dump one
    Sathish
    Back to Pentaho


    'Be the best Pearl in the ocean of wisdom'

  7. #7
    Join Date
    Mar 2007
    Posts
    142

    Default

    Would you mind attaching the full logs and the complete offending query?
    Luc Boudreau
    aka. Luc le Magnifique
    aka. Monsieur Oui Oui

    Lead Engineer, Pentaho Corporation
    Web: http://devdonkey.blogspot.com
    Twitter: luclemagnifique
    IRC: Monsieur_Oui_Oui@freenode

  8. #8
    Join Date
    Dec 2010
    Posts
    193

    Lightbulb

    Yeah . np. attaching the logs.... This is the query DEBUG [mondrian.rolap.RolapUtil] SqlStatisticsProvider.getQueryCardinality: executing sql [select count(*) from (select distinct "FACT"."gradegroup" as "c0" from (Select

    coalesce(f.wfdgradedescription,'UNKNOWN') AS "gradegroup",

    row_number() over(order by SUM(f.headCount) DESC )

    as "rownumber",

    SUM(f.headCount) as "headcount"



    FROM swfd01_vw.wfd_headcountsummary f


    group by f.wfdgradedescription

    order by SUM(f.headCount) DESC) as "FACT")], failed (org.postgresql.util.PSQLException: ERROR: subquery in FROM must have an alias

    Hint: For example, FROM (SELECT ...) [AS] foo.

    Position: 22)
    Attached Files Attached Files
    Sathish
    Back to Pentaho


    'Be the best Pearl in the ocean of wisdom'

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.