Capppo opened a new issue, #10601: URL: https://github.com/apache/doris/issues/10601
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues. ### Version Git : file:///opt/doris/opt/apache-doris-1.0.0-incubating-src@Unknown Version : 1.0.0-rc03 BuildInfo : root@095ada067400 BuildTime : Wed, 29 Jun 2022 15:49:20 UTC ### What's Wrong? Using tpch10 database, created with tpch-tools, some query, rewritten by the integration platform Denodo, cause a query fails, without apparently real error. For example, the rewriting of Q09 of the test suite, cause the following error: Execution failed: Error Failed to execute sql: org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Syntax error in line 4: ...ntity) AS amount FROM ((((tpch10.orders t0 ^ Encountered: IDENTIFIER Expected The query is: select * FROM ( SELECT s0.nation AS nation, s0.o_year AS o_year, sum(s0.amount) AS sum_profit FROM ( SELECT t5.n_name AS nation, year(t0.o_orderdate) AS o_year, ( t1.l_extendedprice * (1 - t1.l_discount) - t3.ps_supplycost * t1.l_quantity ) AS amount FROM ( ( ( ( tpch10.orders t0 JOIN tpch10.lineitem t1 ON ((t0.o_orderkey = t1.l_orderkey)) ) JOIN tpch10.supplier t2 ON ( ( cast(t1.l_suppkey as DECIMAL(20)) = cast(t2.s_suppkey as DECIMAL(20)) ) ) ) JOIN tpch10.partsupp t3 ON ( ( cast(t2.s_suppkey as DECIMAL(20)) = cast(t3.ps_suppkey as DECIMAL(20)) ) ) ) JOIN tpch10.part t4 ON ( ( cast(t1.l_partkey as DECIMAL(20)) = cast(t4.p_partkey as DECIMAL(20)) AND cast(t3.ps_partkey as DECIMAL(20)) = cast(t4.p_partkey as DECIMAL(20)) ) ) ) JOIN tpch10.nation t5 ON ( ( cast(t2.s_nationkey as DECIMAL(20)) = cast(t5.n_nationkey as DECIMAL(20)) ) ) WHERE t4.p_name like '%green%' ) s0 GROUP BY s0.nation, s0.o_year ) ob ORDER BY nation ASC, o_year DESC LIMIT 150 ### What You Expected? The query should be run. The same query pasted on Snowflake worksheet run correctly without any modification. It returns 175 rows. ### How to Reproduce? using your tpch-tool, you can generate and load all the data needed in a few minutes, then run the query above. ### Anything Else? _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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]
